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.

A126205 Number of 3's in decimal expansion of 3^n, with n>=0.

This page as a plain text file.
%I A126205 #8 May 26 2015 10:28:54
%S A126205 0,1,0,0,0,1,0,0,0,1,0,0,1,2,0,1,1,1,1,0,1,3,2,1,1,1,1,0,0,4,1,3,1,1,
%T A126205 0,1,1,3,1,1,0,3,2,3,2,4,1,2,3,4,0,4,2,3,3,0,7,2,2,4,4,3,2,3,4,5,6,2,
%U A126205 4,8,3,1,2,6,3,4,5,4,3,2,6,5,4,8,0,4,4,7,2,4,3,6,5,8,5,3,7,3,2,4,5
%N A126205 Number of 3's in decimal expansion of 3^n, with n>=0.
%e A126205 a(21)=3 because 3^21=10460353203 with three 3's.
%p A126205 P:=proc(n) local i,k,x,y,w,cont; y:=3; k:=y; for i from 0 by 1 to n do x:=y^i; cont:=0; while x>0 do w:=x-trunc(x/10)*10; if w=k then cont:=cont+1; fi; x:=trunc(x/10); od; print(cont); od; end: P(100);
%t A126205 DigitCount[3^Range[0,100],10,3] (* _Harvey P. Dale_, May 26 2015 *)
%Y A126205 Cf. A065710, A126206, A126207, A126208, A126209, A126210, A126211.
%K A126205 nonn,base
%O A126205 0,14
%A A126205 _Paolo P. Lava_ and _Giorgio Balzarotti_, Dec 20 2006