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.

A261079 Sum of index differences between prime factors of n, summed over all unordered pairs of primes present (with multiplicity) in the prime factorization of n.

This page as a plain text file.
%I A261079 #21 Jan 11 2023 08:47:21
%S A261079 0,0,0,0,0,1,0,0,0,2,0,2,0,3,1,0,0,2,0,4,2,4,0,3,0,5,0,6,0,4,0,0,3,6,
%T A261079 1,4,0,7,4,6,0,6,0,8,2,8,0,4,0,4,5,10,0,3,2,9,6,9,0,7,0,10,4,0,3,8,0,
%U A261079 12,7,6,0,6,0,11,2,14,1,10,0,8,0,12,0,10,4,13,8,12,0,6,2,16,9,14,5,5,0,6,6,8,0,12,0,15,4,15,0,6,0,8,10,12,0,14,6,18,8,16,3,10
%N A261079 Sum of index differences between prime factors of n, summed over all unordered pairs of primes present (with multiplicity) in the prime factorization of n.
%H A261079 Antti Karttunen, <a href="/A261079/b261079.txt">Table of n, a(n) for n = 1..10000</a>
%H A261079 <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a>
%F A261079 a(n) = A304818(n) - A318283(n). - _Gus Wiseman_, Jan 09 2023
%F A261079 a(n) = 2*A304818(n) - A359362(n). - _Gus Wiseman_, Jan 09 2023
%e A261079 For n = 1 the prime factorization is empty, thus there is nothing to sum, so a(1) = 0.
%e A261079 For n = 6 = 2*3 = prime(1) * prime(2), a(6) = 1 because the (absolute value of) difference between prime indices of 2 and 3 is 1.
%e A261079 For n = 10 = 2*5 = prime(1) * prime(3), a(10) = 2 because the difference between prime indices of 2 and 5 is 2.
%e A261079 For n = 12 = 2*2*3 = prime(1) * prime(1) * prime(2), a(12) = 2 because the difference between prime indices of 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 index difference between 2 and 2 is 0, thus the pair (2,2) of prime divisors does not contribute to the sum.
%e A261079 For n = 36 = 2*2*3*3, a(36) = 4 because the index difference between 2 and 3 is 1, and the prime factor pair (2,3) occurs 2^2 = four times in total. As the index difference is zero between 2 and 2 as well as between 3 and 3, the pairs (2,2) and (3,3) do not contribute to the sum.
%t A261079 Table[Function[p, Total@ Map[Function[b, Times @@ {First@ Differences@ PrimePi@ b, Count[Subsets[p, {2}], c_ /; SameQ[c, b]]}], Subsets[Union@ p, {2}]]][Flatten@ Replace[FactorInteger@ n, {p_, e_} :> ConstantArray[p, e], 2]], {n, 120}] (* _Michael De Vlieger_, Mar 08 2017 *)
%o A261079 (Scheme, with Aubrey Jaffer's SLIB Scheme library)
%o A261079 (require 'factor)
%o A261079 (define (A261079 n) (let loop ((s 0) (pfs (factor n))) (cond ((or (null? pfs) (null? (cdr pfs))) s) (else (loop (fold-left (lambda (a p) (+ a (abs (- (A000720 (car pfs)) (A000720 p))))) s (cdr pfs)) (cdr pfs))))))
%Y A261079 Cf. A000720.
%Y A261079 Cf. A000961 (positions of zeros), A006094 (positions of ones).
%Y A261079 Cf. A243055, A242411.
%Y A261079 Cf. also A260737.
%Y A261079 A055396 gives minimum prime index, maximum A061395.
%Y A261079 A112798 list prime indices, length A001222, sum A056239.
%Y A261079 A304818 adds up partial sums of reversed prime indices, row sums of A359361.
%Y A261079 A318283 adds up partial sums of prime indices, row sums of A358136.
%Y A261079 Cf. A029931, A316413, A325362, A326836, A326844, A355536, A358137, A359362.
%K A261079 nonn
%O A261079 1,10
%A A261079 _Antti Karttunen_, Sep 23 2015