login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A007759 Knopfmacher expansion of sqrt(2): a(2n) = 2*(a(2n-1) + 1)^2 - 1, a(2n+1) = 2*(a(2n)^2 - 1). 2
2, 17, 576, 665857, 886731088896, 1572584048032918633353217, 4946041176255201878775086487573351061418968498176, 48926646634423881954586808839856694558492182258668537145547700898547222910968507268117381704646657 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
A. Knopfmacher and J. Knopfmacher, An alternating product representation for real numbers, in Applications of Fibonacci numbers, Vol. 3 (Kluwer 1990), pp. 209-216.
MAPLE
a:= proc(n) option remember;
if n=1 then 2
elif `mod`(n, 2) = 0 then 2*(a(n-1) +1)^2 -1
else 2*(a(n-1)^2 -1)
end if; end proc;
seq(a(n), n = 1..9); # G. C. Greubel, Mar 04 2020
MATHEMATICA
a[n_]:= a[n]= If[n==1, 2, If[EvenQ[n], 2*(a[n-1] +1)^2 -1, 2*a[n-1]^2 -2]]; Table[a[n], {n, 9}] (* G. C. Greubel, Mar 04 2020 *)
PROG
(PARI) a(n) = if (n==1, 2, if (n % 2, 2*a(n-1)^2 - 2, 2*(a(n-1)+1)^2 - 1)); \\ Michel Marcus, Feb 20 2019
(Magma)
function a(n)
if n eq 1 then return 2;
elif n mod 2 eq 0 then return 2*(a(n-1) +1)^2 -1;
else return 2*(a(n-1)^2 -1);
end if; return a; end function;
[a(n): n in [1..9]]; // G. C. Greubel, Mar 04 2020
(Sage)
@CachedFunction
def a(n):
if (n==1): return 2
elif (n%2==0): return 2*(a(n-1) +1)^2 -1
else: return 2*(a(n-1)^2 -1)
[a(n) for n in (1..9)] # G. C. Greubel, Mar 04 2020
CROSSREFS
Cf. A002193 (sqrt(2)), A001601.
Sequence in context: A367829 A172341 A356502 * A062710 A012939 A013094
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Christian G. Bower, Jan 06 2006
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 27 09:47 EDT 2024. Contains 374647 sequences. (Running on oeis4.)