OFFSET
1,1
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..430
EXAMPLE
MAPLE
f:= proc(n) local R, r, i;
R:= sort(map(rhs@op, [msolve(x^6=1, 7^n)]));
for i from 0 do
for r in R do
if isprime(7^n * i + r) then return 7^n * i + r fi
od od;
end proc:
R:= NULL: count:= 0:
for k from 1 while count < 100 do
v:= f(k);
if v = w then R:= R, k-1; count:= count+1 fi;
w:= v;
od:
R;
PROG
(Python)
from itertools import count, islice
from sympy import nthroot_mod, isprime
def A369154_gen(): # generator of terms
c, m = 1, 1
for k in count(0):
m *= 7
r = sorted(nthroot_mod(1, 6, m, all_roots=True))
for i in count(0, m):
for p in r:
if isprime(i+p):
if i+p == c:
yield k
c = i+p
break
else:
continue
break
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Jan 14 2024
STATUS
approved