login
A109691
Smallest 5th power that contains exactly n occurrences of the string n.
2
1, 1, 248832, 6436343, 45435424, 15575653771875, 616132666368, 778890712975487707, 6648881538818884375, 99900039992000799968, 10610441011074322410255643277715061010710106439101, 11311111984777108548801111731222111251108343
OFFSET
0,3
COMMENTS
a(11) assumes occurrences can overlap (cf. A109689). - Michael S. Branicky, Dec 21 2020
EXAMPLE
a(2)=248832 since this is the first 5th power that contains exactly two 2's.
PROG
(Python)
def count_overlaps(subs, s):
c = i = 0
while i != -1:
i = s.find(subs, i)
if i != -1: c += 1; i += 1
return c
def a(n, POW=5): # call with 4, 3 for A109690, A109689, resp.
strn = str(n)
k = int((10**(len(set(strn))*n-1))**(1/POW)) # len(strn) for no overlaps
while True:
# if str(pow(k, POW)).count(strn) == n: break # use this for no overlaps
if count_overlaps(strn, str(pow(k, POW))) == n: break
k += 1
return k**POW
print([a(n) for n in range(10)]) # Michael S. Branicky, Dec 21 2020
CROSSREFS
Cf. A109689 (cubes), A109690 (4th powers).
Sequence in context: A268842 A223238 A017405 * A017525 A223326 A250516
KEYWORD
base,more,nonn
AUTHOR
Erich Friedman, Aug 07 2005
EXTENSIONS
a(10)-a(11) from Michael S. Branicky, Dec 21 2020
STATUS
approved