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.

A249731 Number of multiples of 4 on row n of Pascal's triangle minus the number of multiples of 9 on the same row: a(n) = A249732(n) - A249733(n).

Original entry on oeis.org

0, 0, 0, 0, 2, 0, 1, 0, 6, -2, 0, 0, 3, 0, 3, -2, 13, 12, -1, 2, 13, -2, 3, 0, 15, 12, 11, -20, -4, -12, -12, -14, 21, 14, 20, 24, 1, 2, 11, -4, 20, 20, 11, 6, 29, -18, -4, -6, 22, 26, 32, 18, 32, 22, -25, -34, 9, -4, -1, -6, 9, 0, 15, -50, 25, 36, 23, 32, 49, 32, 44, 48, 13, 26, 43, 10, 41, 40, 31, 24, 73, -12
Offset: 0

Views

Author

Antti Karttunen, Nov 05 2014

Keywords

Crossrefs

Programs

  • Python
    import re
    from gmpy2 import digits
    def A249731(n):
        s = digits(n,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')
        return (((3*(n01+1)+(n02<<2)+n12<<2)+3*n11)*(3**n2<>1)&~n).bit_count()<>1) # Chai Wah Wu, Jul 24 2025
  • Scheme
    (define (A249731 n) (- (A249732 n) (A249733 n)))
    

Formula

a(n) = A249732(n) - A249733(n).