A244472 2nd-largest term in n-th row of Stern's diatomic triangle A002487.
1, 2, 4, 7, 12, 19, 31, 50, 81, 131, 212, 343, 555, 898, 1453, 2351, 3804, 6155, 9959, 16114, 26073, 42187, 68260, 110447, 178707, 289154, 467861, 757015, 1224876, 1981891, 3206767, 5188658, 8395425, 13584083, 21979508, 35563591, 57543099
Offset: 1
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).
Programs
-
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
-
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 *)
-
PARI
Vec(-x*(x^4+x^3+x^2+x+1)/(x^2+x-1) + O(x^100)) \\ Colin Barker, Jul 10 2015
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