login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A341389 Characteristic function of A158705, nonnegative integers with an odd number of even powers of 2 in their base-2 representation. 6
0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
0
LINKS
FORMULA
a(2n+1) = 1 - a(floor(n/2)) for n >= 0.
a(2n) = a(floor(n/2)) for n > 0 with a(0) = 0.
a(n) = (-1)^n*a(floor(n/4)) + n mod 2 for n > 0 with a(0) = 0.
a(n) = A000035(A139351(n)). - Antti Karttunen, Feb 10 2021
MATHEMATICA
Array[Mod[Total@ IntegerDigits[#, 4], 2] &, 105, 0] (* Michael De Vlieger, Mar 17 2021 *)
PROG
(PARI) A341389(n) = { my(c=0); while(n, c += (n%2); n >>= 2); (c%2); }; \\ Antti Karttunen, Feb 10 2021
(PARI) a(n) = sumdigits(n, 4) % 2; \\ Kevin Ryde, Feb 14 2021
CROSSREFS
Cf. A000035, A139351, A158704 (positions of zeros), A158705 (of ones).
Cf. A112539 (complement), A112865 (as +-1).
Sequence in context: A269027 A089809 A165211 * A188027 A359333 A193496
KEYWORD
nonn,changed
AUTHOR
Mikhail Kurkov, Feb 10 2021 [verification needed]
EXTENSIONS
Terms corrected by Antti Karttunen, Feb 10 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 10:11 EDT 2024. Contains 371935 sequences. (Running on oeis4.)