OFFSET
0,5
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..8192
Kenneth S. Davis and William A. Webb, Pascal's triangle modulo 4, Fib. Quart., 29 (1991), 79-83.
EXAMPLE
Row 9 of Pascal's triangle is: {1,9,36,84,126,126,84,36,9,1}. The terms 36 and 84 are only multiples of four, and both of them occur two times on that row, thus a(9) = 2*2 = 4.
Row 10 of Pascal's triangle is: {1,10,45,120,210,252,210,120,45,10,1}. The terms 120 (= 4*30) and 252 (= 4*63) are only multiples of four, and the former occurs twice, while the latter is alone at the center, thus a(10) = 2+1 = 3.
PROG
(PARI)
A249732(n) = { my(c=0); for(k=0, n\2, if(!(binomial(n, k)%4), c += (if(k<(n/2), 2, 1)))); return(c); } \\ Slow...
for(n=0, 8192, write("b249732.txt", n, " ", A249732(n)));
(Python)
def A249732(n): return n+1-(2+((n>>1)&~n).bit_count()<<n.bit_count()>>1) # Chai Wah Wu, Jul 24 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 04 2014
STATUS
approved
