OFFSET
1,1
COMMENTS
a(n) <= n^2 for all n > 1 because n * n^2 = n^3.
LINKS
Peter Kagey, Table of n, a(n) for n = 1..5000
EXAMPLE
a(12) = 18 because 12*18 = 6^3 (and 12*13, 12*14, 12*15, 12*16, 12*17 are not perfect cubes).
MATHEMATICA
f[n_] := Block[{k = n + 1}, While[! IntegerQ@ Power[k n, 1/3], k++]; k]; Array[f, 54] (* Michael De Vlieger, Mar 17 2015 *)
PROG
(Ruby)
def a(n)
min = (n**(2/3.0)).ceil
(min..n+1).each { |i| return i**3/n if i**3 % n == 0 && i**3 > n**2 }
end
(PARI) a(n)=if (n==1, 8, for(k=n+1, n^2, if(ispower(k*n, 3), return(k))))
vector(100, n, a(n)) \\ Derek Orr, Feb 07 2015
(PARI) a(n) = {f = factor(n); for (i=1, #f~, if (f[i, 2] % 3, f[i, 2] = 3 - f[i, 2]); ); cb = factorback(f); cbr = sqrtnint(cb*n, 3); cb = cbr^3; k = cb/n; while((type(k=cb/n) != "t_INT") || (k<=n), cbr++; cb = cbr^3; ); k; } \\ Michel Marcus, Mar 14 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Peter Kagey, Feb 07 2015
STATUS
approved