A289398 Least integer m > n such that (n^2 + m^2)/2 is a square.
7, 14, 21, 28, 35, 42, 17, 56, 63, 70, 77, 84, 91, 34, 105, 112, 31, 126, 133, 140, 51, 154, 47, 168, 175, 182, 189, 68, 203, 210, 49, 224, 231, 62, 85, 252, 259, 266, 273, 280, 113, 102, 301, 308, 315, 94, 79, 336, 71, 350, 93, 364, 371, 378, 385, 136, 399, 406, 413, 420
Offset: 1
Examples
a(1)=7: (1^2 + 7^2)/2 = 5^2; a(7)=17: (7^2 + 17^2)/2 = 5^2.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
f:= proc(n) local m; for m from n+2 by 2 do if issqr((n^2+m^2)/2) then return m fi od end proc: map(f, [$1..100]); # Robert Israel, Jul 07 2017
-
Mathematica
n=0;Table[n++;m=n+1;While[!IntegerQ[Sqrt[(n^2+m^2)/2]],m++];m,{100}]
-
PARI
a(n) = my(m=n+1); while(!issquare((n^2+m^2)/2), m++); m; \\ Michel Marcus, Jul 07 2017
-
Python
from itertools import count from sympy.ntheory.primetest import is_square def A289398(n): return next(m for m in count(n+2,2) if is_square(n**2+m**2>>1)) # Chai Wah Wu, Mar 02 2025
Comments