1,2

a(n) = A001969(n) - n + 1 for n >= 2. - Jaroslav Krizek, Jun 13 2009

The sequence is a quasi-inverse of A161560: For n >= 2, a(A161560(n+1)+1) = n or n-1. - Jaroslav Krizek, Jun 13 2009, corrected Jul 13 2012

Table of n, a(n) for n=1..65.

a(5) = 5 because the fifth evil number = 9 and floor(9/2 + 1/2) = 5.

(PARI) a(n)=(2*n+hammingweight(n-1)%2-1)\2 \\ Charles R Greathouse IV, Mar 22 2013

Cf. A001969, A000069.

Sequence in context: A227065 A010761 A161172 * A238527 A146071 A167411

Adjacent sequences: A093502 A093503 A093504 * A093506 A093507 A093508

easy,nonn

Michael Joseph Halm, May 13 2004

Corrected and edited by Jaroslav Krizek, Jun 13 2009

approved