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.

A199333 Triangle read by rows: T(n,0) = T(n,n) = 1, 0 < k < n: T(n,k) = smallest prime not less than T(n-1,k) + T(n-1,k-1).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 5, 7, 5, 1, 1, 7, 13, 13, 7, 1, 1, 11, 23, 29, 23, 11, 1, 1, 13, 37, 53, 53, 37, 13, 1, 1, 17, 53, 97, 107, 97, 53, 17, 1, 1, 19, 71, 151, 211, 211, 151, 71, 19, 1, 1, 23, 97, 223, 367, 431, 367, 223, 97, 23, 1, 1, 29, 127
Offset: 0

Views

Author

Reinhard Zumkeller, Nov 09 2011

Keywords

Comments

T(n,k) = T(n,n-k);
T(n,0) = 1, cf. A000012;
T(n,1) = A008578(n), n > 0;
A199424(n) = first row in triangle A199302 containing n-th prime;
A199425(n) = number of distinct primes in rows 0 through n;
large terms in the b-file are probable primes only, row number > 50.

Examples

			0:                 1
1:               1   1
2:             1   2   1
3:           1   3   3   1
4:         1   5   7   5   1
5:       1   7  13  13   7   1
6:     1  11  23  29  23  11   1
7:   1  13  37  53  53  37  13   1
8: 1  17  53  97 107  97  53  17   1
primes in 8th row:
T(7,0) + T(7,1) = 1+13 = 14 --> T(8,1) = T(8,7) = 19;
T(7,1) + T(7,2) = 13+37 = 50 --> T(8,2) = T(8,6) = 53, already in row 7;
T(7,2) + T(7,3) = 37+53 = 90 --> T(8,3) = T(8,5) = 97;
T(7,3) + T(7,4) = 53+53 = 106 --> T(8,4) = 107.
		

Crossrefs

Cf. A159477; A199581 & A199582 (central terms), A199694 (row sums), A199695 & A199696 (row products); A007318.

Programs

  • Haskell
    a199333 n k = a199333_tabl !! n !! k
    a199333_row n = a199333_tabl !! n
    a199333_list = concat a199333_tabl
    a199333_tabl = iterate
       (\row -> map a159477 $ zipWith (+) ([0] ++ row) (row ++ [0])) [1]
  • Mathematica
    T[n_, k_] := T[n, k] = Switch[k, 0|n, 1, _, With[{m = T[n-1, k] + T[n-1, k-1]}, If[PrimeQ[m], m, NextPrime[m]]]];
    Table[T[n, k], {n, 0, 13}, {k, 0, n}] // Flatten (* Jean-François Alcover, Sep 19 2021 *)

Formula

T(n,k) = A007918(T(n-1,k) + T(n-1,k-1)), 0 < k < n, T(n,0) = T(n,n) = 1.

A126256 Number of distinct terms in rows 0 through n of Pascal's triangle.

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 9, 12, 16, 20, 24, 29, 35, 41, 48, 53, 60, 68, 77, 86, 95, 103, 114, 125, 137, 149, 162, 175, 188, 202, 217, 232, 248, 264, 281, 297, 314, 332, 351, 370, 390, 410, 431, 452, 474, 495, 518, 541, 565, 589, 614, 639, 665, 691, 718, 744, 770, 798
Offset: 0

Views

Author

Nick Hobson, Dec 24 2006

Keywords

Comments

An easy upper bound is 1 + floor(n^2/4) = A033638(n).
First differences are in A126257.

Examples

			There are 9 distinct terms in rows 0 through 6 of Pascal's triangle (1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, 1, 5, 10, 10, 5, 1, 1, 6, 15, 20, 15, 6, 1); hence a(6)=9.
		

Crossrefs

Programs

  • Haskell
    -- import Data.List.Ordered (insertSet)
    a126256 n = a126256_list !! n
    a126256_list = f a007318_tabl [] where
       f (xs:xss) zs = g xs zs where
         g []     ys = length ys : f xss ys
         g (x:xs) ys = g xs (insertSet x ys)
    -- Reinhard Zumkeller, May 26 2015, Nov 09 2011
    
  • Maple
    seq(nops(`union`(seq({seq(binomial(n,k),k=0..n)},n=0..m))),m=0..57); # Emeric Deutsch, Aug 26 2007
  • Mathematica
    Table[Length[Union[Flatten[Table[Binomial[n,k],{n,0,x},{k,0,n}]]]],{x,0,60}] (* Harvey P. Dale, Sep 10 2022 *)
  • PARI
    lim=57; z=listcreate(1+lim^2\4); for(n = 0, lim, for(r=1, n\2, s=Str(binomial(n, r)); f=setsearch(z, s, 1); if(f, listinsert(z, s, f))); print1(1+#z, ", "))
    
  • Python
    def A126256(n):
        s, c = (1,), {1}
        for i in range(n):
            s = (1,)+tuple(s[j]+s[j+1] for j in range(len(s)-1)) + (1,)
            c.update(set(s))
        return len(c) # Chai Wah Wu, Oct 17 2023

A199424 Index of first row in triangle A199333 containing n-th prime.

Original entry on oeis.org

2, 3, 4, 4, 6, 5, 8, 9, 6, 6, 12, 7, 14, 15, 16, 7, 18, 19, 20, 9, 22, 23, 24, 25, 8, 27, 28, 8, 30, 31, 11, 33, 34, 35, 36, 9, 12, 39, 40, 41, 42, 43, 13, 45, 46, 47, 9, 10, 50, 14, 52, 53, 54, 55, 56, 57, 58, 15, 60, 61, 62, 63, 64, 65, 66, 16, 11, 69, 70
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 09 2011

Keywords

Comments

a(n) <= n + 1.

Crossrefs

Programs

  • Haskell
    import Data.List (findIndex)
    import Data.Maybe (fromJust)
    a199424 n = fromJust $ findIndex (elem $ a000040 n) a199333_tabl
Showing 1-3 of 3 results.