OFFSET
0,1
FORMULA
a(n) = smallest k>n such that 2^k == n (mod k+2).
EXAMPLE
Smallest n such that A213859(n) = 7 is 11, so a(7) = 11.
MATHEMATICA
nn = 25; t = Table[-1, {nn}]; Do[p = PowerMod[2, n, n + 2]; If[0 <= p <= nn && t[[p + 1]] == -1, t[[p + 1]] = n], {n, 0, 10^7}]; t (* T. D. Noe, Jun 26 2012 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Jun 22 2012
EXTENSIONS
a(26)-a(50) from T. D. Noe, Jun 26 2012
Terms a(25) and a(51) onward from Max Alekseyev, Feb 01 2014
STATUS
approved