OFFSET
5,1
COMMENTS
a(3*n) <= n because with k=n: (3*n)^2 + (4*n)^2 = (5*n)^2.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 5..10004
EXAMPLE
a(6) = 2 because 6^2 + (6+2)^2 = 100 is a square.
a(20) = 1 because 20^2 + 21^2 = 841 = 29^2.
PROG
(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
(Python)
from sympy.ntheory.primetest import is_square
def a(n):
k = 1
while not is_square(n**2 + (n+k)**2): k += 1
return k
print([a(n) for n in range(5, 70)]) # Michael S. Branicky, Jul 02 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Mar 30 2014
STATUS
approved