login
A271566
a(n) is the length of the n-th run in A137734.
2
2, 3, 1, 1, 3, 1, 2, 4, 1, 3, 5, 1, 4, 6, 1, 5, 7, 1, 6, 8, 1, 7, 9, 1, 8, 10, 1, 9, 11, 1, 10, 12, 1, 11, 13, 1, 12, 14, 1, 13, 15, 1, 14, 16, 1, 15, 17, 1, 16, 18, 1, 17, 19, 1, 18, 20, 1, 19, 21, 1, 20, 22, 1, 21, 23, 1, 22, 24, 1, 23, 25
OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..2000 (first 945 terms from Alec Jones)
FORMULA
For n > 2: a(n) = 1 if 3 divides n; a(n) = (1/3)*(n-1) if n == 1 (mod 3); a(n) = a(n-1) + 2 if n == 2 (mod 3).
For n > 2, a(n) = (4*n + 12 + (6-4*n)*cos(2*n*Pi/3) - 5*sqrt(3)*sin(2*n*Pi/3) + 5*sqrt(3)*sin(4*n*Pi/3))/18. - Wesley Ivan Hurt, Sep 25 2017
From Colin Barker, Sep 26 2017: (Start)
G.f.: x*(2 + 3*x + x^2 - 3*x^3 - 3*x^4 - x^5 + 2*x^6 + x^7) / ((1 - x)^2*(1 + x + x^2)^2).
a(n) = 2*a(n-3) - a(n-6) for n>8. (End)
MATHEMATICA
Join[{2, 3}, LinearRecurrence[{0, 0, 2, 0, 0, -1}, {1, 1, 3, 1, 2, 4}, 200]] (* Vincenzo Librandi, Sep 27 2017 *)
PROG
(PARI) Vec(x*(2 + 3*x + x^2 - 3*x^3 - 3*x^4 - x^5 + 2*x^6 + x^7) / ((1 - x)^2*(1 + x + x^2)^2) + O(x^100)) \\ Colin Barker, Sep 26 2017
(Magma) I:=[2, 3, 1, 1, 3, 1, 2, 4]; [n le 8 select I[n] else 2*Self(n-3)-Self(n-6): n in [1..100]]; // Vincenzo Librandi, Sep 27 2017
CROSSREFS
Cf. A137734.
Sequence in context: A300521 A356152 A317627 * A296659 A270823 A067627
KEYWORD
nonn,easy
AUTHOR
Alec Jones, Apr 12 2016
STATUS
approved