OFFSET
1,3
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = n-1 for n prime; a(n) = 0 for n a 3rd power. - Klaus Brockhaus, Nov 19 2008
EXAMPLE
n = 9 = 3*1*3 = 3*(3-2)*(3+0) with d = 3, b = 2, c = 0. So a(9) = k = 2+0 = 2, since there is no solution with k = 1.
PROG
(Magma) [ Min(v) where v is [ b+c: d, y, z in Divisors(n) | d*(d-b)*(d+c) eq n and d ge 0 and b ge 0 and c ge 0 where b is d-y where c is z-d ]: n in [1..85] ]; // Klaus Brockhaus, Nov 19 2008
(PARI) first(n) = {my(res = vector(n, i, i), t = 0); for(i = 1, n, for(j = i, n \ i, for(k = j, n \ (i * j), res[i * j * k] = min(res[i * j * k], k - i)))); res} \\ David A. Corneth, May 12 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Samuel Zbarsky (sa_zbarsky(AT)yahoo.com), Nov 11 2008
EXTENSIONS
Definition and example edited, and extended beyond a(42) by Klaus Brockhaus, Nov 19 2008
STATUS
approved