OFFSET
0,2
COMMENTS
LINKS
Michel Marcus, Table of n, a(n) for n = 0..149
MATHEMATICA
a[0] = 1; a[n_] := Module[{k = n + 1}, While[PowerMod[2, k - n, k] != 1, k++];
k]; Array[a, 60, 0] (* Amiram Eldar, Aug 17 2021 *)
PROG
(Python)
def a(n):
if n == 0: return 1
k = n + 1
while pow(2, k-n, k) != 1: k += 1
return k
print([a(n) for n in range(61)]) # Michael S. Branicky, Aug 17 2021
(PARI) a(n) = my(k=n+1); while(Mod(2, k)^(k-n) != 1, k++); k; \\ Michel Marcus, Aug 17 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Thomas Ordowski, Aug 17 2021
EXTENSIONS
More terms from Amiram Eldar, Aug 17 2021
STATUS
approved