How to get equation from OEIS (for a zigzag repeating sequence)

33 Views Asked by At

While trying to find an answer to my own Stack Overflow question, I came upon this helpful math Stack Exchange where the person who answered referred to OEIS and provided an equation. I entered my series into OEIS and received this page. Apparently, this is a period 10 zigzag repeating sequence.

My question is, how can I get the equation from that page so I can adapt it into my program logic?

1

There are 1 best solutions below

0
On

This was answered by someone in my Stack Overflow question. I didn't understand how to read the OEIS result to find the formula for the sequence, which in this case is:

a(n) = abs(n - 10*round(n/10))