OFFSET
1,4
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(7) = 4 because A097504(7) = 58 and of the first 7 primes p, there are 4 for which 58 mod p is prime, namely 58 mod 5 = 3, 58 mod 7 = 2, 58 mod 31 = 3 and 58 mod 17 = 7.
MAPLE
P:= [seq(ithprime(i), i=1..100)]:
SP:= ListTools:-PartialSums(P):
f:= proc(n) local t, L;
t:= SP[n];
L:= P[1..n];
nops(select(p -> member(t mod p, L), L))
end proc:
map(f, [$1..100]);
PROG
(PARI) a(n) = my(v=primes(n), s=vecsum(v)); sum(k=1, #v, isprime(s % v[k])); \\ Michel Marcus, Apr 28 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Apr 28 2021
STATUS
approved
