cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A260737 #21 Sep 24 2015 01:38:05
%S A260737 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,
%T A260737 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,
%U A260737 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
%N 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.
%H A260737 Antti Karttunen, <a href="/A260737/b260737.txt">Table of n, a(n) for n = 1..10000</a>
%e A260737 For n = 1 the prime factorization is empty, thus there is nothing to sum, so a(1) = 0.
%e A260737 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.
%e A260737 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.
%e A260737 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.
%e A260737 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.
%o A260737 (Scheme, with Aubrey Jaffer's SLIB Scheme library)
%o A260737 (require 'factor)
%o A260737 (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))))))
%Y A260737 Cf. A101080.
%Y A260737 Cf. A000961 (positions of the zeros), A261077 (positions of the ones).
%Y A260737 Cf. A072594, A072595, A235488.
%Y A260737 Cf. also A261079.
%K A260737 nonn,base
%O A260737 1,10
%A A260737 _Antti Karttunen_, Sep 22 2015