|
PROG
|
(PARI) a071148(n) = sum(k=2, n+1, prime(k))
isdivisible(n) = Mod(a071148(n), n)==0
terms(n) = my(i=0, p=2); while(i < n, if(isdivisible(p), print1(p, ", "); i++); p=nextprime(p+1))
/* The following function call prints the initial four terms */
(Perl) use ntheory ":all"; my($s, $l, $pr)=(0, 0, prime_iterator(3)); forprimes { $s += $pr->() for $l+1 .. $_; $l=$_; say unless $s % $_; } 1e7; # Dana Jacobsen, Sep 23 2016
|