login
A182511
a(0)=1, a(1)=2, a(n) = (a(n-2)*a(n-1) mod n) + 1.
1
1, 2, 1, 3, 4, 3, 1, 4, 5, 3, 6, 8, 1, 9, 10, 1, 11, 12, 7, 9, 4, 16, 21, 15, 4, 11, 19, 21, 8, 24, 13, 3, 8, 25, 31, 6, 7, 6, 5, 31, 36, 10, 25, 36, 21, 37, 42, 4, 25, 3, 26, 28, 1, 29, 30, 46, 37, 50, 53, 55, 36, 29, 53, 26, 35, 1, 36, 37, 41, 69, 30, 12, 1
OFFSET
0,2
COMMENTS
Indices n such that a(n)=n:
3, 4, 69, 709, 4267, 11807, 53694, 172760, 243621, 2097734, 1219835399, 1285668346.
Conjectures:
1. Sequence contains infinitely many terms such that a(n)=n.
2. Infinitely many 1's.
LINKS
MATHEMATICA
nxt[{n_, a_, b_}]:={n+1, b, Mod[a*b, n+1]+1}; NestList[nxt, {1, 1, 2}, 80][[All, 2]] (* Harvey P. Dale, Apr 16 2022 *)
PROG
(Python)
prpr = 1
prev = 2
for n in range(2, 99):
current = (prpr * prev) % n + 1
print prpr,
prpr = prev
prev = current
CROSSREFS
Cf. A182458.
Sequence in context: A059128 A356248 A050273 * A187064 A367019 A193020
KEYWORD
nonn,easy
AUTHOR
Alex Ratushnyak, May 03 2012
STATUS
approved