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.

A006048 Number of entries in first n rows of Pascal's triangle not divisible by 3.

Original entry on oeis.org

1, 3, 6, 8, 12, 18, 21, 27, 36, 38, 42, 48, 52, 60, 72, 78, 90, 108, 111, 117, 126, 132, 144, 162, 171, 189, 216, 218, 222, 228, 232, 240, 252, 258, 270, 288, 292, 300, 312, 320, 336, 360, 372, 396, 432, 438, 450, 468, 480, 504, 540, 558, 594, 648, 651, 657, 666, 672, 684, 702, 711, 729, 756, 762, 774, 792, 804, 828, 864, 882, 918, 972, 981, 999, 1026, 1044, 1080, 1134, 1161, 1215, 1296
Offset: 0

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Partial sums of A006047.

Programs

  • Python
    from math import prod
    from gmpy2 import digits
    def A006048(n): return sum(prod(int(d)+1 for d in digits(m,3)) for m in range(n+1)) # Chai Wah Wu, Aug 10 2025
    
  • Python
    from math import prod
    from gmpy2 import digits
    def A006048(n):
        d = list(map(lambda x:int(x)+1,digits(n+1,3)[::-1]))
        return sum((b-1)*prod(d[a:])*6**a for a, b in enumerate(d))>>1  # Chai Wah Wu, Aug 13 2025

Extensions

More terms from N. J. A. Sloane, Apr 23 2025