cp's OEIS Frontend

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.

A239975 Least k>0 such that n^2 + (n+k)^2 is a square, or -1 if no such k exists.

This page as a plain text file.
%I A239975 #16 Mar 21 2022 11:11:23
%S A239975 7,2,17,7,3,14,49,4,71,34,5,14,127,6,161,1,7,98,241,8,35,142,9,17,391,
%T A239975 10,449,28,11,254,49,12,647,322,13,2,799,14,881,73,15,482,1057,7,119,
%U A239975 70,17,113,1351,18,77,34,19,782,1681,3,1799,898,21,56,7,22,2177,217,23
%N A239975 Least k>0 such that n^2 + (n+k)^2 is a square, or -1 if no such k exists.
%C A239975 a(3*n) <= n because with k=n: (3*n)^2 + (4*n)^2 = (5*n)^2.
%H A239975 Michael S. Branicky, <a href="/A239975/b239975.txt">Table of n, a(n) for n = 5..10004</a>
%e A239975 a(6) = 2 because 6^2 + (6+2)^2 = 100 is a square.
%e A239975 a(20) = 1 because 20^2 + 21^2 = 841 = 29^2.
%o A239975 (PARI) s=[]; for(n=5, 100, k=1; while(!issquare(n^2+(n+k)^2), k++); s=concat(s, k)); s \\ _Colin Barker_, Mar 31 2014
%o A239975 (Python)
%o A239975 from sympy.ntheory.primetest import is_square
%o A239975 def a(n):
%o A239975     k = 1
%o A239975     while not is_square(n**2 + (n+k)**2): k += 1
%o A239975     return k
%o A239975 print([a(n) for n in range(5, 70)]) # _Michael S. Branicky_, Jul 02 2021
%Y A239975 Cf. A000290, A055527 (least k>0 such that n^2 + k^2 is a square).
%K A239975 nonn
%O A239975 5,1
%A A239975 _Alex Ratushnyak_, Mar 30 2014