login
A232175
Least positive k such that n^3 + k^2 is a square, or 0 if there is no such k.
3
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,3
COMMENTS
Numbers n such that a(n) = n*(n-1)/2 appear to be A000430.
n = 1 is the only number for which a(n) = 0. - T. D. Noe, Nov 21 2013
LINKS
MATHEMATICA
Join[{0}, Table[k = 1; While[! IntegerQ[Sqrt[n^3 + k^2]], k++]; k, {n, 2, 100}]] (* T. D. Noe, Nov 21 2013 *)
PROG
(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
(PARI) a(n) = {k = 1; while (!issquare(n^3+k^2), k++); k; } \\ Michel Marcus, Nov 20 2013
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Alex Ratushnyak, Nov 19 2013
STATUS
approved