login
A285056
a(n) = the first positive integer, not ending in zero, whose cube has a substring of exactly n identical digits.
1
1, 11, 126, 753, 1923, 32183, 134708, 1487139, 23908603, 215443469, 106917811, 15056809703, 27354803113, 681048619195, 361160395301
OFFSET
1,2
EXAMPLE
a(3) = 126, as 126^3 = 2000376 contains a digit (0) repeated n (3) times.
MATHEMATICA
a[n_] := Block[{k=1}, While[Mod[k, 10] == 0 || ! MemberQ[Length /@ Split[ IntegerDigits[ k^3]], n], k++]; k]; Array[a, 8] (* Giovanni Resta, Apr 10 2017 *)
PROG
(Python) import collections
import re
cur = 1
def repeat( num , reps ):
r = str(num)
n = 1
while n < reps:
r += str(num)
n += 1
return r;
while True:
k = 0
while k < 10:
rep = repeat(k, 9)
while re.search(rep, str(cur**3)) != None:
if re.search(rep + str(k), str(cur**3)) == None:
print(str(cur) + ", " + str(cur**3))
rep += str(k)
else:
rep += str(k)
k += 1
cur += 1
if cur % 10 == 0:
cur += 1 #note: this will display all cubes with a substring of 9 repeated digits. To change this to n repeats, replace repeat(k, 9) with repeat(k, n).
CROSSREFS
Cf. A167712.
Sequence in context: A240335 A076483 A209901 * A015597 A296732 A156970
KEYWORD
nonn,base,more
AUTHOR
Jason Wang, Apr 08 2017
EXTENSIONS
a(10)-a(15) from Giovanni Resta, Apr 10 2017
STATUS
approved