A232175 Least positive k such that n^3 + k^2 is a square, or 0 if there is no such k.
0, 1, 3, 6, 10, 3, 21, 8, 36, 15, 55, 6, 78, 35, 15, 48, 136, 27, 171, 10, 42, 99, 253, 10, 300, 143, 81, 42, 406, 15, 465, 64, 88, 255, 35, 63, 666, 323, 91, 3, 820, 21, 903, 55, 66, 483, 1081, 48, 1176, 125, 85, 39, 1378, 81, 165, 28, 76, 783, 1711, 15, 1830, 899, 63
Offset: 1
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..10000 (n = 1..1000 from T. D. Noe).
- StackExchange, The cube of integer can be written as the difference of two square.
Programs
-
Mathematica
Join[{0}, Table[k = 1; While[! IntegerQ[Sqrt[n^3 + k^2]], k++]; k, {n, 2, 100}]] (* T. D. Noe, Nov 21 2013 *)
-
PARI
a(n) = {k = 1; while (!issquare(n^3+k^2), k++); k;} \\ Michel Marcus, Nov 20 2013
-
Python
import math for n in range(77): n3 = n*n*n y=1 for k in range(1, 10000001): s = n3 + k*k r = int(math.sqrt(s)) if r*r == s: print(k, end=', ') y=0 break if y: print(end='-, ')
-
Python
from _future_ import division from sympy import divisors def A232175(n): n3 = n**3 ds = divisors(n3) for i in range(len(ds)//2-1,-1,-1): x = ds[i] y = n3//x a, b = divmod(y-x,2) if not b: return a return 0 # Chai Wah Wu, Sep 12 2017
Comments