login
A180713
If n is even then a(n) = 3n, if n == 1 mod 4 then a(n) = 3n+1, if n == 3 mod 4 then a(n) = 3n+2.
1
0, 4, 6, 11, 12, 16, 18, 23, 24, 28, 30, 35, 36, 40, 42, 47, 48, 52, 54, 59, 60, 64, 66, 71, 72, 76, 78, 83, 84, 88, 90, 95, 96, 100, 102, 107, 108, 112, 114, 119, 120, 124, 126, 131, 132, 136, 138, 143, 144, 148, 150, 155, 156, 160, 162, 167, 168, 172, 174, 179, 180, 184, 186, 191, 192, 196, 198, 203, 204
OFFSET
0,2
FORMULA
From Bruno Berselli, Jan 23 2011: (Start)
G.f.: x*(4+2*x+5*x^2+x^3)/((1-x)*(1-x^4)).
a(n) = (12*n+i*(i^n-(-i)^n)-3*(-1)^n+3)/4, where i is the imaginary unit.
a(n) = A131743(n) + 3*n. (End)
a(n) = +1*a(n-1)+1*a(n-4)-1*a(n-5) for n>=5. [Joerg Arndt, Jan 25 2011]
MAPLE
U:=n->if n mod 2 = 0 then 3*n elif n mod 4 = 1 then 3*n+1 else 3*n+2; fi;
MATHEMATICA
fn[n_]:=Which[EvenQ[n], 3n, Mod[n, 4]==1, 3n+1, Mod[n, 4]==3, 3n+2]; Array[fn, 70, 0] (* Harvey P. Dale, May 03 2013 *)
CoefficientList[Series[x (4 + 2 x + 5 x^2 + x^3) / ((1 - x) (1 - x^4)), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 19 2013 *)
CROSSREFS
A variant of A006368.
Sequence in context: A013018 A031271 A369329 * A126591 A031452 A185868
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jan 21 2011
EXTENSIONS
Definition corrected by N. J. A. Sloane, Jan 23 2011
STATUS
approved