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 A386953 #12 Aug 17 2025 07:59:34 %S A386953 1,3,6,10,15,21,28,36,45,49,57,69,78,90,105,119,135,153,160,174,195, %T A386953 209,228,252,273,297,324,328,336,348,360,378,402,422,450,486,495,513, %U A386953 540,560,588,624,655,693,738,752,780,822,850,888,936,978,1026,1080,1087 %N A386953 Total number of entries in rows 0,1,...,n of Pascal's triangle not divisible by 9. %H A386953 James G. Huard, Blair K. Spearman, and Kenneth S. Williams, <a href="http://doi.org/10.4064/aa-78-4-331-349">Pascal's triangle (mod 9)</a>, Acta Arithmetica, 78 (1997), 331-349. %o A386953 (Python) %o A386953 import re %o A386953 from gmpy2 import digits %o A386953 def A386953(n): %o A386953 c = 0 %o A386953 for m in range(n+1): %o A386953 s = digits(m,3) %o A386953 n1 = s.count('1') %o A386953 n2 = s.count('2') %o A386953 n01 = s.count('10') %o A386953 n02 = s.count('20') %o A386953 n11 = len(re.findall('(?=11)',s)) %o A386953 n12 = s.count('21') %o A386953 c += ((3*((1+n01<<2)+n11)+((n02<<2)+n12<<2))*3**n2<<n1)//3>>2 %o A386953 return c %Y A386953 Cf. A001316, A006046-A006048, A194458, A194459, A382720-A382731. %Y A386953 Partial sums of A386952. %K A386953 nonn %O A386953 0,2 %A A386953 _Chai Wah Wu_, Aug 10 2025