login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A246552
2-adic valuation of the number of involutions of n (A000085).
2
0, 0, 1, 2, 1, 1, 2, 3, 2, 2, 3, 4, 3, 3, 4, 5, 4, 4, 5, 6, 5, 5, 6, 7, 6, 6, 7, 8, 7, 7, 8, 9, 8, 8, 9, 10, 9, 9, 10, 11, 10, 10, 11, 12, 11, 11, 12, 13, 12, 12, 13, 14, 13, 13, 14, 15, 14, 14, 15, 16, 15, 15, 16, 17, 16, 16, 17, 18, 17, 17, 18, 19, 18, 18, 19, 20, 19, 19, 20, 21, 20, 20, 21, 22, 21, 21, 22, 23, 22, 22, 23
OFFSET
0,4
FORMULA
a(n) = a(n-1) + a(n-4) - a(n-5).
G.f.: x^2*(1+x-x^2)/((1-x)^2*(1+x)*(1+x^2)).
a(n) = (3 - (-1)^n - (1+3*i)*(-i)^n - (1-i*3)*i^n + 2*n)/8 where i=sqrt(-1). - Colin Barker, Oct 16 2015
a(n) = (2*n+3-2*cos(n*Pi/2)-cos(n*Pi)-6*sin(n*Pi/2))/8. - Wesley Ivan Hurt, Oct 01 2017
a(n) = n - 2*floor(n/4) - floor((n+3)/4). - Ridouane Oudra, Dec 11 2023
MAPLE
seq(n-2*floor(n/4)-floor((n+3)/4), n=0..100) ; # Ridouane Oudra, Dec 11 2023
MATHEMATICA
CoefficientList[Series[x^2 (1 + x - x^2)/((1 - x)^2 (1 + x) (1 + x^2)), {x, 0, 100}], x] (* Vincenzo Librandi, Sep 06 2014 *)
LinearRecurrence[{1, 0, 0, 1, -1}, {0, 0, 1, 2, 1}, 100] (* Harvey P. Dale, Jun 13 2016 *)
PROG
(PARI) N=166; x='x+O('x^N);
v=Vec(serlaplace(exp(x+x^2/2)));
vector(#v, n, valuation(v[n], 2))
(PARI) concat([0, 0], Vec(x^2*(1+x-x^2)/((1-x)^2*(1+x)*(1+x^2))+O(x^166)))
(Magma) I:=[0, 0, 1, 2, 1]; [n le 5 select I[n] else Self(n-1)+Self(n-4)-Self(n-5): n in [1..100]]; // Vincenzo Librandi, Sep 06 2014
(PARI) a(n) = (3 - (-1)^n - (1+3*I)*(-I)^n - (1-I*3)*I^n + 2*n)/8 \\ Colin Barker, Oct 16 2015
CROSSREFS
Cf. A000085 (involutions).
Cf. A011371 (2-adic valuation of n!), A007814 (2-adic valuation of derangements (A000166)).
Sequence in context: A144021 A334591 A177962 * A161091 A027347 A352131
KEYWORD
nonn,easy
AUTHOR
Joerg Arndt, Sep 06 2014
STATUS
approved