login
A086484
Let k be the largest number such that n is a k-th power; then a(n) is the least positive number m such that m + n is a (k+1)st power.
1
1, 2, 1, 4, 4, 3, 2, 8, 18, 6, 5, 4, 3, 2, 1, 16, 8, 7, 6, 5, 4, 3, 2, 1, 2, 10, 54, 8, 7, 6, 5, 32, 3, 2, 1, 28, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 64, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 162, 18, 17, 16, 15, 14, 13, 12, 11, 10
OFFSET
1,2
LINKS
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
Cf. A052409.
Sequence in context: A095830 A193915 A101621 * A349572 A349571 A091335
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