OFFSET
1,1
COMMENTS
Numbers k such that Sum_{i=1..k} (prime(i+k) mod prime(i)) is prime.
LINKS
Robert Israel, Table of n, a(n) for n = 1..1000
EXAMPLE
a(1) = 2 is a term because A354975(2) = (5 mod 2) + (7 mod 3) = 2 is prime.
MAPLE
filter:= proc(n) local k;
isprime(add(ithprime(n+k) mod ithprime(k), k=1..n))
end proc:
select(filter, [$1..1000]);
PROG
(PARI) isok(k) = isprime(sum(i=1, k, prime(i+k) % prime(i))); \\ Michel Marcus, Jun 19 2022
(Python)
from itertools import count, islice
from sympy import prime, isprime
def A354972_gen(): # generator of terms
for n in count(1):
if isprime(sum(prime(i+n) % prime(i) for i in range(1, n+1))):
yield n
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Jun 15 2022
STATUS
approved