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

%I #8 Jun 26 2018 19:09:50

%S 1,5,22,15,26,38,32,56,45,77,65,52,73,112,110,120,108,100,144,166,129,

%T 192,226,169,211,255,189,195,205,227,277,275,273,345,274,347,283,280,

%U 293,364,375,326,358,387,446,408,442,428,431,417,516

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

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

%t With[{c8=8^Range[520]},Flatten[Table[First[Position[c8,_?(DigitCount[#,10,3] == n&)]],{n,0,50}]]] (* _Harvey P. Dale_, Mar 13 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