login
a(1) = 11; a(n) = if n == 2 mod 3 then a(n-1)-3, if n == 0 mod 3 then a(n-1)-2, if n == 1 mod 3 then a(n-1)*2.
3

%I #19 Mar 14 2020 17:44:09

%S 11,8,6,12,9,7,14,11,9,18,15,13,26,23,21,42,39,37,74,71,69,138,135,

%T 133,266,263,261,522,519,517,1034,1031,1029,2058,2055,2053,4106,4103,

%U 4101,8202,8199,8197,16394,16391,16389,32778,32775,32773,65546,65543,65541,131082

%N a(1) = 11; a(n) = if n == 2 mod 3 then a(n-1)-3, if n == 0 mod 3 then a(n-1)-2, if n == 1 mod 3 then a(n-1)*2.

%C Sequence (in reversed order) was given as a puzzle: find the next term after 18, 9, 11, 14, 7, 9, 12! Thanks to Farideh Firoozbakht and Zak Seidov for the solution.

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

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

%F a[1]=11; for k=>1, a[3k-1]=7+2^(3k-1), a[3k]=5+2^(3k-1), a[3k+1]=10+2^(3k). - _Zak Seidov_, Jul 24 2003

%F a(n) = 2^floor((n-1)/3) + floor(21/(((n-1) mod 3)+2)). - _Dean Hickerson_, Jul 24 2003

%F G.f. -x*(-11-8*x-6*x^2+21*x^3+15*x^4+11*x^5) / ( (x-1)*(2*x^3-1)*(1+x+x^2) ). - _R. J. Mathar_, Oct 20 2013

%p a := proc(n) option remember; if n=1 then 11 elif n mod 3 = 2 then a(n-1)-3 elif n mod 3 = 0 then a(n-1)-2 else a(n-1)*2; fi; end;

%t a[1] = 11; a[n_] := (3 - (-1)^mod[n, 3])/2*a[n - 1] - (1 + (-1)^mod[n, 3])/2* Floor[mod[n, 3]/2] - (-1)^mod[n, 3] - 1 (from _Farideh Firoozbakht_, Jul 23 2003)

%t nxt[{n_,a_}]:=Module[{c=Mod[n+1,3]},{n+1,Which[c==2,a-3,c==0,a-2,c==1, 2a]}]; NestList[nxt,{1,11},60][[All,2]] (* or *) LinearRecurrence[ {0,0,3,0,0,-2},{11,8,6,12,9,7},70] (* _Harvey P. Dale_, Mar 14 2020 *)

%K nonn

%O 1,1

%A _N. J. A. Sloane_, Jul 18 2003