OFFSET
0,1
LINKS
EXAMPLE
For n = 4, 5, 6, 7, 8 the binary expansions are 100, 101, 110, 111, 1000 and the values of a(n) are respectively 0, 1, 0, 1, 0.
MATHEMATICA
Join[{0}, Array[BitGet[#, IntegerExponent[#, 2] + 2] &, 100]] (* Paolo Xausa, Apr 02 2024 *)
PROG
(PARI) a(n) = bittest(n, if(n, valuation(n, 2)+2)); \\ Kevin Ryde, Apr 07 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Dec 22 2003
EXTENSIONS
Corrected and extended by Douglas Gaut (dgaut(AT)ashland.edu), Apr 12 2004
STATUS
approved