login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Vincenzo Librandi, Table of n, a(n) for n = 1..2000 (first 945 terms from Alec Jones)

Index entries for linear recurrences with constant coefficients, signature (0,0,2,0,0,-1).

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: A295260 A256187 A251045 * A296659 A270823 A067627

Adjacent sequences:  A271563 A271564 A271565 * A271567 A271568 A271569

KEYWORD

nonn,easy

AUTHOR

Alec Jones, Apr 12 2016

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified February 23 00:03 EST 2018. Contains 299472 sequences. (Running on oeis4.)