OFFSET
1,2
COMMENTS
"Polyrhythmic Sequence" P(2,3): numbers congruent to 1 (mod 2) and 1 (mod 3). (See A267027 for definition and description.) - Bob Selcoe, Jan 12 2016
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1).
FORMULA
From R. J. Mathar, Oct 08 2011: (Start)
a(n) = 3*n/2 - 1/2 - cos(Pi*n/2)/2.
G.f.: x*(x^3+x+1)/((x-1)^2*(x^2+1)). (End)
a(n) = (-2 - (-i)^n - i^n + 6n)/4, with i=sqrt(-1). - Colin Barker, Oct 19 2015
From Wesley Ivan Hurt, May 31 2016: (Start)
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) for n>4.
Sum_{n>=1} (-1)^(n+1)/a(n) = 5*sqrt(3)*Pi/36 - log(2)/3 + log(3)/4. - Amiram Eldar, Dec 17 2021
MAPLE
MATHEMATICA
Select[Range[0, 200], MemberQ[{1, 3, 4, 5}, Mod[#, 6]] &] (* Vincenzo Librandi, Jan 12 2016 *)
LinearRecurrence[{2, -2, 2, -1}, {1, 3, 4, 5}, 70] (* Harvey P. Dale, Feb 27 2024 *)
PROG
(PARI) a(n) = (-2-(-I)^n-I^n+6*n)/4 \\ Colin Barker, Oct 19 2015
(PARI) Vec(x*(x^3+x+1)/((x-1)^2*(x^2+1)) + O(x^100)) \\ Colin Barker, Oct 19 2015
(Magma) [n: n in [0..150]|n mod 6 in {1, 3, 4, 5}]; // Vincenzo Librandi, Jan 12 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved