[go: up one dir, main page]

login
A260737
Sum of Hamming distances between binary representations of prime factors of n, summed over all nonordered pairs of primes present (with multiplicity) in the prime factorization of n.
4
0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 2, 0, 2, 2, 0, 0, 2, 0, 6, 1, 2, 0, 3, 0, 4, 0, 4, 0, 6, 0, 0, 1, 3, 1, 4, 0, 2, 3, 9, 0, 4, 0, 4, 4, 3, 0, 4, 0, 6, 2, 8, 0, 3, 3, 6, 1, 5, 0, 10, 0, 4, 2, 0, 1, 4, 0, 6, 2, 6, 0, 6, 0, 4, 4, 4, 2, 8, 0, 12, 0, 4, 0, 7, 2, 3, 4, 6, 0, 9, 2, 6, 3, 4, 3, 5, 0, 4, 2, 12, 0, 6, 0, 12, 4, 5, 0, 6, 0, 8, 3, 8, 0, 4, 2, 10, 6, 4, 3, 14
OFFSET
1,10
LINKS
EXAMPLE
For n = 1 the prime factorization is empty, thus there is nothing to sum, so a(1) = 0.
For n = 6 = 2*3, a(6) = 1 because the Hamming distance between 2 and 3 is 1 as 2 = "10" in binary and 3 = "11" in binary.
For n = 10 = 2*5, a(10) = 3 because the Hamming distance between 2 and 5 is 3 as 2 = "10" in binary (extended with a leading zero to make it "010") and 5 = "101" in binary.
For n = 12 = 2*2*3, a(12) = 2 because the Hamming distance between 2 and 3 is 1, and the pair (2,3) occurs twice as one can pick either one of the two 2's present in the prime factorization to be a pair of a single 3. Note that the Hamming distance between 2 and 2 is 0, thus the pair (2,2) of prime divisors does not contribute to the sum.
For n = 36 = 2*2*3*3, a(36) = 4 because the Hamming distance between 2 and 3 is 1, and the prime factor pair (2,3) occurs four times in total. Note that the Hamming distance is zero between 2 and 2 as well as between 3 and 3, thus the pairs (2,2) and (3,3) do not contribute to the sum.
PROG
(Scheme, with Aubrey Jaffer's SLIB Scheme library)
(require 'factor)
(define (A260737 n) (let loop ((s 0) (pfs (factor n))) (cond ((or (null? pfs) (null? (cdr pfs))) s) (else (loop (fold-left (lambda (a p) (+ a (A101080bi (car pfs) p))) s (cdr pfs)) (cdr pfs))))))
CROSSREFS
Cf. A101080.
Cf. A000961 (positions of the zeros), A261077 (positions of the ones).
Cf. also A261079.
Sequence in context: A353461 A161970 A230446 * A059339 A241181 A171772
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Sep 22 2015
STATUS
approved