OFFSET
0,5
COMMENTS
First occurrence of n such that n^(n+1) (modulo n+2) == k for k = 1, 2, 3, ..., or 0 if no such n is known: 1, 20735, 10667, 4, 0, 3761, 3820819, 8, 33, 40, 350849481, 12, 25, ..., .
Congruencies not yet occurring for n < 4.6*10^9: 5, 47, 57, 105, 203, 233, 255, 293, 333, 354, 377, 405, 433, ..., .
LINKS
Carl R. White, Table of n, a(n) for n = 0..10000
FORMULA
a(n-2) = A062173(n) if n is odd or n is power of two, and a(n-2) = n - A062173(n) otherwise. - Thomas Ordowski, Nov 28 2013
MATHEMATICA
Table[PowerMod[n, n+1, n+2], {n, 0, 120}]
PROG
(PARI) a(n) = lift(Mod(n, n+2)^(n+1)); \\ Michel Marcus, Dec 17 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Jul 14 2005
STATUS
approved