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.

Showing 1-2 of 2 results.

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

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Examples

			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.
		

Crossrefs

Programs

  • Mathematica
    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 *)
  • PARI
    s(n) = sum(k=1, n, prime(k)); \\ A007504
    a(n) = s(s(n)) - s(s(n-1)); \\ Michel Marcus, Oct 12 2018

Formula

From Hieronymus Fischer, Sep 26 2012: (Start)
a(n) = Sum_{k=A007504(n-1)+1..A007504(n)} A000040(k), n > 1.
a(n) = A007504(A007504(n)) - A007504(A007504(n-1)), n > 1.
If we define A007504(0) := 0, then the formulas are also true for n = 1.
(End)

A344891 Divide the primes into subsets of lengths given by successive primes, then reverse the order of terms in each subset.

Original entry on oeis.org

3, 2, 11, 7, 5, 29, 23, 19, 17, 13, 59, 53, 47, 43, 41, 37, 31, 107, 103, 101, 97, 89, 83, 79, 73, 71, 67, 61, 179, 173, 167, 163, 157, 151, 149, 139, 137, 131, 127, 113, 109, 271, 269, 263, 257, 251, 241, 239, 233, 229, 227, 223, 211, 199, 197, 193, 191, 181
Offset: 1

Views

Author

Paolo Xausa, Jun 01 2021

Keywords

Comments

Irregular triangle read by rows in which row n lists the next p primes in decreasing order, where p is the n-th prime, with n >= 1.

Examples

			Written as an irregular triangle in which row lengths give A000040 the sequence begins:
    3,   2;
   11,   7,   5;
   29,  23,  19,  17,  13;
   59,  53,  47,  43,  41,  37,  31;
  107, 103, 101,  97,  89,  83,  79,  73,  71,  67,  61;
  179, 173, 167, 163, 157, 151, 149, 139, 137, 131, 127, 113, 109;
  ...
		

Crossrefs

Right border gives A180302.
Row lengths give A000040.
Row products give A119645.
Row sums give A034958.
Cf. A343809.

Programs

  • Mathematica
    Module[{nn=10,p},p=Total[Prime[Range[nn]]];Flatten[Reverse/@TakeList[ Prime[ Range[ p]],Prime[Range[nn]]]]] (* Harvey P. Dale, Sep 14 2022 *)
Showing 1-2 of 2 results.