The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A332966 a(n) is the largest value in the sequence s defined by s(1) = 0 and for any k > 0, s(k+1) = (s(k)^2+1) mod n. 2
0, 1, 2, 2, 2, 5, 5, 5, 8, 7, 6, 5, 5, 12, 11, 10, 16, 17, 12, 17, 5, 17, 13, 5, 5, 5, 26, 26, 26, 26, 26, 26, 26, 33, 26, 29, 26, 31, 26, 37, 32, 26, 36, 26, 26, 33, 43, 26, 47, 30, 50, 26, 41, 53, 50, 26, 50, 50, 30, 50, 53, 57, 47, 37, 57, 26, 56, 65, 59 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
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
FORMULA
a(n) >= A003095(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 largest value 26, so a(42) = 26.
PROG
(PARI) a(n) = { my (s=0, v=s, w=0); while (!bittest(w, s), w+=2^s; v=max(v, s); s=(s^2+1)%n); v }
CROSSREFS
Sequence in context: A123081 A020917 A308772 * A035643 A324925 A163946
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Mar 04 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 25 03:08 EDT 2024. Contains 372782 sequences. (Running on oeis4.)