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.

A386953 Total number of entries in rows 0,1,...,n of Pascal's triangle not divisible by 9.

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 28, 36, 45, 49, 57, 69, 78, 90, 105, 119, 135, 153, 160, 174, 195, 209, 228, 252, 273, 297, 324, 328, 336, 348, 360, 378, 402, 422, 450, 486, 495, 513, 540, 560, 588, 624, 655, 693, 738, 752, 780, 822, 850, 888, 936, 978, 1026, 1080, 1087
Offset: 0

Views

Author

Chai Wah Wu, Aug 10 2025

Keywords

Crossrefs

Programs

  • Python
    import re
    from gmpy2 import digits
    def A386953(n):
        c = 0
        for m in range(n+1):
            s = digits(m,3)
            n1 = s.count('1')
            n2 = s.count('2')
            n01 = s.count('10')
            n02 = s.count('20')
            n11 = len(re.findall('(?=11)',s))
            n12 = s.count('21')
            c += ((3*((1+n01<<2)+n11)+((n02<<2)+n12<<2))*3**n2<>2
        return c