OFFSET
1,2
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10001
EXAMPLE
From David A. Corneth, Sep 24 2023: (Start)
For n = 3, k = 1 as 3 = 3^1 is a 1st power (the gcd of the exponents is 1). Hence we look for m such that m + 3 is a (1+1)th power, i.e., a 2nd power. The next 2nd power after 3 is 4 and so m + 3 = 4 so a(n) = m = 4-3 = 1.
For n = 36, k = 2 as 36 = 2^2 * 3^2 is a 2nd power (the gcd of the exponents is 2). Hence we look for m such that m + 36 is a (2+1)th power, i.e., a 3rd power. The next 3rd power after 36 is 64 and so m + 36 = 64 so a(n) = m = 64 - 36 = 28. (End)
PROG
(PARI) print1(1", "); for (n = 2, 100, f = factor(n); g = f[1, 2]; for (i = 2, matsize(f)[1], g = gcd(g, f[i, 2])); x = sqrtn(n, g+1); print1(round(ceil(x))^(g + 1) - n, ", ")); \\ David Wasserman, Mar 07 2005
(PARI) a(n) = {my(f = factor(n), k = gcd(f[, 2])); (sqrtnint(n, k+1) + 1)^(k + 1) - n} \\ David A. Corneth, Sep 24 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Jul 26 2003
EXTENSIONS
More terms from David Wasserman, Mar 07 2005
Offset corrected by David A. Corneth, Sep 24 2023
STATUS
approved