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.

A048967 Number of even entries in row n of Pascal's triangle (A007318).

This page as a plain text file.
%I A048967 #39 Jul 27 2023 11:03:33
%S A048967 0,0,1,0,3,2,3,0,7,6,7,4,9,6,7,0,15,14,15,12,17,14,15,8,21,18,19,12,
%T A048967 21,14,15,0,31,30,31,28,33,30,31,24,37,34,35,28,37,30,31,16,45,42,43,
%U A048967 36,45,38,39,24,49,42,43,28,45,30,31,0,63,62,63,60,65,62,63,56,69,66,67
%N A048967 Number of even entries in row n of Pascal's triangle (A007318).
%C A048967 In rows 2^k - 1 all entries are odd.
%C A048967 a(n) = 0 (all the entries in the row are odd) iff n = 2^m - 1 for some m >= 0 and then n belongs to sequence A000225. - Avi Peretz (njk(AT)netvision.net.il), Apr 21 2001
%C A048967 Also number of zeros in n-th row of SierpiƄski's triangle (cf. A047999): a(n) = A023416(A001317(n)). - _Reinhard Zumkeller_, Nov 24 2012
%H A048967 Seiichi Manyama, <a href="/A048967/b048967.txt">Table of n, a(n) for n = 0..10000</a> (terms 0..1000 from T. D. Noe)
%F A048967 a(n) = n+1 - A001316(n) = n+1 - 2^A000120(n) = n+1 - Sum_{k=0..n} (C(n, k) mod 2) = Sum_{k=0..n} ((1 - C(n, k)) mod 2).
%F A048967 a(2n) = a(n) + n, a(2n+1) = 2a(n). - _Ralf Stephan_, Oct 07 2003
%F A048967 a(n) = row sums in A219463 = A000120(A219843(n)). - _Reinhard Zumkeller_, Nov 30 2012
%F A048967 A249304(n+1) = a(n+1) + a(n). - _Reinhard Zumkeller_, Nov 14 2014
%F A048967 G.f.: 1/(1 - x)^2 - Product_{k>=0} (1 + 2*x^(2^k)). - _Ilya Gutkovskiy_, Jul 19 2019
%e A048967 Row 4 is 1 4 6 4 1 with 3 even entries so a(4)=3.
%t A048967 Table[n + 1 - Sum[ Mod[ Binomial[n, k], 2], {k, 0, n} ], {n, 0, 100} ]
%t A048967 a[n_] := n + 1 - 2^DigitCount[n, 2, 1]; Array[a, 100, 0] (* _Amiram Eldar_, Jul 27 2023 *)
%o A048967 (PARI) a(n)=if(n<1,0,if(n%2==0,a(n/2)+n/2,2*a((n-1)/2)))
%o A048967 (Haskell)
%o A048967 import Data.List (transpose)
%o A048967 a048967 n = a048967_list !! n
%o A048967 a048967_list = 0 : xs where
%o A048967    xs = 0 : concat (transpose [zipWith (+) [1..] xs, map (* 2) xs])
%o A048967 -- _Reinhard Zumkeller_, Nov 14 2014, Nov 24 2012
%o A048967 (Python)
%o A048967 def A048967(n): return n+1-(1<<n.bit_count()) # _Chai Wah Wu_, May 03 2023
%Y A048967 Cf. A007318, A001316, A000120, A000225, A038573.
%Y A048967 Cf. A249304.
%K A048967 easy,nonn
%O A048967 0,5
%A A048967 _Brian Galebach_