login
'Geobonnaci' sequence: a(1)=a(2)=1, thereafter a(n) = round( 2 * sqrt(a(n-1) * a(n-2)) ).
1

%I #33 Dec 04 2024 16:46:02

%S 1,1,2,3,5,8,13,20,32,51,81,129,204,324,514,816,1295,2056,3263,5180,

%T 8222,13052,20718,32888,52206,82872,131551,208824,331488,526204,

%U 835297,1325951,2104816,3341187,5303804,8419264,13364749,21215216,33677057,53458995

%N 'Geobonnaci' sequence: a(1)=a(2)=1, thereafter a(n) = round( 2 * sqrt(a(n-1) * a(n-2)) ).

%C Named because each term is the nearest integer to twice the geometric mean of the previous two terms. This is similar to the Fibonacci sequence, where each term is twice the arithmetic mean of the previous two terms. In fact, the early terms mirror the Fibonacci sequence.

%H Harvey P. Dale, <a href="/A322332/b322332.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) ~ c * 2^(2*n/3), where c = 0.50182724761947676453167569419757096890286053854137516239835895319268638286015... - _Vaclav Kotesovec_, Dec 20 2018

%e For n=6, a(5) is 5 and a(4) is 3. 3 * 5 is 15 and twice the square root of 15 is just above 7.745. This rounds to 8, so a(6) is 8.

%p a:=proc(n) option remember: `if`(n<3,1,round(2*sqrt(a(n-1)*a(n-2)))) end: seq(a(n),n=1..50); # _Muniru A Asiru_, Dec 20 2018

%t a[1] =1 ; a[2] = 1; a[n_] := a[n] = Round[2 * Sqrt[a[n-1] * a[n-2]]]; Array[a, 40] (* _Amiram Eldar_, Dec 04 2018 *)

%t nxt[{a_,b_}]:={b,Round[2*Sqrt[a*b]]}; NestList[nxt,{1,1},40][[;;,1]] (* _Harvey P. Dale_, Dec 04 2024 *)

%o (PARI) seq(n)={my(v=vector(n)); v[1]=v[2]=1; for(n=3, n, v[n]=round(2*sqrt(v[n-1]*v[n-2]))); v} \\ _Andrew Howroyd_, Dec 03 2018

%o (Java) public static int G(int n) {

%o if(n==1) {return 1;}

%o if(n==2) {return 1;}

%o return Math.round(2*Math.sqrt(G(n-1)*G(n-2))); //Recursive definition

%o } \\ _James E Davis_, Dec 03 2018

%K nonn

%O 1,3

%A _James E Davis_, Dec 03 2018