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!)
A359832 a(n) = 1 if the 2-adic valuation of n is either 0 or odd, otherwise 0. 7
1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1
LINKS
FORMULA
Multiplicative with a(2^e) = 1 if e is odd, and 0 if e is even (and > 0), with a(p^e) = 1 for all odd primes p.
a(n) = 1 - A328981(n).
a(n) = A000035(n+A048675(n)).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 5/6. - Amiram Eldar, Jan 24 2023
MATHEMATICA
a[n_] := If[(e = IntegerExponent[n, 2]) == 0 || OddQ[e], 1, 0]; Array[a, 100] (* Amiram Eldar, Jan 24 2023 *)
PROG
(PARI) A359832(n) = (!(n=valuation(n, 2))||(n%2));
(PARI) A359832(n) = { my(f=factor(n)); prod(k=1, #f~, ((2!=f[k, 1]) || (f[k, 2]%2))); };
(Python)
def A359832(n): return (n&1)|((~n & n-1).bit_length()&1) # Chai Wah Wu, Jan 24 2023
CROSSREFS
Characteristic function of A359794.
Cf. A000035, A007814, A048675, A328981 (one's complement), A359833 (Dirichlet inverse).
Sequence in context: A129564 A317193 A293163 * A267871 A329678 A359942
KEYWORD
nonn,mult
AUTHOR
Antti Karttunen, Jan 24 2023
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 June 29 17:26 EDT 2024. Contains 373855 sequences. (Running on oeis4.)