|
|
A087503
|
|
a(n) = 3(a(n-2) + 1), with a(0) = 1, a(1) = 3.
|
|
13
|
|
|
1, 3, 6, 12, 21, 39, 66, 120, 201, 363, 606, 1092, 1821, 3279, 5466, 9840, 16401, 29523, 49206, 88572, 147621, 265719, 442866, 797160, 1328601, 2391483, 3985806, 7174452, 11957421, 21523359, 35872266, 64570080, 107616801, 193710243
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
FORMULA
|
G.f.: g(x) = (1+2x)/((1-3x^2)(1-x)).
a(n) = (3/2)*(3^((n+1)/2)-1) if n is odd, else a(n) = (3/2)*(5*3^((n-2)/2)-1).
a(n) = (3/2)*(3^floor((n+1)/2) + 3^floor(n/2) - 3^floor((n-1)/2)-1).
a(n) = 3^floor((n+1)/2) + 3^floor((n+2)/2)/2 - 3/2.
a(n) = A132667(a(n-1) + 1) for n > 0.
A132667(a(n)) = a(n-1) + 1 for n > 0.
Also numbers such that: a(0)=1, a(n) = a(n-1) + (p-1)*p^((n+1)/2 - 1) if n is odd, else a(n) = a(n-1) + p^(n/2), where p=3.
(End)
|
|
MAPLE
|
option remember;
if n <=1 then
op(n+1, [1, 3]) ;
else
3*procname(n-2)+3 ;
end if;
end proc:
|
|
MATHEMATICA
|
RecurrenceTable[{a[0]==1, a[1]==3, a[n]==3(a[n-2]+1)}, a, {n, 40}] (* or *) LinearRecurrence[{1, 3, -3}, {1, 3, 6}, 40] (* Harvey P. Dale, Jan 01 2015 *)
|
|
PROG
|
(Magma) [(3/2)*(3^Floor((n+1)/2)+3^Floor(n/2)-3^Floor((n-1)/2)-1): n in [0..40]]; // Vincenzo Librandi, Aug 16 2011
|
|
CROSSREFS
|
See A133629 for general formulas with respect to the recurrence rule parameter p.
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
Edited by N. J. A. Sloane, May 04 2010. I merged two essentially identical entries with different offsets, so some of the formulas may need to be adjusted.
|
|
STATUS
|
approved
|
|
|
|