This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A232175 #43 Nov 13 2024 15:02:55 %S A232175 0,1,3,6,10,3,21,8,36,15,55,6,78,35,15,48,136,27,171,10,42,99,253,10, %T A232175 300,143,81,42,406,15,465,64,88,255,35,63,666,323,91,3,820,21,903,55, %U A232175 66,483,1081,48,1176,125,85,39,1378,81,165,28,76,783,1711,15,1830,899,63 %N A232175 Least positive k such that n^3 + k^2 is a square, or 0 if there is no such k. %C A232175 Numbers n such that a(n) = n*(n-1)/2 appear to be A000430. %C A232175 n = 1 is the only number for which a(n) = 0. - _T. D. Noe_, Nov 21 2013 %H A232175 Chai Wah Wu, <a href="/A232175/b232175.txt">Table of n, a(n) for n = 1..10000</a> (n = 1..1000 from T. D. Noe). %H A232175 StackExchange, <a href="http://math.stackexchange.com/questions/112561">The cube of integer can be written as the difference of two square</a>. %t A232175 Join[{0}, Table[k = 1; While[! IntegerQ[Sqrt[n^3 + k^2]], k++]; k, {n, 2, 100}]] (* _T. D. Noe_, Nov 21 2013 *) %o A232175 (Python) %o A232175 import math %o A232175 for n in range(77): %o A232175 n3 = n*n*n %o A232175 y=1 %o A232175 for k in range(1, 10000001): %o A232175 s = n3 + k*k %o A232175 r = int(math.sqrt(s)) %o A232175 if r*r == s: %o A232175 print(k, end=', ') %o A232175 y=0 %o A232175 break %o A232175 if y: print(end='-, ') %o A232175 (Python) %o A232175 from __future__ import division %o A232175 from sympy import divisors %o A232175 def A232175(n): %o A232175 n3 = n**3 %o A232175 ds = divisors(n3) %o A232175 for i in range(len(ds)//2-1,-1,-1): %o A232175 x = ds[i] %o A232175 y = n3//x %o A232175 a, b = divmod(y-x,2) %o A232175 if not b: %o A232175 return a %o A232175 return 0 # _Chai Wah Wu_, Sep 12 2017 %o A232175 (PARI) a(n) = {k = 1; while (!issquare(n^3+k^2), k++); k;} \\ _Michel Marcus_, Nov 20 2013 %Y A232175 Cf. A000290, A000430, A000578, A038202, A055527, A232176. %K A232175 nonn,look %O A232175 1,3 %A A232175 _Alex Ratushnyak_, Nov 19 2013