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.

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

A258197 Arithmetic derivative of Pascal's triangle.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 4, 5, 4, 0, 0, 1, 7, 7, 1, 0, 0, 5, 8, 24, 8, 5, 0, 0, 1, 10, 12, 12, 10, 1, 0, 0, 12, 32, 92, 59, 92, 32, 12, 0, 0, 6, 60, 124, 165, 165, 124, 60, 6, 0, 0, 7, 39, 244, 247, 456, 247, 244, 39, 7, 0, 0, 1, 16, 103, 371, 493, 493, 371, 103, 16, 1, 0
Offset: 0

Views

Author

Reinhard Zumkeller, May 26 2015

Keywords

Comments

A258318(n) = number of distinct terms up to row n.

Examples

			.  First 10 rows:                     |  Pascal's triangle:
.  0:  0                              |  1
.  1:  0,0                            |  1,1
.  2:  0,1,0                          |  1,2,1
.  3:  0,1,1,0                        |  1,3,3,1
.  4:  0,4,5,4,0                      |  1,4,6,4,1
.  5:  0,1,7,7,1,0                    |  1,5,10,10,5,1
.  6:  0,5,8,24,8,5,0                 |  1,6,15,20,15,6,1
.  7:  0,1,10,12,12,10,1,0            |  1,7,21,35,35,21,7,1
.  8:  0,12,32,92,59,92,32,12,0       |  1,8,28,56,70,56,28,8,1
.  9:  0,6,60,124,165,165,124,60,6,0  |  1,9,36,84,126,126,84,36,9,1 .
		

Crossrefs

Cf. A003415, A007318, A258290 (central terms), A258317 (row sums), A068312, A258318.

Programs

  • Haskell
    a258197 n k = a258197_tabl !! n !! k
    a258197_row n = a258197_tabl !! n
    a258197_tabl = map (map a003415) a007318_tabl
  • Mathematica
    ad[n_] := n * Plus @@ ((Last[#]/First[#]) & /@ FactorInteger[n]); ad[0] = ad[1] = 0; Table[ad[Binomial[n, k]], {n, 0, 11}, {k, 0, n}] // Flatten (* Amiram Eldar, Apr 13 2025 *)

Formula

T(n,k) = A003415(A007318(n,k)), 0 <= k <= n.
For n > 0: T(n,1) = A003415(n).
For n > 1: T(n,2) = A068312(n-1).
Showing 1-2 of 2 results.