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-3 of 3 results.

A037126 Triangle T(n,k) = prime(k) for k = 1..n.

Original entry on oeis.org

2, 2, 3, 2, 3, 5, 2, 3, 5, 7, 2, 3, 5, 7, 11, 2, 3, 5, 7, 11, 13, 2, 3, 5, 7, 11, 13, 17, 2, 3, 5, 7, 11, 13, 17, 19, 2, 3, 5, 7, 11, 13, 17, 19, 23, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 2, 3, 5, 7, 11, 13, 17
Offset: 1

Views

Author

Vasiliy Danilov (danilovv(AT)usa.net), Jun 15 1998

Keywords

Comments

Or, triangle read by rows in which row n lists first n primes.
Sequence B is called a reluctant sequence of sequence A, if B is triangle array read by rows: row number k coincides with first k elements of the sequence A. Sequence A037126 is reluctant sequence of the prime numbers A000040. - Boris Putievskiy, Dec 12 2012

Examples

			Triangle begins:
..... 2
.... 2,3
... 2,3,5
.. 2,3,5,7
. 2,3,5,7,11
...
		

Crossrefs

Programs

  • GAP
    P:=Filtered([1..200],IsPrime);;
    T:=Flat(List([1..13],n->List([1..n],k->P[k]))); # Muniru A Asiru, Mar 16 2019
  • Haskell
    a037126 n k = a037126_tabl !! (n-1) !! (k-1)
    a037126_row n = a037126_tabl !! (n-1)
    a037126_tabl = map (`take` a000040_list) [1..]
    -- Reinhard Zumkeller, Oct 01 2012
    
  • Maple
    T:=(n,k)->ithprime(k): seq(seq(T(n,k),k=1..n),n=1..13); # Muniru A Asiru, Mar 16 2019
  • Mathematica
    Flatten[ Table[ Prime[ i], {n, 12}, {i, n}]] (* Robert G. Wilson v, Aug 18 2005 *)
    Module[{nn=15,prs},prs=Prime[Range[nn]];Table[Take[prs,n],{n,nn}]]// Flatten (* Harvey P. Dale, May 02 2017 *)

Formula

As a linear array, the sequence is a(n) = A000040(m), where m = n-t(t+1)/2, t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Dec 12 2012

A061802 Sum of n-th row of triangle of primes: 2; 2 3 2; 2 3 5 3 2; 2 3 5 7 5 3 2; ...; where n-th row contains 2n+1 terms.

Original entry on oeis.org

2, 7, 15, 27, 45, 69, 99, 135, 177, 229, 289, 357, 435, 519, 609, 709, 821, 941, 1069, 1207, 1351, 1503, 1665, 1837, 2023, 2221, 2425, 2635, 2851, 3073, 3313, 3571, 3839, 4115, 4403, 4703, 5011, 5331, 5661, 6001, 6353, 6713, 7085, 7469, 7859, 8255, 8665
Offset: 0

Views

Author

Amarnath Murthy, May 28 2001

Keywords

Comments

Row sums of A138143. - Omar E. Pol, Feb 13 2014
For n = 3..9, a(n) = 3*(n^2 - 3*n + 5). - Nicholas Drozd, Apr 10 2021

Crossrefs

Cf. A001043 (first differences), A007504, A138143.
Partial sums of A011974.

Programs

  • Mathematica
    Accumulate[Join[{2},ListConvolve[{1,1},Prime[Range[100]]]]] (* Paolo Xausa, Oct 31 2023 *)
  • PARI
    { n=-1; a=q=0; forprime (p=2, prime(1001), write("b061802.txt", n++, " ", a+=p + q); q=p ) } \\ Harry J. Smith, Jul 28 2009

Formula

a(n) = a(n-1) + prime(n) + prime(n-1).
a(n) = A007504(n) + A007504(n+1) so we have the asymptotic expansion a(n) ~ n^2*log(n). - Henry Bottomley, May 30 2001

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), May 29 2001

A138117 Triangle read by rows: row n lists the first 2n-1 prime numbers.

Original entry on oeis.org

2, 2, 3, 5, 2, 3, 5, 7, 11, 2, 3, 5, 7, 11, 13, 17, 2, 3, 5, 7, 11, 13, 17, 19, 23, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47
Offset: 1

Views

Author

Omar E. Pol, Mar 14 2008, corrected Mar 15 2008

Keywords

Examples

			Triangle begins:
....... 2
..... 2,3,5
... 2,3,5,7,11
. 2,3,5,7,11,13,17
		

Crossrefs

Programs

  • Mathematica
    nn=10;Flatten[Table[Take[Prime[Range[2nn+1]],2n+1],{n,0,nn}]] (* Harvey P. Dale, Aug 16 2011 *)
Showing 1-3 of 3 results.