A047251 Numbers that are congruent to {1, 3, 4, 5} (mod 6).
1, 3, 4, 5, 7, 9, 10, 11, 13, 15, 16, 17, 19, 21, 22, 23, 25, 27, 28, 29, 31, 33, 34, 35, 37, 39, 40, 41, 43, 45, 46, 47, 49, 51, 52, 53, 55, 57, 58, 59, 61, 63, 64, 65, 67, 69, 70, 71, 73, 75, 76, 77, 79, 81, 82, 83, 85, 87, 88, 89, 91, 93, 94, 95, 97, 99
Offset: 1
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).
Programs
-
Magma
[n: n in [0..150]|n mod 6 in {1,3,4,5}]; // Vincenzo Librandi, Jan 12 2016
-
Maple
A047251:=n->(-2-(-I)^n-I^n+6*n)/4: seq(A047251(n), n=1..100); # Wesley Ivan Hurt, May 31 2016
-
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 *)
-
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
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
Comments