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-10 of 17 results. Next

A122382 Primes of the form Sum[ Sum[ Prime[k], {k,1,m} ], {m,1,n} ] = A014148[n].

Original entry on oeis.org

2, 7, 17, 103, 467, 6577, 17189, 61627, 109919, 130531, 198109, 239579, 399557, 559313, 1291909, 1807609, 2851951, 3644479, 5189339, 5659651, 6794993, 6905357, 7359091, 9795109, 19405363, 20319427, 36052151, 40343053, 42229639, 44970689
Offset: 1

Views

Author

Alexander Adamchuk, Aug 30 2006

Keywords

Comments

Corresponding numbers n such that A014148[n] is prime are listed in A122381[n] = {1,2,3,6,10,23,31,46,55,58,66,70,82,91,118,131,151,163,182,187,198,199,...}.

Examples

			A014148[n] begins {2,7,17,34,62,103,161,238,338,467,627,824,1062,1343,...}.
a(1) = A014148[1] = 2.
a(2) = A014148[2] = 7.
a(3) = A014148[3] = 17.
		

Crossrefs

Programs

  • Mathematica
    p=0;s=0;f=0;Do[p=Prime[n];s=s+p;f=f+s;If[PrimeQ[f],Print[{n,f}]],{n,1,2000}]

Formula

a(n) = A014148[ A122381[n] ].

A122381 Numbers n such that A014148[n] is a prime.

Original entry on oeis.org

1, 2, 3, 6, 10, 23, 31, 46, 55, 58, 66, 70, 82, 91, 118, 131, 151, 163, 182, 187, 198, 199, 203, 222, 275, 279, 334, 346, 351, 358, 402, 411, 462, 470, 515, 582, 591, 619, 639, 650, 667, 671, 679, 706, 739, 750, 767, 835, 851, 875, 882, 899, 919, 926, 962, 966
Offset: 1

Views

Author

Alexander Adamchuk, Aug 30 2006

Keywords

Comments

Corresponding primes are listed in A122382[n] = A014148[ a(n) ] = {2,7,17,103,467,6577,17189,61627,109919,130531,198109,239579,399557,559313,...}.

Examples

			A014148[n] begins {2,7,17,34,62,103,161,238,338,467,627,824,1062,1343,...}.
a(1) = 1 because A014148[1] = 2 is prime.
a(2) = 2 because A014148[2] = 7 is prime.
		

Crossrefs

Programs

  • Mathematica
    p=0;s=0;f=0;Do[p=Prime[n];s=s+p;f=f+s;If[PrimeQ[f],Print[{n,f}]],{n,1,2000}]
    Position[Nest[Accumulate,Prime[Range[1000]],2],?PrimeQ]//Flatten (* _Harvey P. Dale, Jul 15 2023 *)

Formula

A014148[n] = Sum[ Sum[ Prime[k], {k,1,m} ], {m,1,n} ]. A014148[ a(n) ] = A122382[n].

A007504 Sum of the first n primes.

Original entry on oeis.org

0, 2, 5, 10, 17, 28, 41, 58, 77, 100, 129, 160, 197, 238, 281, 328, 381, 440, 501, 568, 639, 712, 791, 874, 963, 1060, 1161, 1264, 1371, 1480, 1593, 1720, 1851, 1988, 2127, 2276, 2427, 2584, 2747, 2914, 3087, 3266, 3447, 3638, 3831, 4028, 4227, 4438, 4661, 4888
Offset: 0

Views

Author

Keywords

Comments

It appears that a(n)^2 - a(n-1)^2 = A034960(n). - Gary Detlefs, Dec 20 2011
This is true. Proof: By definition we have A034960(n) = Sum_{k = (a(n-1)+1)..a(n)} (2*k-1). Since Sum_{k = 1..n} (2*k-1) = n^2, it follows A034960(n) = a(n)^2 - a(n-1)^2, for n > 1. - Hieronymus Fischer, Sep 27 2012 [formulas above adjusted to changed offset of A034960 - Hieronymus Fischer, Oct 14 2012]
Row sums of the triangle in A037126. - Reinhard Zumkeller, Oct 01 2012
Ramanujan noticed the apparent identity between the prime parts partition numbers A000607 and the expansion of Sum_{k >= 0} x^a(k)/((1-x)...(1-x^k)), cf. A046676. See A192541 for the difference between the two. - M. F. Hasler, Mar 05 2014
For n > 0: row 1 in A254858. - Reinhard Zumkeller, Feb 08 2015
a(n) is the smallest number that can be partitioned into n distinct primes. - Alonso del Arte, May 30 2017
For a(n) < m < a(n+1), n > 0, at least one m is a perfect square.
Proof: For n = 1, 2, ..., 6, the proposition is clear. For n > 6, a(n) < ((prime(n) - 1)/2)^2, set (k - 1)^2 <= a(n) < k^2 < ((prime(n) + 1)/2)^2, then k^2 < (k - 1)^2 + prime(n) <= a(n) + prime(n) = a(n+1), so m = k^2 is this perfect square. - Jinyuan Wang, Oct 04 2018
For n >= 5 we have a(n) < ((prime(n)+1)/2)^2. This can be shown by noting that ((prime(n)+1)/2)^2 - ((prime(n-1)+1)/2)^2 - prime(n) = (prime(n)+prime(n-1))*(prime(n)-prime(n-1)-2)/4 >= 0. - Jianing Song, Nov 13 2022
Washington gives an oscillation formula for |a(n) - pi(n^2)|, see links. - Charles R Greathouse IV, Dec 07 2022

References

  • E. Bach and J. Shallit, §2.7 in Algorithmic Number Theory, Vol. 1: Efficient Algorithms, MIT Press, Cambridge, MA, 1996.
  • H. L. Nelson, "Prime Sums", J. Rec. Math., 14 (1981), 205-206.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

See A122989 for the value of Sum_{n >= 1} 1/a(n).

Programs

  • GAP
    P:=Filtered([1..250],IsPrime);;
    a:=Concatenation([0],List([1..Length(P)],i->Sum([1..i],k->P[k]))); # Muniru A Asiru, Oct 07 2018
    
  • Haskell
    a007504 n = a007504_list !! n
    a007504_list = scanl (+) 0 a000040_list
    -- Reinhard Zumkeller, Oct 01 2014, Oct 03 2011
    
  • Magma
    [0] cat [&+[ NthPrime(k): k in [1..n]]: n in [1..50]]; // Bruno Berselli, Apr 11 2011 (adapted by Vincenzo Librandi, Nov 27 2015 after Hasler's change on Mar 05 2014)
    
  • Maple
    s1:=[2]; for n from 2 to 1000 do s1:=[op(s1),s1[n-1]+ithprime(n)]; od: s1;
    A007504 := proc(n)
        add(ithprime(i), i=1..n) ;
    end proc: # R. J. Mathar, Sep 20 2015
  • Mathematica
    Accumulate[Prime[Range[100]]] (* Zak Seidov, Apr 10 2011 *)
    primeRunSum = 0; Table[primeRunSum = primeRunSum + Prime[k], {k, 100}] (* Zak Seidov, Apr 16 2011 *)
  • PARI
    A007504(n) = sum(k=1,n,prime(k)) \\ Michael B. Porter, Feb 26 2010
    
  • PARI
    a(n) = vecsum(primes(n)); \\ Michel Marcus, Feb 06 2021
    
  • Python
    from itertools import accumulate, count, islice
    from sympy import prime
    def A007504_gen(): return accumulate(prime(n) if n > 0 else 0 for n in count(0))
    A007504_list = list(islice(A007504_gen(),20)) # Chai Wah Wu, Feb 23 2022

Formula

a(n) ~ n^2 * log(n) / 2. - Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 24 2001 (see Bach & Shallit 1996)
a(n) = A014284(n+1) - 1. - Jaroslav Krizek, Aug 19 2009
a(n+1) - a(n) = A000040(n+1). - Jaroslav Krizek, Aug 19 2009
a(A051838(n)) = A002110(A051838(n)) / A116536(n). - Reinhard Zumkeller, Oct 03 2011
a(n) = min(A068873(n), A073619(n)) for n > 1. - Jonathan Sondow, Jul 10 2012
a(n) = A033286(n) - A152535(n). - Omar E. Pol, Aug 09 2012
For n >= 3, a(n) >= (n-1)^2 * (log(n-1) - 1/2)/2 and a(n) <= n*(n+1)*(log(n) + log(log(n))+ 1)/2. Thus a(n) = n^2 * log(n) / 2 + O(n^2*log(log(n))). It is more precise than in Fares's comment. - Vladimir Shevelev, Aug 01 2013
a(n) = (n^2/2)*(log n + log log n - 3/2 + (log log n - 3)/log n + (2 (log log n)^2 - 14 log log n + 27)/(4 log^2 n) + O((log log n/log n)^3)) [Sinha]. - Charles R Greathouse IV, Jun 11 2015
G.f: (x*b(x))/(1-x), where b(x) is the g.f. of A000040. - Mario C. Enriquez, Dec 10 2016
a(n) = A008472(A002110(n)), for n > 0. - Michel Marcus, Jul 16 2020

Extensions

More terms from Stefan Steinerberger, Apr 11 2006
a(0) = 0 prepended by M. F. Hasler, Mar 05 2014

A014285 a(n) = Sum_{j=1..n} j*prime(j).

Original entry on oeis.org

2, 8, 23, 51, 106, 184, 303, 455, 662, 952, 1293, 1737, 2270, 2872, 3577, 4425, 5428, 6526, 7799, 9219, 10752, 12490, 14399, 16535, 18960, 21586, 24367, 27363, 30524, 33914, 37851, 42043, 46564, 51290, 56505, 61941, 67750, 73944, 80457, 87377, 94716, 102318
Offset: 1

Views

Author

Keywords

Comments

Two consecutive terms cannot both be divisible by 4. - Tamas Sandor Nagy, Aug 04 2024

Crossrefs

Partial sums of A033286. - Michel Marcus, Jun 18 2019

Programs

Formula

a(n) = n*A007504(n) - Sum_{k=1..n-1} A007504(k) = n*A007504(n) - A014148(n-1). - Pontus von Brömssen, Aug 29 2021

Extensions

Offset changed to 1 and six terms added by Bruno Berselli, Apr 30 2011

A014150 Apply partial sum operator thrice to primes.

Original entry on oeis.org

2, 9, 26, 60, 122, 225, 386, 624, 962, 1429, 2056, 2880, 3942, 5285, 6956, 9008, 11500, 14493, 18054, 22254, 27166, 32869, 39446, 46986, 55586, 65347, 76372, 88768, 102644, 118113, 135302, 154342, 175370
Offset: 1

Views

Author

Keywords

Comments

Row 3 in A254858. - Reinhard Zumkeller, Feb 08 2015

Crossrefs

Programs

  • Haskell
    a014150 n = a014150_list !! (n-1)
    a014150_list = (iterate (scanl1 (+)) a000040_list) !! 3
    -- Reinhard Zumkeller, Feb 08 2015
  • Mathematica
    lst={};s1=0;s2=0;s3=0;Do[s1=s1+Prime[n];s2=s2+s1;s3=s3+s2;AppendTo[lst, s3], {n, 5!}];lst (* Vladimir Joseph Stephan Orlovsky, Sep 15 2008 *)
    With[{nn=3},Nest[Accumulate[#]&,Prime[Range[50]],nn]] (* Harvey P. Dale, Feb 07 2015 *)

Extensions

Offset fixed by Reinhard Zumkeller, Feb 08 2015

A254858 Iterated partial sums of prime numbers, square array read by diagonals.

Original entry on oeis.org

2, 2, 3, 2, 5, 5, 2, 7, 10, 7, 2, 9, 17, 17, 11, 2, 11, 26, 34, 28, 13, 2, 13, 37, 60, 62, 41, 17, 2, 15, 50, 97, 122, 103, 58, 19, 2, 17, 65, 147, 219, 225, 161, 77, 23, 2, 19, 82, 212, 366, 444, 386, 238, 100, 29, 2, 21, 101, 294, 578, 810, 830, 624, 338, 129, 31
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 08 2015

Keywords

Comments

Row n+1 = partial sums of row n.
T(n,1) = A002522(n+1); T(n,2) = A144396(n+1); T(n,3) = A002522(n+2).

Examples

			. n\k | 1  2  3   4   5    6    7     8     9    10    11     12     13
. ----+------------------------------------------------------------------
.  0  | 2  3  5   7  11   13   17    19    23    29    31     37     41 ..
.  1  | 2  5 10  17  28   41   58    77   100   129   160    197    238 ..
.  2  | 2  7 17  34  62  103  161   238   338   467   627    824   1062 ..
.  3  | 2  9 26  60 122  225  386   624   962  1429  2056   2880   3942 ..
.  4  | 2 11 37  97 219  444  830  1454  2416  3845  5901   8781  12723 ..
.  5  | 2 13 50 147 366  810 1640  3094  5510  9355 15256  24037  36760 ..
.  6  | 2 15 65 212 578 1388 3028  6122 11632 20987 36243  60280  97040 ..
.  7  | 2 17 82 294 872 2260 5288 11410 23042 44029 80272 140552 237592 ...
		

Crossrefs

Cf. A000040 (row 0), A007504 (row 1), A014148 (row 2), A014150 (row 3), A178138 (row 4), A254784 (row 5).
Cf. A007395 (column 1), A144396 (column 2), A002522 (column 3).
Cf. A125180 (antidiagonal sums), A125179 (diagonals downward).

Programs

  • Haskell
    a254858_tabl = diags [] $ iterate (scanl1 (+)) a000040_list where
       diags uss (vs:vss) = (map head wss) : diags (map tail wss) vss
                            where wss = vs : uss
    a254858_list = concat a254858_tabl
  • Mathematica
    nmax = 11;
    row[0] = Prime[Range[nmax+1]];
    row[n_] := row[n] = row[n-1] // Accumulate;
    T[n_, k_] := row[n][[k]];
    Table[T[n-k, k], {n, 0, nmax}, {k, 1, n}] // Flatten (* Jean-François Alcover, Oct 11 2021 *)

A178138 Apply partial sum operator 4 times to primes.

Original entry on oeis.org

2, 11, 37, 97, 219, 444, 830, 1454, 2416, 3845, 5901, 8781, 12723, 18008, 24964, 33972, 45472, 59965, 78019, 100273, 127439, 160308, 199754, 246740, 302326, 367673, 444045, 532813, 635457, 753570, 888872, 1043214, 1218584
Offset: 1

Views

Author

Jonathan Vos Post, May 20 2010

Keywords

Comments

Unlike the results of applying the partial sum operator once (A007504), twice (A014148), or thrice (A014150) to primes, this sequence begins with 4 primes. The next prime in the sequence is a(26) = 367673.
Row 4 in A254858. - Reinhard Zumkeller, Feb 08 2015

Examples

			a(15) = 2 + 9 + 26 + 60 + 122 + 225 + 386 + 624 + 962 + 1429 + 2056 + 2880 + 3942 + 5285 + 6956 = 24964 = 2^2 x 79^2.
		

Crossrefs

Programs

  • Haskell
    a178138 n = a178138_list !! (n-1)
    a178138_list = (iterate (scanl1 (+)) a000040_list) !! 4
    -- Reinhard Zumkeller, Feb 08 2015
  • Maple
    Contribution from R. J. Mathar, Oct 19 2010: (Start)
    A007504 := proc(n) option remember; add( ithprime(i),i=1..n) ; end proc:
    A014148 := proc(n) option remember; add( A007504(i),i=1..n) ; end proc:
    A014150 := proc(n) option remember; add( A014148(i),i=1..n) ; end proc:
    A178138 := proc(n) option remember; add( A014150(i),i=1..n) ; end proc: seq(A178138(n),n=1..80) ; (End)
  • Mathematica
    Nest[Accumulate[#]&,Prime[Range[40]],4] (* Harvey P. Dale, Sep 25 2014 *)

A254784 Apply partial sum operator 5 times to primes.

Original entry on oeis.org

2, 13, 50, 147, 366, 810, 1640, 3094, 5510, 9355, 15256, 24037, 36760, 54768, 79732, 113704, 159176, 219141, 297160, 397433, 524872, 685180, 884934, 1131674, 1434000, 1801673, 2245718, 2778531, 3413988, 4167558, 5056430, 6099644, 7318228, 8735337, 10376402
Offset: 1

Views

Author

Harvey P. Dale, Feb 07 2015

Keywords

Comments

Row 5 in A254858. - Reinhard Zumkeller, Feb 08 2015

Crossrefs

Programs

  • Haskell
    a254784 n = a254784_list !! (n-1)
    a254784_list = (iterate (scanl1 (+)) a000040_list) !! 5
    -- Reinhard Zumkeller, Feb 08 2015
  • Mathematica
    With[{nn=5},Nest[Accumulate[#]&,Prime[Range[50]],nn]]

A157492 Apply partial sum operator twice to sequence of squares of the first n primes.

Original entry on oeis.org

4, 17, 55, 142, 350, 727, 1393, 2420, 3976, 6373, 9731, 14458, 20866, 29123, 39589, 52864, 69620, 90097, 115063, 145070, 180406, 221983, 270449, 326836, 392632, 468629, 555235, 653290, 763226, 885931, 1024765, 1180760, 1355524, 1549609
Offset: 1

Views

Author

Keywords

Crossrefs

Partial sums of A024450.

Programs

  • Maple
    ListTools:-PartialSums(ListTools:-PartialSums([seq(ithprime(i)^2,i=1..100)])); # Robert Israel, May 14 2019
  • Mathematica
    s0=s1=0;lst={};Do[p=Prime[n];s0+=p^2;s1+=s0;AppendTo[lst,s1],{n,5!}];lst
    Nest[Accumulate,Prime[Range[40]]^2,2] (* Harvey P. Dale, Jan 01 2020 *)

A309131 Triangle read by rows: T(n, k) = (n - k)*prime(1 + k), with 0 <= k < n.

Original entry on oeis.org

2, 4, 3, 6, 6, 5, 8, 9, 10, 7, 10, 12, 15, 14, 11, 12, 15, 20, 21, 22, 13, 14, 18, 25, 28, 33, 26, 17, 16, 21, 30, 35, 44, 39, 34, 19, 18, 24, 35, 42, 55, 52, 51, 38, 23, 20, 27, 40, 49, 66, 65, 68, 57, 46, 29, 22, 30, 45, 56, 77, 78, 85, 76, 69, 58, 31
Offset: 1

Views

Author

Stefano Spezia, Jul 14 2019

Keywords

Comments

T(n, k) is the k-superdiagonal sum of an n X n Toeplitz matrix M(n) whose first row consists of successive prime numbers prime(1), ..., prime(n).
The h-th subdiagonal of the triangle T gives the primes multiplied by (h + 1).
The k-th column of the triangle T gives the multiples of prime(1 + k).
Also array A(n, k) = n*prime(1 + k) read by ascending antidiagonals, with 0 <= k < n. - Michel Marcus, Jul 15 2019

Examples

			The triangle T(n, k) begins:
---+-----------------------------------------------------
n\k|    0     1     2     3     4     5     6     7     8
---+-----------------------------------------------------
1  |    2
2  |    4     3
3  |    6     6     5
4  |    8     9    10     7
5  |   10    12    15    14    11
6  |   12    15    20    21    22    13
7  |   14    18    25    28    33    26    17
8  |   16    21    30    35    44    39    34    19
9  |   18    24    35    42    55    52    51    38    23
...
For n = 3 the matrix M(3) is
          2,         3,         5
    M_{2,1},         2,         3
    M_{3,1},   M_{3,2},         2
and therefore T(3, 0) = 2 + 2 + 2 = 6, T(3, 1) = 3 + 3 = 6, and T(3, 2) = 5.
		

Crossrefs

Cf. A000040: diagonal; A001747: 1st subdiagonal; A001748: 2nd subdiagonal; A001749: 3rd subdiagonal; A001750: 4th subdiagonal; A005843: 0th column; A008585: 1st column; A008587: 2nd column; A008589: 3rd column; A008593: 4th column; A008595: 5th column; A008599: 6th column; A008601: 7th column; A014148: row sums; A138636: 5th subdiagonal; A272470: 6th subdiagonal.

Programs

  • Magma
    [[(n-k)*NthPrime(1+k): k in [0..n-1]]: n in [1..11]]; // triangle output
    
  • Maple
    a:=(n, k)->(n-k)*ithprime(1+k): seq(seq(a(n, k), k=0..n-1), n=1..11);
  • Mathematica
    Flatten[Table[(n-k)*Prime[1+k],{n,1,11},{k,0,n-1}]]
  • PARI
    T(n, k) = (n - k)*prime(1 + k);
    tabl(nn) = for(n=1, nn, for(k=0, n-1, print1(T(n, k), ", ")); print); \\ triangle output
    
  • Sage
    [[(n-k)*Primes().unrank(k) for k in (0..n-1)] for n in (1..11)] # triangle output

Formula

T(n, k) = A025581(n, k)*A000040(1 + k).
Showing 1-10 of 17 results. Next