cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A097961 Numbers k such that the sum of the first k odd primes is divisible by k.

This page as a plain text file.
%I A097961 #16 Jul 24 2023 23:07:09
%S A097961 1,2,3,60,73,357,690,970,1560,1844,2016,2071,3267,7034,22388,37244,
%T A097961 137166,808334,1126996,3420839,4971830,14647946,15553569,21957090,
%U A097961 31327140,90514444,98576118,204198604,210662116,553825420,1395717645,2820805440,6780317160
%N A097961 Numbers k such that the sum of the first k odd primes is divisible by k.
%F A097961 Numbers k such that A071148(k)/k or (A007504(k+1)-2)/k is an integer.
%F A097961 Sum_{i=1..a(n)} prime(i) = n*A363477(n). - _Ya-Ping Lu_, Jun 16 2023
%e A097961 a(1) = 1 since 3 is divisible by 1.
%e A097961 a(2) = 2 since 3 + 5 = 8 is divisible by 2.
%e A097961 a(3) = 3 since 3 + 5 + 7 = 15 is divisible by 3.
%e A097961 a(4) != 4 since 3 + 5 + 7 + 11 = 26 is not divisible by 4.
%e A097961 98576118 * 977748014 = 96382603602329652.
%t A097961 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 *)
%o A097961 (C++)
%o A097961 #include <fstream>
%o A097961 #include <iostream>
%o A097961 using namespace std;
%o A097961 int primes[999] = {/* first 999 odd primes here, omitted for space*/};
%o A097961 int total = 0;
%o A097961 int main() {
%o A097961   for (int a = 1; a < 1000; a++)  {
%o A097961     total = total + primes[a-1];
%o A097961     if (total % a == 0) cout << a << ", ";
%o A097961   }
%o A097961   return 0;
%o A097961 } /* Anne Donovan, Oct 22 2004 */
%o A097961 (Python)
%o A097961 from sympy import sieve
%o A097961 L = sieve.primerange(3, 1.7*10**11); s, k = 0, 0
%o A097961 for p in L:
%o A097961     s += p;  k += 1
%o A097961 if s%k == 0: print(k, end = ", ")  # _Ya-Ping Lu_, Jun 16 2023
%Y A097961 Cf. A071148, A363477.
%K A097961 easy,nonn
%O A097961 1,2
%A A097961 Anne M. Donovan (anned3005(AT)aol.com), Oct 22 2004
%E A097961 More terms from _Robert G. Wilson v_, Oct 23 2004
%E A097961 a(28)-a(30) from _Rémy Sigrist_, Sep 25 2016
%E A097961 a(31)-a(33) from _Ya-Ping Lu_, Jun 16 2023