OFFSET
1,2
COMMENTS
For any n > 0, the sequence s is eventually periodic, so this sequence is well defined.
a(n) tends to infinity as n tends to infinity.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
FORMULA
a(n) > k for any k >= 0 and n > A003095(k).
EXAMPLE
For n = 42:
- we have:
k s(k)
- ----
1 1
2 2
3 5
4 26
5 5
6 26
...
- the sequence s has 4 distinct values, so a(42) = 4.
PROG
(PARI) a(n) = { my (s=0, v=0, w=0); while (!bittest(w, s), w+=2^s; v++; s=(s^2+1)%n); v }
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Mar 04 2020
STATUS
approved