A034958
Divide primes into groups with prime(n) elements and add together.
Original entry on oeis.org
5, 23, 101, 311, 931, 1895, 3875, 6349, 10643, 18335, 25873, 39593, 55607, 71301, 94559, 127315, 167495, 204063, 258283, 315087, 369749, 451635, 533015, 640097, 779283, 902789, 1013795, 1159073, 1295871, 1457935, 1786691, 2002645, 2272221
Offset: 1
a(1) = 5 because the first 2 primes are 2 and 3 and 2 + 3 = 5.
a(2) = 23 because the next 3 primes are 5, 7, 11, and they add up to 23.
a(3) = 101 because the next 5 primes are 13, 17, 19, 23, 29 which add up to 101.
a(4) = 311 because the next 7 primes are 31, 37, 41, 43, 47, 53, 59 and they add up to 311.
-
Join[{5},Total[Prime[Range[#[[1]]+1,#[[2]]]]]&/@Partition[ Accumulate[ Prime[ Range[40]]],2,1]] (* Harvey P. Dale, Oct 03 2013 *)
Module[{nn=33},Total/@TakeList[Prime[Range[Total[Prime[Range[nn]]]]], Prime[ Range[ nn]]]] (* Requires Mathematica version 11 or later *) (* Harvey P. Dale, Mar 16 2018 *)
s = 0; Total[Table[s = s + 1; Prime[s], {j, 33}, {n, Prime[j]}], {2}] (* Horst H. Manninger, Jan 17 2019 *)
-
s(n) = sum(k=1, n, prime(k)); \\ A007504
a(n) = s(s(n)) - s(s(n-1)); \\ Michel Marcus, Oct 12 2018
A034960
Divide odd numbers into groups with prime(n) elements and add together.
Original entry on oeis.org
4, 21, 75, 189, 495, 897, 1683, 2565, 4071, 6641, 8959, 13209, 17835, 22317, 28623, 37577, 48439, 57401, 71623, 85697, 98623, 118737, 138195, 163493, 196231, 224321, 249775, 281945, 310759, 347249, 420751, 467801, 525943, 571985, 656047
Offset: 1
{1,3} #2 S=4;
{5,7,9} #3 S=21;
{11,13,15,17,19} #5 S=75;
{21,23,25,27,29,31,33} #7 S=189.
-
S:= n-> sum(ithprime(k), k=1..n): seq(S(n+1)^2-S(n)^2, n=0..40); # Gary Detlefs, Dec 20 2011
-
Accumulate[Join[{2}, ListConvolve[{1, 1}, #]]]*# & [Prime[Range[50]]] (* Paolo Xausa, Jun 23 2025 *)
-
a0(n) = vecsum(primes(n))^2 - vecsum(primes(n-1))^2; \\ Michel Marcus, Jun 16 2024
-
from itertools import islice
from sympy import nextprime
def A034960_gen(): # generator of terms
a, p = 0, 2
while True:
yield p*((a<<1)+p)
a, p = a+p, nextprime(p)
A034960_list = list(islice(A034960_gen(),20)) # Chai Wah Wu, Mar 22 2023
A034959
Divide even numbers into groups with prime(n) elements and add together.
Original entry on oeis.org
2, 18, 70, 182, 484, 884, 1666, 2546, 4048, 6612, 8928, 13172, 17794, 22274, 28576, 37524, 48380, 57340, 71556, 85626, 98550, 118658, 138112, 163404, 196134, 224220, 249672, 281838, 310650, 347136, 420624, 467670, 525806, 571846, 655898
Offset: 1
{0,2} #2 S=2;
{4,6,8} #3 S=18;
{10,12,14,16,18} #5 S=70;
{20,22,24,26,28,30,32} #7 S=182.
-
from itertools import islice
from sympy import nextprime
def A034959_gen(): # generator of terms
a, p = 0, 2
while True:
yield p*((a<<1)+p-1)
a, p = a+p, nextprime(p)
A034959_list = list(islice(A034959_gen(),20)) # Chai Wah Wu, Mar 22 2023
A034957
Divide natural numbers in groups with prime(n) elements and add together.
Original entry on oeis.org
1, 9, 35, 91, 242, 442, 833, 1273, 2024, 3306, 4464, 6586, 8897, 11137, 14288, 18762, 24190, 28670, 35778, 42813, 49275, 59329, 69056, 81702, 98067, 112110, 124836, 140919, 155325, 173568, 210312, 233835, 262903, 285923, 327949, 355001, 393285
Offset: 1
{0,1} #2 S=1;
{2,3,4} #3 S=9;
{5,6,7,8,9} #5 S=35;
{10,11,12,13,14,15,16} #7 S=91.
-
{1}~Join~Map[Abs@ Apply[Subtract, Map[PolygonalNumber, #]] &, Partition[Accumulate@ Prime@ Range@ 37 - 1, 2, 1]] (* Michael De Vlieger, Oct 06 2019 *)
Module[{nn=40,tprs},tprs=Total[Prime[Range[nn]]];Total/@TakeList[Range[0,tprs],Prime[Range[nn]]]] (* Harvey P. Dale, Apr 18 2025 *)
-
from itertools import islice
from sympy import nextprime
def A034957_gen(): # generator of terms
a, p = 0, 2
while True:
yield p*((a<<1)+p-1)>>1
a, p = a+p, nextprime(p)
A034957_list = list(islice(A034957_gen(),20)) # Chai Wah Wu, Mar 22 2023
A343809
Divide the positive integers into subsets of lengths given by successive primes, then reverse the order of terms in each subset.
Original entry on oeis.org
2, 1, 5, 4, 3, 10, 9, 8, 7, 6, 17, 16, 15, 14, 13, 12, 11, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59
Offset: 1
From _Omar E. Pol_, Apr 30 2021: (Start)
Written as an irregular triangle in which row lengths give A000040 the sequence begins:
2, 1;
5, 4, 3;
10, 9, 8, 7, 6;
17, 16, 15, 14, 13, 12, 11;
28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18;
41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29;
58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42;
77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59;
...
(End)
Cf.
A000027,
A000040,
A007504,
A014284,
A034956,
A038722,
A071148,
A073612 (fixed points),
A078423,
A082548,
A115030,
A237589,
A282329,
A343859,
A344891.
-
R:= NULL: t:= 1:
for i from 1 to 20 do
p:= ithprime(i);
R:= R, seq(i,i=t+p-1..t,-1);
t:= t+p;
od:
R; # Robert Israel, Apr 30 2021
-
With[{nn=10},Reverse/@TakeList[Range[Total[Prime[Range[nn]]]],Prime[Range[nn]]]]//Flatten (* Harvey P. Dale, Apr 27 2022 *)
A073612
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.
Original entry on oeis.org
4, 8, 14, 23, 35, 50, 68, 89, 115, 145, 179, 218, 260, 305, 355, 411, 471, 535, 604, 676, 752, 833, 919, 1012, 1111, 1213, 1318, 1426, 1537, 1657, 1786, 1920, 2058, 2202, 2352, 2506, 2666, 2831, 3001, 3177, 3357, 3543, 3735, 3930, 4128, 4333, 4550, 4775
Offset: 2
-
Table[ Sum[ Prime[i], {i, 1, n}] - Floor[ Prime[n]/2], {n, 2, 50}]
For[lst={}; n1=3; n=2, n<=100, n++, n2=n1+Prime[n]; AppendTo[lst, (n2+n1-1)/2]; n1=n2]; lst
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 *)
A344718
Divide the positive integers into subsets of lengths given by successive primes. a(n) is the sum of primes contained in the n-th subset.
Original entry on oeis.org
2, 8, 7, 41, 42, 138, 143, 331, 348, 660, 864, 1444, 1322, 2349, 1824, 3195, 4122, 4696, 4264, 7184, 8038, 8259, 9988, 10972, 15151, 15446, 16954, 18322, 19994, 26001, 27985, 28426, 32541, 38963, 41797, 51790, 40074, 64140, 59403, 60066, 63732, 66980, 99172, 82152
Offset: 1
a(1) = 2 because the first subset is [1,2] (length = 2) and the sum of primes contained in it is 2.
a(2) = 8 because the second subset is [3,4,5] (length = 3) and the sum of primes contained in it is 3 + 5 = 8.
a(3) = 7 because the third subset is [6,7,8,9,10] (length = 5) and the sum of primes contained in it is 7.
a(4) = 41 because the fourth subset is [11,12,13,14,15,16,17] (length = 7) and the sum of primes contained in it is 11 + 13 + 17 = 41.
-
nterms=50;list = TakeList[Range[Sum[Prime[i],{i,nterms}]],Prime[Range[nterms]]];Map[Total[Select[#,PrimeQ]]&,list]
A078423
Group the natural numbers into clumps with increasing prime numbers of elements, then multiply the members of each clump.
Original entry on oeis.org
2, 60, 30240, 98017920, 857180548224000, 109720581991308288000, 70265584374661732509573120000, 61765285634580106110458762035200000, 642817384174195049892129048242945261568000000
Offset: 1
Dividing 1,2,3,4,5,6,7,8,9,10,... into clumps of 2,3,5,.. elements: {1,2}, {3,4,5}, {6,7,8,9,10}, ... and then multiply each clumps to get 2,60,30240,...
Showing 1-8 of 8 results.
Comments