OFFSET
0,5
COMMENTS
Partial sums are in A126256.
n occurs a(n) times in A265912. - Reinhard Zumkeller, Dec 18 2015
LINKS
Nick Hobson, Table of n, a(n) for n = 0..1000
Nick Hobson, Python program for this sequence
EXAMPLE
Row 6 of Pascal's triangle is: 1, 6, 15, 20, 15, 6, 1. Of these terms, only 15 and 20 do not appear in rows 0-5. Hence a(6)=2.
PROG
(PARI) lim=77; z=listcreate(1+lim^2\4); print1(1, ", "); r=1; for(a=1, lim, for(b=1, a\2, s=Str(binomial(a, b)); f=setsearch(z, s, 1); if(f, listinsert(z, s, f))); print1(1+#z-r, ", "); r=1+#z)
(Haskell)
import Data.List.Ordered (minus, union)
a126257 n = a126257_list !! n
a126257_list = f [] a034868_tabf where
f zs (xs:xss) = (length ys) : f (ys `union` zs) xss
where ys = xs `minus` zs
-- Reinhard Zumkeller, Dec 18 2015
(Python)
def A126257(n):
if n:
s, c = (1, ), {1}
for i in range(n-1):
c.update(set(s:=(1, )+tuple(s[j]+s[j+1] for j in range(len(s)-1))+(1, )))
return len(set((1, )+tuple(s[j]+s[j+1] for j in range(len(s)-1))+(1, ))-c)
return 1 # Chai Wah Wu, Oct 17 2023
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Nick Hobson, Dec 24 2006
STATUS
approved