OFFSET
1,2
FORMULA
Sum_{i=1..a(n)} prime(i) = n*A363477(n). - Ya-Ping Lu, Jun 16 2023
EXAMPLE
a(1) = 1 since 3 is divisible by 1.
a(2) = 2 since 3 + 5 = 8 is divisible by 2.
a(3) = 3 since 3 + 5 + 7 = 15 is divisible by 3.
a(4) != 4 since 3 + 5 + 7 + 11 = 26 is not divisible by 4.
98576118 * 977748014 = 96382603602329652.
MATHEMATICA
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; p = 2; s = 0; Do[p = NextPrim[p]; s = s + p; If[ Mod[s, n] == 0, Print[n]], {n, 151666666}] (* Robert G. Wilson v, Oct 23 2004 *)
PROG
(C++)
#include <fstream>
#include <iostream>
using namespace std;
int primes[999] = {/* first 999 odd primes here, omitted for space*/};
int total = 0;
int main() {
for (int a = 1; a < 1000; a++) {
total = total + primes[a-1];
if (total % a == 0) cout << a << ", ";
}
return 0;
} /* Anne Donovan, Oct 22 2004 */
(Python)
from sympy import sieve
L = sieve.primerange(3, 1.7*10**11); s, k = 0, 0
for p in L:
s += p; k += 1
if s%k == 0: print(k, end = ", ") # Ya-Ping Lu, Jun 16 2023
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Anne M. Donovan (anned3005(AT)aol.com), Oct 22 2004
EXTENSIONS
More terms from Robert G. Wilson v, Oct 23 2004
a(28)-a(30) from Rémy Sigrist, Sep 25 2016
a(31)-a(33) from Ya-Ping Lu, Jun 16 2023
STATUS
approved