A118286 Numbers n such that n == 0 (mod 4) or n == 2 (mod 12).
2, 4, 8, 12, 14, 16, 20, 24, 26, 28, 32, 36, 38, 40, 44, 48, 50, 52, 56, 60, 62, 64, 68, 72, 74, 76, 80, 84, 86, 88, 92, 96, 98, 100, 104, 108, 110, 112, 116, 120, 122, 124, 128, 132, 134, 136, 140, 144, 146, 148, 152, 156, 158, 160, 164, 168, 170, 172, 176, 180, 182
Offset: 1
Links
- Guenther Schrack, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Colin Barker)
- Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1).
Programs
-
GAP
Filtered([1..190],n->n mod 4=0 or n mod 12=2); # Muniru A Asiru, Feb 22 2019
-
Magma
[Round((3*n-1) + (Sqrt(-1))^n*(1+(-1)^n)/2): n in [1..70]]; // G. C. Greubel, Feb 21 2019
-
Maple
select(n->modp(n,4)=0 or modp(n,12)=2,[$1..190]); # Muniru A Asiru, Feb 22 2019
-
Mathematica
Union[4*Range[50], 2+12*Range[16]]
-
PARI
a(n) = (-2+(-I)^n+I^n+6*n)/2 \\ Colin Barker, Oct 19 2015
-
PARI
Vec(2*x*(1+2*x^2)/((1+x^2)*(1-x)^2) + O(x^70)) \\ Colin Barker, Oct 19 2015
-
PARI
for(n=1, 1e3, if(n%4 == 0 || n%12 == 2, print1(n", "))) \\ Altug Alkan, Oct 19 2015
-
Sage
[(3*n-1) + I^n*(1+(-1)^n)/2 for n in (1..70)] # G. C. Greubel, Feb 21 2019
Formula
G.f.: 2*x*(1+2*x^2) / ( (1+x^2)*(1-x)^2 ). - R. J. Mathar, Dec 02 2011
a(n) = 2*A047237(n+1) = 3*n - 1 + cos(n*Pi/2). - R. J. Mathar, Dec 02 2011
a(n) = (-2 + (-i)^n + i^n + 6*n)/2, where i = sqrt(-1). - Colin Barker, Oct 19 2015
a(n) = (6*n - 2 + (1 + (-1)^n)*(-1)^(n*(n-1)/2))/2. - Guenther Schrack, Feb 21 2019
E.g.f.: cos(x) + (3*x-1)*exp(x). - G. C. Greubel, Feb 21 2019
Comments