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.

A034959 Divide even numbers into groups with prime(n) elements and add together.

This page as a plain text file.
%I A034959 #22 Mar 22 2023 21:59:47
%S A034959 2,18,70,182,484,884,1666,2546,4048,6612,8928,13172,17794,22274,28576,
%T A034959 37524,48380,57340,71556,85626,98550,118658,138112,163404,196134,
%U A034959 224220,249672,281838,310650,347136,420624,467670,525806,571846,655898
%N A034959 Divide even numbers into groups with prime(n) elements and add together.
%H A034959 Hieronymus Fischer, <a href="/A034959/b034959.txt">Table of n, a(n) for n = 1..10000</a>
%F A034959 From _Hieronymus Fischer_, Sep 27 2012: (Start)
%F A034959 a(n) = 2*Sum_{k=(A007504(n-1)+1)..A007504(n)} (k-1), n > 1.
%F A034959 a(n) = (A007504(n) - A007504(n-1))*(A007504(n) + A007504(n-1) - 1), n > 1.
%F A034959 a(n) = 2*(A000217(A007504(n) - 1) - A000217(A007504(n-1) - 1)), n > 1.
%F A034959 If we define A007504(0):=0, then the formulas above are also true for n=1.
%F A034959 a(n) = 2*A034957(n).
%F A034959 a(n) = A034960(n) - A000040(n).
%F A034959 (End)
%e A034959 {0,2} #2 S=2;
%e A034959 {4,6,8} #3 S=18;
%e A034959 {10,12,14,16,18} #5 S=70;
%e A034959 {20,22,24,26,28,30,32} #7 S=182.
%o A034959 (Python)
%o A034959 from itertools import islice
%o A034959 from sympy import nextprime
%o A034959 def A034959_gen(): # generator of terms
%o A034959     a, p = 0, 2
%o A034959     while True:
%o A034959         yield p*((a<<1)+p-1)
%o A034959         a, p = a+p, nextprime(p)
%o A034959 A034959_list = list(islice(A034959_gen(),20)) # _Chai Wah Wu_, Mar 22 2023
%Y A034959 Cf. A006003, A027441, A034960.
%Y A034959 Cf. A046992, A034956-A034958.
%K A034959 nonn
%O A034959 1,1
%A A034959 _Patrick De Geest_, Oct 15 1998