login
Smallest k such that 7^k has exactly n 5's in its decimal representation.
0

%I #8 Jun 26 2018 19:13:04

%S 1,7,15,27,21,49,55,47,51,87,85,107,75,99,61,149,138,133,171,135,165,

%T 237,209,197,269,221,232,219,277,248,258,306,271,264,357,296,310,347,

%U 354,260,342,374,407,425,362,457,485,480,486,488,492

%N Smallest k such that 7^k has exactly n 5's in its decimal representation.

%t a = {}; Do[k = 1; While[ Count[ IntegerDigits[7^k], 5] != n, k++ ]; a = Append[a, k], {n, 0, 50} ]; a

%t Join[{1},With[{p7=7^Range[0,500]},Flatten[Table[Position[p7,_?(DigitCount[ #,10,5]==n&),{1},1],{n,50}]]-1]] (* _Harvey P. Dale_, Sep 17 2013 *)

%K base,nonn

%O 0,2

%A _Robert G. Wilson v_, Aug 10 2001

%E Name corrected by _Jon E. Schoenfield_, Jun 26 2018