|
|
A018797
|
|
Smallest cube that begins with n.
|
|
5
|
|
|
0, 1, 27, 343, 4096, 512, 64, 729, 8, 9261, 1000, 110592, 125, 1331, 140608, 15625, 166375, 1728, 185193, 19683, 205379, 216, 226981, 238328, 24389, 250047, 262144, 27, 287496, 29791, 300763, 314432, 32768, 3375, 343, 35937, 3652264, 373248
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
LINKS
|
|
|
FORMULA
|
|
|
MATHEMATICA
|
a[n_] := For[idn = IntegerDigits[n]; k = 1, True, k++, idk = IntegerDigits[k^3]; If[Length[idn] <= Length[idk], If[idk[[1 ;; Length[idn]]] == idn, Return[k^3]]]]; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 1000}] (* Jean-François Alcover, Mar 13 2016 *)
id[n_]:=With[{idn=IntegerDigits[n]}, idn==Take[IntegerDigits[#], Length[ idn]]&]; With[{c=Range[0, 250]^3}, Table[SelectFirst[c, id[k]], {k, 0, 40}]]//Quiet (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 08 2018 *)
|
|
PROG
|
(Python)
for n in range(1, 10**3):
..for k in range(10**3):
....if str(k**3).startswith(str(n)):
......print(k**3, end=', ')
......break
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,nice
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|