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 A232176 #31 Nov 13 2024 16:09:15 %S A232176 1,2,6,10,14,18,7,5,8,34,6,42,46,15,54,16,14,66,70,74,23,82,9,90,17, %T A232176 98,102,10,110,15,25,122,126,16,39,48,40,21,150,34,158,29,54,48,30,13, %U A232176 182,63,55,194,56,202,14,45,214,63,222,26,41,234,31,42,39,250,32,63 %N A232176 Least positive k such that n^2 + triangular(k) is a square. %C A232176 Triangular(k) = A000217(k) = k*(k+1)/2. %C A232176 a(n) <= 4*n - 2, because with k = 4*n-2: n^2 + k*(k+1)/2 = n^2 + (4*n-2)*(4*n-1)/2 = 9*n^2 - 6*n + 1 = (3*n-1)^2. %C A232176 The sequence of numbers n such that a(n)=n begins: 8, 800, 7683200 ... - a subsequence of A220186. %H A232176 Andrey Zabolotskiy, <a href="/A232176/b232176.txt">Table of n, a(n) for n = 0..5000</a> %t A232176 lpk[n_]:=Module[{k=1},While[!IntegerQ[Sqrt[n^2+(k(k+1))/2]],k++];k]; Array[ lpk,70,0] (* _Harvey P. Dale_, May 04 2018 *) %o A232176 (Python) %o A232176 import math %o A232176 for n in range(77): %o A232176 n2 = n*n %o A232176 y=1 %o A232176 for k in range(1,10000001): %o A232176 sum = n2 + k*(k+1)//2 %o A232176 r = int(math.sqrt(sum)) %o A232176 if r*r == sum: %o A232176 print(str(k), end=',') %o A232176 y=0 %o A232176 break %o A232176 if y: print('-', end=',') %o A232176 (PARI) a(n) = {k = 1; while (! issquare(n^2 + k*(k+1)/2), k++); k;} \\ _Michel Marcus_, Nov 20 2013 %Y A232176 Cf. A000290, A000217, A038202, A055527, A220186, A232175. %Y A232176 Cf. A232179 (least k>=0 such that n^2 + triangular(k) is a triangular number). %Y A232176 Cf. A101157 (least k>0 such that triangular(n) + k^2 is a triangular number). %Y A232176 Cf. A232178 (least k>=0 such that triangular(n) + k^2 is a square). %K A232176 nonn %O A232176 0,2 %A A232176 _Alex Ratushnyak_, Nov 19 2013