g | x | w | all
Bytes Lang Time Link
099Backhand240527T071555Zemanresu

Backhand, 99 bytes

IIIIII222---$$$444---:::111LLL)))rrr:::111LLL(((***!!!'''BBB***666+++jjj:::111LLL]]]333***sss$$$hhh

Attempt This Online!

Backhand is a language created by Jo King in which, by default, the interpreter only reads every third character. This program uses the most basic form of , repeating each character several times, and removing any 1-2 characters results in the same characters being in the 0th, 3rd, 6th etc positions. I doubt there's a smarter way to do it.

Explanation

This is the deduplicated version of the code. There's probably a better way to do control flow but I don't know how. There might also be a simple numerical formula for this, but I haven't figured out one.

II                                # Take inputs
  2-                              # Repeatedly, subtract 2 from one value
    $4-                           # And 4 from the other
       :1L                        # Is m at least 1?
           r:1L                   # Is p at least 1?
          )    (*                 # Multiply those together
                 !'B*  j          # If it's 0, loop ends, jump to index 72 (after loop)
                     6+           # Otherwise jump to index 6 (start of loop)
                        :1L       # If p <= 1
                           ]3*s$  #   then swap so m is on top of the top
                                h # Halt and output the remaining number.