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.

A034960 Divide odd numbers into groups with prime(n) elements and add together.

This page as a plain text file.
%I A034960 #60 Jun 23 2025 14:32:30
%S A034960 4,21,75,189,495,897,1683,2565,4071,6641,8959,13209,17835,22317,28623,
%T A034960 37577,48439,57401,71623,85697,98623,118737,138195,163493,196231,
%U A034960 224321,249775,281945,310759,347249,420751,467801,525943,571985,656047
%N A034960 Divide odd numbers into groups with prime(n) elements and add together.
%H A034960 Hieronymus Fischer, <a href="/A034960/b034960.txt">Table of n, a(n) for n = 1..10000</a>
%F A034960 From _Hieronymus Fischer_, Sep 26 2012: (Start)
%F A034960 a(n) = Sum_{k=A007504(n-1)+1..A007504(n)} (2*k-1).
%F A034960 a(n) = A007504(n)^2 - A007504(n-1)^2.
%F A034960 a(n) = 2*A034957(n) + A000040(n).
%F A034960 a(n) = 2*A034956(n) - A000040(n).
%F A034960 a(n) = A034959(n) + A000040(n). (End)
%F A034960 a(n) = A061802(n)*A000040(n). - _Marco Zárate_, May 12 2023
%e A034960 {1,3} #2 S=4;
%e A034960 {5,7,9} #3 S=21;
%e A034960 {11,13,15,17,19} #5 S=75;
%e A034960 {21,23,25,27,29,31,33} #7 S=189.
%p A034960 S:= n-> sum(ithprime(k), k=1..n): seq(S(n+1)^2-S(n)^2, n=0..40); # _Gary Detlefs_, Dec 20 2011
%t A034960 Accumulate[Join[{2}, ListConvolve[{1, 1}, #]]]*# & [Prime[Range[50]]] (* _Paolo Xausa_, Jun 23 2025 *)
%o A034960 (Python)
%o A034960 from itertools import islice
%o A034960 from sympy import nextprime
%o A034960 def A034960_gen(): # generator of terms
%o A034960     a, p = 0, 2
%o A034960     while True:
%o A034960         yield p*((a<<1)+p)
%o A034960         a, p = a+p, nextprime(p)
%o A034960 A034960_list = list(islice(A034960_gen(),20)) # _Chai Wah Wu_, Mar 22 2023
%o A034960 (PARI) a0(n) = vecsum(primes(n))^2 - vecsum(primes(n-1))^2; \\ _Michel Marcus_, Jun 16 2024
%Y A034960 Cf. A006003, A027441, A034959.
%Y A034960 Cf. A007504.
%Y A034960 Cf. A000040, A034956, A034957, A034958, A046992, A061802.
%K A034960 nonn
%O A034960 1,1
%A A034960 _Patrick De Geest_, Oct 15 1998