OFFSET
1,3
COMMENTS
Sequence inspired by A102863 (Giovanni Teofilatto).
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..20000
EXAMPLE
a(2)=0 because neither 2 nor 3 is a divisor of 5;
a(5)=2 because exactly two terms from {2,3,5,7,11} are divisors of 2+3+5+7+11=28.
MAPLE
with(numtheory): a:=n->nops(factorset(sum(ithprime(k), k=1..n)) intersect {seq(ithprime(j), j=1..n)}): seq(a(n), n=1..130);
# second Maple program:
s:= proc(n) option remember; `if`(n<1, 0, ithprime(n)+s(n-1)) end:
a:= n-> nops(select(x-> x <= ithprime(n), numtheory[factorset](s(n)))):
seq(a(n), n=1..100); # Alois P. Heinz, Apr 11 2018
MATHEMATICA
a[n_] := Module[{pp = Prime[Range[n]], s}, s = Total[pp]; Count[pp, p_ /; Divisible[s, p]]];
Array[a, 105] (* Jean-François Alcover, Jun 19 2018 *)
PROG
(PARI) a(n) = #select(x->(x <= prime(n)), factor(sum(k=1, n, prime(k)))[, 1]); \\ Michel Marcus, Apr 11 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Emeric Deutsch, Apr 19 2005
STATUS
approved