login
A118286
Numbers n such that n == 0 (mod 4) or n == 2 (mod 12).
2
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,1
COMMENTS
Except for n=2, conjectured n such that A118278(n)=-1 and A118282(n)=-1; n such that there is an infinite set of numbers not representable as the sum of three n-gonal numbers or three generalized n-gonal numbers.
The difference between two consecutive terms follow the 4-period: (2, 4, 4, 2). - Bernard Schott, Feb 25 2019
LINKS
Guenther Schrack, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Colin Barker)
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
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]]
PROG
(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
(Magma) [Round((3*n-1) + (Sqrt(-1))^n*(1+(-1)^n)/2): n in [1..70]]; // G. C. Greubel, Feb 21 2019
(SageMath) [(3*n-1) + I^n*(1+(-1)^n)/2 for n in (1..70)] # G. C. Greubel, Feb 21 2019
(GAP) Filtered([1..190], n->n mod 4=0 or n mod 12=2); # Muniru A Asiru, Feb 22 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
T. D. Noe, Apr 23 2006
STATUS
approved