login
A126209
Number of 7's in decimal expansion of 7^n.
6
0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 3, 1, 1, 2, 2, 0, 2, 1, 1, 3, 1, 0, 3, 0, 1, 4, 1, 2, 5, 1, 4, 2, 7, 1, 4, 4, 4, 3, 0, 3, 3, 3, 3, 5, 4, 1, 2, 2, 6, 2, 3, 5, 6, 6, 5, 7, 6, 6, 7, 4, 7, 5, 5, 6, 6, 3, 8, 1, 3, 7, 6, 8, 6, 7, 7, 1, 5, 7, 5, 4, 9, 7, 6, 10, 7, 7, 7, 4, 14, 8, 5, 10, 8, 10, 13, 11, 6, 7, 6, 6
OFFSET
0,12
MAPLE
P:=proc(n) local i, k, x, y, w, cont; y:=7; 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);
MATHEMATICA
DigitCount[7^Range[0, 100], 10, 7] (* Harvey P. Dale, Sep 03 2015 *)
KEYWORD
base,nonn
AUTHOR
STATUS
approved