login
Let u(1)=u(2)=u(3)=2, u(n)=(1+u(n-1)u(n-2))/u(n-3); then a(n) is the numerator of u(n).
2

%I #41 Aug 04 2022 05:20:58

%S 2,2,2,5,3,17,11,65,43,257,171,1025,683,4097,2731,16385,10923,65537,

%T 43691,262145,174763,1048577,699051,4194305,2796203,16777217,11184811,

%U 67108865,44739243,268435457,178956971,1073741825,715827883,4294967297

%N Let u(1)=u(2)=u(3)=2, u(n)=(1+u(n-1)u(n-2))/u(n-3); then a(n) is the numerator of u(n).

%H Robert Israel, <a href="/A076737/b076737.txt">Table of n, a(n) for n = 1..1000</a>

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,5,0,-4).

%F For n>4, a(n) = 2^A028242(n-4)*u(n); u(2n) = 2^(n-1)+1/2^n hence a(2n) = 4^(n-1)+1.

%F From _Michael Somos_ (via _Benoit Cloitre_), Nov 29 2002: (Start)

%F a(1)=a(2)=a(3)=2, a(n+2) = (1+2^n)/(1+2*(n mod 2)).

%F For k>=2, a(2k+1) = A001045(2k-1). (End)

%F Empirical g.f.: x*(4*x^6+x^4-5*x^3-8*x^2+2*x+2) / ((x-1)*(x+1)*(2*x-1)*(2*x+1)). - _Colin Barker_, Oct 14 2014

%F This follows from the Somos formula for a(n+2). - _Robert Israel_, Aug 10 2015

%F a(1)=a(2)=a(3)=2 and, for n>3, a(n) = denominator(1/2+6/(4+2^n)). - _Gerry Martens_, Aug 10 2015

%F a(n) = H(n - 2, n mod 2, 1/2) for n >= 5 where H(n, a, b) -> hypergeom([a - n/2, b - n/2], [1 - n], -8). - _Peter Luschny_, Sep 03 2019

%p 2,2,2,seq(2/3+(1/6)*2^k+(1/12)*(-1)^k*2^k+(1/3)*(-1)^k,k=4..50); # _Robert Israel_, Aug 10 2015

%p H := (n, a, b) -> hypergeom([a - n/2, b - n/2], [1 - n], -8):

%p a := n -> `if`(n < 5, [2, 2, 2, 5][n], H(n-2, irem(n, 2), 1/2)):

%p seq(simplify(a(n)), n=1..34); # _Peter Luschny_, Sep 03 2019

%t nxt[{a_,b_,c_}]:={b,c,(1+b c)/a}; NestList[nxt,{2,2,2},40][[All,1]]// Numerator (* _Harvey P. Dale_, Oct 31 2021 *)

%Y Cf. A005246, A076736 (denominator of u(n)).

%K nonn,frac

%O 1,1

%A _Benoit Cloitre_, Nov 24 2002