OFFSET
1,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = floor(sqrt(a(n-1)^2 + a(n-2)^2)) with a(1) = 100, a(2) = 300.
MATHEMATICA
a[n_]:= a[n]= If[n<3, 100*(2*n-1), Floor[Sqrt[a[n-1]^2 + a[n-2]^2]] ];
Table[a[n], {n, 40}] (* G. C. Greubel, Jun 27 2021 *)
PROG
(Magma)
A104908:= func< n| n lt 3 select 100*(2*n-1) else Floor(Sqrt(Self(n-1)^2 +Self(n-2)^2)) >;
[A104908(n): n in [1..40]]; // G. C. Greubel, Jun 27 2021
(Sage)
@CachedFunction
def a(n): return 100*(2*n-1) if (n<3) else floor(sqrt(a(n-1)^2 + a(n-2)^2))
[a(n) for n in (1..40)] # G. C. Greubel, Jun 27 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Mar 29 2005
STATUS
approved