%I #12 Jul 29 2023 06:41:08
%S 7,24,25,60,65,72,97,4704,4705,11292,12233,79044,79985,124212,147737,
%T 430416,455065,504072,679097,24502296,24511705,34278300,42140545,
%U 68012700,80009705,192023292,208025233,356427144,412692145,990461148,1072999577,2403086064,2631758105
%N a(1)=7; a(n),a(n+1) are smallest > a(n-1) such that a(n-1)^2+a(n)^2=a(n+1)^2.
%C Note that each time two more terms are added simultaneously.
%e a(1)=7 therefore a(2)=24 and a(3)=25: 7^2+24^2=25^2; a(3)=25 therefore a(4)=60 and a(5)=65: 25^2+60^2=65^2.
%o (Python)
%o from math import isqrt
%o from sympy.ntheory.primetest import is_square
%o def aupton(terms):
%o alst = [7]
%o for n in range(2, terms+1, 2):
%o sq1, an = alst[-1]**2, alst[-1] + 1
%o while not is_square(sq1 + an**2): an += 1
%o alst.extend([an, isqrt(sq1 + an**2)])
%o return alst[:terms]
%o print(aupton(19)) # _Michael S. Branicky_, Jul 24 2021
%Y Cf. A077034, A076604.
%K nonn
%O 1,1
%A _Zak Seidov_, Oct 21 2002
%E a(16) and beyond from _Michael S. Branicky_, Jul 24 2021
|