Back to the Basics of Math

APL (Dyalog), 77 bytes

Full program which prompts for n, looks up the result in the list of 60 possible results, and prints that to STDOUT.


Try it online!

''[] index the string by the following:

 prompt for n

60| remainder when dividing by 60

⎕AV⍳ find ɩndices in the Atomic Vector (the character set)

¯50+ add negative fifty

05AB1E, 48 47 43 42 bytes



Try it online! or see the Whole sequence


¾4×S                                         # initialize stack with [0,0,0,0]
    sF                                  }    # for N in range [0 ... input-1] do:
      D                                      # duplicate
       2äε            }                      # for each pair of values
          T%>                                # get last digit of each and increment
              …+-*Nè                         # index into "+-*" with N
             `      .V                       # apply the function to our values
                       O                     # sum the pair
                        s                    # swap the list of 4 values to the top
                         0NÌ‚                # push [0, N+2]
                             ÂTS-            # bifurcate and subtract [1,0]
                                 ‚           # pair, resulting in [[0,N+2],[N+1,0]]
                                  NĒ}       # reverse each pair N+1 times
                                      ˜+     # flatten and add to the list of values
                                               from last iteration
                                         \   # discard the final list

Python 3, 89 bytes

lambda i:ord('HEVWD¥Z;PQ:]Z;¦WDKR;FKDo`;tU:OR;taDsPEPQDIPE¦a:_R;PU:¡`EVK:O'[i%60])-68

Try it online!