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!)
A362951 a(n) is the Hamming distance between the binary expansions of n and phi(n) where phi is the Euler totient function (A000010). 1
0, 2, 1, 2, 1, 1, 1, 2, 4, 3, 1, 1, 1, 1, 3, 2, 1, 2, 1, 3, 3, 3, 1, 1, 3, 3, 2, 1, 1, 3, 1, 2, 4, 3, 5, 2, 1, 3, 6, 3, 1, 3, 1, 3, 4, 3, 1, 1, 4, 3, 3, 3, 1, 2, 5, 1, 4, 3, 1, 3, 1, 1, 4, 2, 4, 4, 1, 3, 4, 5, 1, 2, 1, 5, 4, 3, 4, 4, 1, 3, 5, 5, 1, 3, 3, 5, 6 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
a(2^k) = 2 for k >= 1.
a(p) = 1 for each odd prime p because phi(p) = p-1 and (p-1 xor p) = 1.
LINKS
FORMULA
a(n) = A101080(n,A000010(n)).
a(n) = A000120(A169814(n)).
MATHEMATICA
A362951[n_] := DigitCount[BitXor[n, EulerPhi[n]], 2, 1];
Array[A362951, 100] (* Paolo Xausa, Feb 20 2024 *)
PROG
(Python)
from gmpy2 import mpz, hamdist
from sympy import totient
a = lambda n: hamdist(mpz(n), mpz(totient(n)))
print([a(n) for n in range(1, 87)])
(Python)
from sympy import totient
def A362951(n): return (n^totient(n)).bit_count() # Chai Wah Wu, Jul 07 2023
CROSSREFS
Sequence in context: A088203 A205649 A176510 * A342464 A061342 A104639
KEYWORD
nonn,base,less
AUTHOR
Darío Clavijo, Jul 05 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 July 16 09:56 EDT 2024. Contains 374345 sequences. (Running on oeis4.)