OFFSET
1,2
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Jennifer Lansing, Largest Values for the Stern Sequence, J. Integer Seqs., 17 (2014), #14.7.5.
Index entries for linear recurrences with constant coefficients, signature (1,1).
FORMULA
a(n) = A013655(n-1), n>3.
a(n) = a(n-1)+a(n-2), n>5. - Colin Barker, Jul 10 2015
G.f.: -x*(x^4+x^3+x^2+x+1) / (x^2+x-1). - Colin Barker, Jul 10 2015
MAPLE
A244472 := proc(n)
if n < 4 then
op(n, [1, 2, 4]) ;
else
combinat[fibonacci](n+2)-combinat[fibonacci](n-3) ;
end if;
end proc:
seq(A244472(n), n=1..50) ; # R. J. Mathar, Jul 05 2014
MATHEMATICA
CoefficientList[Series[-(x^4 + x^3 + x^2 + x + 1)/(x^2 + x - 1), {x, 0, 50}], x] (* Wesley Ivan Hurt, Jul 10 2015 *)
Join[{1, 2, 4}, LinearRecurrence[{1, 1}, {7, 12}, 50]] (* Vincenzo Librandi, Jul 11 2015 *)
PROG
(PARI) Vec(-x*(x^4+x^3+x^2+x+1)/(x^2+x-1) + O(x^100)) \\ Colin Barker, Jul 10 2015
(Magma) I:=[1, 2, 4, 7, 12]; [n le 5 select I[n] else Self(n-1)+Self(n-2): n in [1..40]]; // Wesley Ivan Hurt, Jul 10 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jul 01 2014
STATUS
approved