|
|
A243975
|
|
Least number k such that 3^k contains exactly n identical digits.
|
|
2
|
|
|
1, 8, 11, 29, 32, 47, 34, 33, 90, 98, 112, 136, 128, 172, 111, 168, 146, 211, 241, 218, 220, 290, 278, 298, 323, 355, 329, 316, 344, 446, 427, 395, 410, 528, 481, 443, 498, 523, 574, 540, 531, 538, 618, 549, 694, 669, 733, 717, 788, 707, 740, 734, 831, 743, 857, 850, 864
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
It is permissible for 3^k to have more than one digit repeated n times. For example a(11)=112, and 3^112 has 11 digits equal to 3 and also 11 digits equal to 7. - Harvey P. Dale, Feb 19 2015
|
|
LINKS
|
|
|
EXAMPLE
|
3^11 = 177147 contains 3 of the same digit (7). Since 11 is the smallest power of 3 to do this, a(3) = 11.
|
|
MAPLE
|
N:= 1000: # to get a(1) to a(m-1) where a(m) is the first > N
f:= proc(k)
local L;
L:= convert(3^k, base, 10);
max(seq(numboccur(i, L), i=0..9));
end proc:
for k from 1 to N do
v:= f(k);
if not assigned(A[v]) then A[v]:= k fi;
od:
for m from 1 while assigned(A[m]) do od:
|
|
MATHEMATICA
|
lnk[n_]:=Module[{k=1}, While[Count[DigitCount[3^k], n]<1, k++]; k]; Array[ lnk, 60] (* Harvey P. Dale, Feb 19 2015 *)
|
|
PROG
|
(Python)
def b():
..n = 1
..k = 1
..while k < 50000:
....st = str(3**k)
....if len(st) >= n:
......for a in range(10):
........count = 0
........for i in range(len(st)):
..........if st[i] == str(a):
............count += 1
........if count == n:
..........print(k, end=', ')
..........n += 1
..........k = 0
..........break
......k += 1
....else:
......k += 1
b()
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|