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.

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

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 28, 36, 41, 51, 60, 72, 83, 97, 111, 127, 132, 142, 155, 175, 188, 206, 226, 250, 261, 283, 303, 331, 353, 381, 409, 441, 446, 456, 469, 489, 506, 532, 560, 600, 613, 639, 665, 701, 729, 769, 809, 857, 868, 890, 918, 962, 990, 1030, 1074, 1130, 1152, 1196, 1236, 1292, 1336, 1392, 1448, 1512, 1517, 1527
Offset: 0

Views

Author

N. J. A. Sloane, Apr 23 2025

Keywords

Crossrefs

Programs

  • Python
    def A382731(n):
        c = 0
        for m in range(n+1):
            n1 = m>>1
            n2 = n1>>1
            np = ~m
            n100 = (n2&(~n1)&np).bit_count()
            n110 = (n2&n1&np).bit_count()
            n10 = (n1&np).bit_count()
            c += ((n100+1<<3)+(n110<<1)+n10*(n10+3))<>3
        return c # Chai Wah Wu, Aug 10 2025