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.

A160382 Number of 2's in base-4 representation of n.

This page as a plain text file.
%I A160382 #21 Sep 10 2024 02:18:08
%S A160382 0,0,1,0,0,0,1,0,1,1,2,1,0,0,1,0,0,0,1,0,0,0,1,0,1,1,2,1,0,0,1,0,1,1,
%T A160382 2,1,1,1,2,1,2,2,3,2,1,1,2,1,0,0,1,0,0,0,1,0,1,1,2,1,0,0,1,0,0,0,1,0,
%U A160382 0,0,1,0,1,1,2,1,0,0,1,0,0,0,1,0,0,0,1,0,1,1,2,1,0,0,1,0,1,1,2,1,1,1,2,1,2
%N A160382 Number of 2's in base-4 representation of n.
%H A160382 Dominic McCarty, <a href="/A160382/b160382.txt">Table of n, a(n) for n = 0..10000</a>
%H A160382 Franklin T. Adams-Watters and Frank Ruskey, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL12/Ruskey2/ruskey14.html">Generating Functions for the Digital Sum and Other Digit Counting Sequences</a>, JIS 12 (2009) 09.5.6.
%F A160382 Recurrence relation: a(0) = 0, a(4m+2) = 1+a(m), a(4m) = a(4m+1) = a(4m+3) = a(m).
%F A160382 G.f.: (1/(1-z))*Sum_{m>=0} (z^(2*4^m)*(1 - z^(4^m))/(1 - z^(4^(m+1)))).
%F A160382 Morphism: 0, j -> j,j,j+1,j; e.g., 0 -> 0010 -> 0010110111210010 -> ...
%t A160382 DigitCount[Range[0,110],4,2] (* _Harvey P. Dale_, Sep 09 2024 *)
%o A160382 (PARI) a(n) = #select(x->(x==2), digits(n, 4)); \\ _Michel Marcus_, Mar 24 2020
%Y A160382 Cf. A007090.
%K A160382 nonn,base,easy
%O A160382 0,11
%A A160382 _Frank Ruskey_, Jun 05 2009