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.

A316863 Number of times 2 appears in the decimal expansion of n.

This page as a plain text file.
%I A316863 #27 Jan 04 2025 02:46:35
%S A316863 0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,2,1,1,1,1,1,1,1,0,0,1,0,
%T A316863 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,
%U A316863 0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0
%N A316863 Number of times 2 appears in the decimal expansion of n.
%H A316863 Robert Israel, <a href="/A316863/b316863.txt">Table of n, a(n) for n = 0..10000</a>
%F A316863 G.f.: (1-x)^(-1)*Sum_{k>=0} (x^(2*10^k)-x^(3*10^k))/(1-x^(10^(k+1))). - _Robert Israel_, Apr 21 2020
%e A316863 a(0) = 0 since the decimal representation of 0 does not contain the digit 2.
%e A316863 a(2) = 1 since 2 appears once in the decimal expansion of 2.
%e A316863 a(22) = 2 since 2 appears twice in the decimal expansion of 22.
%p A316863 f:= n -> numboccur(2,convert(n,base,10)):
%p A316863 map(f, [$0..200]); # _Robert Israel_, Apr 21 2020
%t A316863 Array[ DigitCount[#, 10, 2] &, 105, 0]
%o A316863 (PARI) a(n) = #select(x->x==2, digits(n)); \\ _Michel Marcus_, Jul 20 2018
%Y A316863 Cf. A043497, A043498, A043499, A043500.
%Y A316863 Cf. A055641, A268643, A316864, A316865, A316866, A316867, A316868, A316869, A102683.
%K A316863 base,easy,nonn
%O A316863 0,23
%A A316863 _Robert G. Wilson v_, Jul 15 2018