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.
%I A126257 #24 Feb 11 2024 17:28:50 %S A126257 1,0,1,1,2,2,2,3,4,4,4,5,6,6,7,5,7,8,9,9,9,8,11,11,12,12,13,13,13,14, %T A126257 15,15,16,16,17,16,17,18,19,19,20,20,21,21,22,21,23,23,24,24,25,25,26, %U A126257 26,27,26,26,28,29,29,30,30,31,31,32,32,32,33,34,34,34,35,36,36,37,37,38 %N A126257 Number of distinct new terms in row n of Pascal's triangle. %C A126257 Partial sums are in A126256. %C A126257 n occurs a(n) times in A265912. - _Reinhard Zumkeller_, Dec 18 2015 %H A126257 Nick Hobson, <a href="/A126257/b126257.txt">Table of n, a(n) for n = 0..1000</a> %H A126257 Nick Hobson, <a href="/A126257/a126257.py.txt">Python program for this sequence</a> %e A126257 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. %o A126257 (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) %o A126257 (Haskell) %o A126257 import Data.List.Ordered (minus, union) %o A126257 a126257 n = a126257_list !! n %o A126257 a126257_list = f [] a034868_tabf where %o A126257 f zs (xs:xss) = (length ys) : f (ys `union` zs) xss %o A126257 where ys = xs `minus` zs %o A126257 -- _Reinhard Zumkeller_, Dec 18 2015 %o A126257 (Python) %o A126257 def A126257(n): %o A126257 if n: %o A126257 s, c = (1,), {1} %o A126257 for i in range(n-1): %o A126257 c.update(set(s:=(1,)+tuple(s[j]+s[j+1] for j in range(len(s)-1))+(1,))) %o A126257 return len(set((1,)+tuple(s[j]+s[j+1] for j in range(len(s)-1))+(1,))-c) %o A126257 return 1 # _Chai Wah Wu_, Oct 17 2023 %Y A126257 Cf. A007318, A062854, A126254, A126255, A126256. %Y A126257 Cf. A034868, A265912. %K A126257 easy,nonn %O A126257 0,5 %A A126257 _Nick Hobson_, Dec 24 2006