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.

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

A089182 Prime digit palindromes 2,...,23577532 continued by adding 10^(n-k) and 10^(k-1) times prime(k).

Original entry on oeis.org

2, 22, 232, 2332, 23532, 235532, 2357532, 23577532, 235817532, 2358217532, 23582417532, 235824417532, 2358248417532, 23582488417532, 235824908417532, 2358249108417532, 23582491508417532, 235824915508417532
Offset: 1

Views

Author

Roger L. Bagula, Dec 07 2003

Keywords

Comments

Original definition: Overlapping prime-based palindromic sequence.
Only the first 8 terms are truly palindromes: a modulo 10 version of this would work with a limited digit set {1,2,3,5,7,9} with 2 and 5 only occurring as 1st and 3rd digit to either side.

Crossrefs

Programs

  • Mathematica
    a[m_]=Delete[Table[If [ Floor[m/2]-n>=0, Prime[ n], Prime[m-n]], {n, 1, m}], m] b=Table[Sum[a[m][[i]]*10^(i-1), {i, 1, m-1}], {m, 2, digits}]

Formula

a(n) = Sum_{k=1..floor(n/2)} prime(k)*(10^(n-k) + 10^(k-1)) + (n mod 2)*prime((n+1)/2)*10^floor(n/2). - M. F. Hasler, Apr 06 2009

Extensions

Edited by M. F. Hasler, Apr 06 2009
Showing 1-2 of 2 results.