0
$\begingroup$

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?

$\endgroup$
1
  • $\begingroup$ What do you mean? It's perodic, and $a_n$ is determined by $n\pmod {11}$. So you just need to reduce your index $\pmod {11}$ and use a (very simple) look up table. Or something like $\min(k,11-k)$ where $k$ is the remainder on division by $11$. $\endgroup$
    – lulu
    Mar 1, 2023 at 20:57

1 Answer 1

0
$\begingroup$

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))

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .