login
A097961
Numbers k such that the sum of the first k odd primes is divisible by k.
3
1, 2, 3, 60, 73, 357, 690, 970, 1560, 1844, 2016, 2071, 3267, 7034, 22388, 37244, 137166, 808334, 1126996, 3420839, 4971830, 14647946, 15553569, 21957090, 31327140, 90514444, 98576118, 204198604, 210662116, 553825420, 1395717645, 2820805440, 6780317160
OFFSET
1,2
FORMULA
Numbers k such that A071148(k)/k or (A007504(k+1)-2)/k is an integer.
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
Sequence in context: A152657 A299172 A154253 * A145556 A124083 A112098
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