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 A379596 #26 Mar 02 2025 10:02:12 %S A379596 3,6,9,12,15,18,5,24,27,30,33,36,39,10,45,48,7,54,57,60,15,66,12,72, %T A379596 75,78,81,20,87,90,9,96,99,14,25,108,111,114,117,120,36,30,129,132, %U A379596 135,24,16,144,11,150,21,156,159,162,165,40,171,174,177,180,183,18,45 %N A379596 a(n) is the least positive integer k for which k^2 + (k + n)^2 is a square. %C A379596 a(n) is also the smallest short leg of a Pythagorean triangle where the difference between the two legs is n. %C A379596 A289398(n) is the least integer m > n for which (n^2 + m^2)/2 is a square. This is equivalent to the least positive integer k for which (n^2 + (n + 2*k)^2)/2 = k^2 + (n + k)^2 is a square. From m = n + 2*k follows a(n) = (A289398(n) - n)/2. %H A379596 Felix Huber, <a href="/A379596/b379596.txt">Table of n, a(n) for n = 1..10000</a> %H A379596 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PythagoreanTriple.html">Pythagorean Triple</a> %F A379596 a(n) = (A289398(n) - n)/2. %e A379596 a(1) = 3 because 3^2 + (3 + 1)^2 = 5^2 and there is no smaller positive integer k than 3 with that property. %e A379596 a(28) = 20 because 20^2 + (20 + 28)^2 = 52^2 and there is no smaller positive integer k than 20 with that property. %p A379596 A379596:=proc(n) %p A379596 local k; %p A379596 for k do %p A379596 if issqr(k^2+(k+n)^2) then %p A379596 return k %p A379596 fi %p A379596 od %p A379596 end proc; %p A379596 seq(A379596(n),n=1..63); %t A379596 s={};Do[k=0;Until[IntegerQ[Sqrt[k^2+(k+n)^2]],k++];AppendTo[s,k],{n,63}];s (* _James C. McMahon_, Mar 02 2025 *) %o A379596 (PARI) a(n) = my(k=1); while (!issquare(k^2 + (k + n)^2), k++); k; \\ _Michel Marcus_, Feb 15 2025 %o A379596 (Python) %o A379596 from itertools import count %o A379596 from sympy.ntheory.primetest import is_square %o A379596 def A379596(n): return next(k for k in count(1) if is_square(k**2+(k+n)**2)) # _Chai Wah Wu_, Mar 02 2025 %Y A379596 Cf. A089015, A009004, A120682, A132404, A289398, A379830. %K A379596 nonn,easy %O A379596 1,1 %A A379596 _Felix Huber_, Feb 15 2025