OFFSET
2,1
COMMENTS
Conjecture: every integer > 1 is in the sequence.
Theorem: Let p and q be prime numbers for which there exists an integer x such that p divides 1 + x + x^2 + ... + x^(q-1). Then p == 1 (mod q) or p = q.
EXAMPLE
MAPLE
with(numtheory):nn:=100:
for n from 2 to nn do:
p:=ithprime(n):d:=factorset(p-1):n0:=nops(d):q:=d[n0]:ii:=0:
for x from 1 to 10^5 while(ii=0) do:
s:=sum('x^(i-1)', 'i'=1..q):
if irem(s, p)=0 then
ii:=1:printf(`%d, `, x):
else fi:
od:
od:
MATHEMATICA
Array[Block[{k = 2}, While[Mod[Total[k^#2 ], #1] != 0, k++]; k ] & @@ {Prime@ #, Range[0, FactorInteger[Prime@ # - 1][[-1, 1]] - 1 ]} &, 76, 2] (* Michael De Vlieger, Jan 27 2020 *)
PROG
(PARI) a(n) = {my(p=prime(n), q=vecmax(factor(p-1)[, 1]), x=1); while (sum(k=0, q-1, x^k) % p, x++); x; } \\ Michel Marcus, Jan 30 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Jan 27 2020
STATUS
approved