A047262 Numbers that are congruent to {0, 2, 4, 5} mod 6.
0, 2, 4, 5, 6, 8, 10, 11, 12, 14, 16, 17, 18, 20, 22, 23, 24, 26, 28, 29, 30, 32, 34, 35, 36, 38, 40, 41, 42, 44, 46, 47, 48, 50, 52, 53, 54, 56, 58, 59, 60, 62, 64, 65, 66, 68, 70, 71, 72, 74, 76, 77, 78, 80, 82, 83, 84, 86, 88, 89, 90, 92, 94, 95, 96, 98
Offset: 1
Links
- G. C. Greubel, Table of n, a(n) for n = 1..10000
- Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1).
- Index entries for two-way infinite sequences.
Programs
-
Magma
[n : n in [0..100] | n mod 6 in [0, 2, 4, 5]]; // Wesley Ivan Hurt, May 21 2016
-
Maple
A047262:=n->(6*n-4-I^(1-n)+I^(1+n))/4: seq(A047262(n), n=1..100); # Wesley Ivan Hurt, May 21 2016
-
Mathematica
Select[Range[0,100], MemberQ[{0,2,4,5}, Mod[#,6]]&] (* or *) LinearRecurrence[{2,-2,2,-1}, {0,2,4,5}, 70] (* Harvey P. Dale, Dec 09 2015 *)
-
PARI
my(x='x+O('x^70)); concat([0], Vec(x^2*(2+x^2)/((1+x^2)*(1-x)^2))) \\ G. C. Greubel, Feb 16 2019
-
Sage
a=(x^2*(2+x^2)/((1+x^2)*(1-x)^2)).series(x, 72).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Feb 16 2019
Formula
From R. J. Mathar, Oct 08 2011: (Start)
G.f.: x^2*(2+x^2) / ( (1+x^2)*(1-x)^2 ).
a(n) = 3*n/2 - 1 - sin(Pi*n/2)/2. (End)
From Wesley Ivan Hurt, May 21 2016: (Start)
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) for n > 4.
a(n) = (6*n - 4 - i^(1-n) + i^(1+n))/4, where i = sqrt(-1).
From Guenther Schrack, Feb 14 2019: (Start)
a(n) = (6*n - 4 - (1 - (-1)^n)*(-1)^(n*(n-1)/2))/4.
a(n) = a(n-4) + 6, a(1)=0, a(2)=2, a(3)=4, a(4)=5, for n > 4. (End)
Sum_{n>=2} (-1)^n/a(n) = log(3)/4 + log(2)/3 - sqrt(3)*Pi/36. - Amiram Eldar, Dec 17 2021
Extensions
More terms from Wesley Ivan Hurt, May 21 2016
Comments