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).

This page as a plain text file.
%I A249731 #11 Jul 24 2025 16:56:20
%S A249731 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,
%T A249731 -4,-12,-12,-14,21,14,20,24,1,2,11,-4,20,20,11,6,29,-18,-4,-6,22,26,
%U A249731 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
%N 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).
%H A249731 Antti Karttunen, <a href="/A249731/b249731.txt">Table of n, a(n) for n = 0..6561</a>
%F A249731 a(n) = A249732(n) - A249733(n).
%o A249731 (Scheme) (define (A249731 n) (- (A249732 n) (A249733 n)))
%o A249731 (Python)
%o A249731 import re
%o A249731 from gmpy2 import digits
%o A249731 def A249731(n):
%o A249731     s = digits(n,3)
%o A249731     n1 = s.count('1')
%o A249731     n2 = s.count('2')
%o A249731     n01 = s.count('10')
%o A249731     n02 = s.count('20')
%o A249731     n11 = len(re.findall('(?=11)',s))
%o A249731     n12 = s.count('21')
%o A249731     return (((3*(n01+1)+(n02<<2)+n12<<2)+3*n11)*(3**n2<<n1)//12)-(2+((n>>1)&~n).bit_count()<<n.bit_count()>>1) # _Chai Wah Wu_, Jul 24 2025
%Y A249731 Cf. A007318, A034931, A095143, A249723, A249732, A249733.
%K A249731 sign
%O A249731 0,5
%A A249731 _Antti Karttunen_, Nov 05 2014