login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A126256 Number of distinct terms in rows 0 through n of Pascal's triangle. 6
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
An easy upper bound is 1 + floor(n^2/4) = A033638(n).
First differences are in A126257.
LINKS
EXAMPLE
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.
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 *)
PROG
(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, ", "))
(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
(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
CROSSREFS
Cf. A199425.
Cf. A258318.
Sequence in context: A224854 A074752 A039825 * A347646 A062438 A102424
KEYWORD
easy,nonn
AUTHOR
Nick Hobson, Dec 24 2006
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 28 09:58 EDT 2024. Contains 372037 sequences. (Running on oeis4.)