login
Group the positive integers as (1, 2), (3, 4, 5), (6, 7, 8, 9, 10), (11, 12, 13, 14, 15, 16, 17), ... the n-th group containing prime(n) elements. Except the first, all groups contain an odd number of elements and hence have a middle term. Sequence gives the middle terms starting from group 2.
2

%I #26 May 26 2021 03:07:04

%S 4,8,14,23,35,50,68,89,115,145,179,218,260,305,355,411,471,535,604,

%T 676,752,833,919,1012,1111,1213,1318,1426,1537,1657,1786,1920,2058,

%U 2202,2352,2506,2666,2831,3001,3177,3357,3543,3735,3930,4128,4333,4550,4775

%N Group the positive integers as (1, 2), (3, 4, 5), (6, 7, 8, 9, 10), (11, 12, 13, 14, 15, 16, 17), ... the n-th group containing prime(n) elements. Except the first, all groups contain an odd number of elements and hence have a middle term. Sequence gives the middle terms starting from group 2.

%H Christian Krause, <a href="https://github.com/ckrause/loda/blob/master/programs/oeis/073/A073612.asm">LODA program</a>

%F Difference of the triangular numbers corresponding to the sum of first (n+1) primes and that of first n primes/prime(n) for n > 1.

%F a(n) = (A061802(n-1) + 1)/2. - _Hugo Pfoertner_, Apr 30 2021

%F a(n) = A007504(n) - (prime(n)-1)/2. - _Andrew Howroyd_, Apr 30 2021

%F a(n) = (Sum_{i=2..n-1} A001043(i)) / 2 + 4. - _Christian Krause_, May 06 2021

%t Table[ Sum[ Prime[i], {i, 1, n}] - Floor[ Prime[n]/2], {n, 2, 50}]

%t For[lst={}; n1=3; n=2, n<=100, n++, n2=n1+Prime[n]; AppendTo[lst, (n2+n1-1)/2]; n1=n2]; lst

%t Module[{nn=50,no,pr},no=Total[Prime[Range[2,nn+1]]];pr=Prime[Range[2,nn]]; #[[ (Length[ #]+1)/2]]&/@TakeList[Range[3,no],pr]] (* Requires Mathematica version 11 or later *) (* _Harvey P. Dale_, Sep 20 2017 *)

%Y Cf. A007504, A034956, A061802.

%K nonn

%O 2,1

%A _Amarnath Murthy_, Aug 05 2002

%E Edited by _Robert G. Wilson v_ and _T. D. Noe_, Aug 08 2002