login
Diagonals of Pascal's triangle mod 2 interpreted as binary numbers.
(Formerly M2252)
5

%I M2252 #35 Jun 20 2022 13:15:49

%S 1,1,3,2,7,5,13,8,29,21,55,34,115,81,209,128,465,337,883,546,1847,

%T 1301,3357,2056,7437,5381,14087,8706,29443,20737,53505,32768,119041,

%U 86273,226051,139778,472839,333061,859405,526344,1903901,1377557,3606327

%N Diagonals of Pascal's triangle mod 2 interpreted as binary numbers.

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

%H N. J. A. Sloane, <a href="/A006921/b006921.txt">Table of n, a(n) for n = 0..1000</a>

%H B. R. Hodgson, <a href="/A006921/a006921.pdf">Letter to N. J. A. Sloane, Oct. 1991</a>

%H B. R. Hodgson, <a href="http://www.fq.math.ca/Scanned/30-1/hodgson.pdf">On some number sequences related to the parity of binomial coefficients</a>, Fib. Quart., 30 (1992), 35-47.

%F a(2*n) = A260022(n); a(2*n+1) = A168081(n+1). - _Reinhard Zumkeller_, Jul 14 2015

%F a(n) = Sum_{r=0..n/2} (binomial(n-r,r)_{mod 2} * 2^(floor(n/2)-r). - _N. J. A. Sloane_, Jul 14 2015

%p b2:=(n,k)->binomial(n,k) mod 2;

%p H:=n->add(b2(n-r,r)*2^( floor(n/2)-r ), r=0..floor(n/2));

%p [seq(H(n),n=0..30)]; # _N. J. A. Sloane_, Jul 14 2015

%o (Haskell)

%o a006921 = sum . zipWith (*)

%o a000079_list . map (flip mod 2) . reverse . a011973_row

%o -- _Reinhard Zumkeller_, Jul 14 2015

%o (Python)

%o def A006921(n): return sum(int(not r & ~(n-r))*2**(n//2-r) for r in range(n//2+1)) # _Chai Wah Wu_, Jun 20 2022

%Y Cf. A011973, A000079, A047999 (SierpiƄski), A007318, A101624.

%Y Cf. A168081, A260022.

%Y Cf. A257971 (first differences).

%K nonn,easy

%O 0,3

%A _N. J. A. Sloane_