login
a(n) = floor(sqrt(a(n-1)^2 + a(n-2)^2)), a(1)=1, a(2)=3.
10

%I #13 Sep 08 2022 08:45:17

%S 1,3,3,4,5,6,7,9,11,14,17,22,27,34,43,54,69,87,111,141,179,227,289,

%T 367,467,593,754,959,1219,1551,1972,2508,3190,4057,5160,6563,8348,

%U 10618,13506,17180,21853,27797,35358,44976,57210,72772,92567,117747,149776

%N a(n) = floor(sqrt(a(n-1)^2 + a(n-2)^2)), a(1)=1, a(2)=3.

%H G. C. Greubel, <a href="/A104803/b104803.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = floor(sqrt(a(n-1)^2 + a(n-2)^2)) with a(1)=1, a(2)=3.

%t a[n_]:= a[n]= If[n<3, 2*n-1, Floor[Sqrt[a[n-1]^2 +a[n-2]^2]]]; Table[a[n], {n, 50}] (* _Robert G. Wilson v_, Mar 28 2005 *)

%t nxt[{a_,b_}]:={b,Floor[Sqrt[a^2+b^2]]}; Transpose[NestList[nxt,{1,3}, 50]] [[1]] (* _Harvey P. Dale_, Oct 29 2012 *)

%o (Magma)

%o A104803:= func< n| n lt 3 select (2*n-1) else Floor(Sqrt(Self(n-1)^2 +Self(n-2)^2)) >;

%o [A104803(n): n in [1..60]]; // _G. C. Greubel_, Jun 27 2021

%o (Sage)

%o @CachedFunction

%o def a(n): return (2*n-1) if (n<3) else floor(sqrt(a(n-1)^2 + a(n-2)^2))

%o [a(n) for n in (1..60)] # _G. C. Greubel_, Jun 27 2021

%Y Cf. A104804, A104805, A104810.

%K nonn

%O 1,2

%A _Zak Seidov_, Mar 26 2005

%E More terms from _Robert G. Wilson v_, Mar 28 2005