login
Totally additive with a(prime(k)) = A001223(k), where A001223 gives the distance from the k-th prime to the next larger prime.
5

%I #11 Apr 05 2022 17:07:36

%S 0,1,2,2,2,3,4,3,4,3,2,4,4,5,4,4,2,5,4,4,6,3,6,5,4,5,6,6,2,5,6,5,4,3,

%T 6,6,4,5,6,5,2,7,4,4,6,7,6,6,8,5,4,6,6,7,4,7,6,3,2,6,6,7,8,6,6,5,4,4,

%U 8,7,2,7,6,5,6,6,6,7,4,6,8,3,6,8,4,5,4,5,8,7,8,8,8,7,6,7,4,9,6,6,2,5,4,7,8

%N Totally additive with a(prime(k)) = A001223(k), where A001223 gives the distance from the k-th prime to the next larger prime.

%H Antti Karttunen, <a href="/A347102/b347102.txt">Table of n, a(n) for n = 1..65537</a>

%H <a href="/index/Pri#gaps">Index entries for primes, gaps between</a>

%F a(n) = A001414(A003961(n)) - A001414(n).

%F a(n) = A007814(n) + 2*A056239(A064989(A347123(n))).

%F For all n >= 0, a(2^n) = n.

%e For n = 12 = 2*2*3, the corresponding prime gaps are 1, 1 and 2, thus a(12) = 1+1+2 = 4.

%e For n = 42 = 2*3*7, the corresponding prime gaps are 1, 2 and 4, thus a(42) = 1+2+4 = 7.

%o (PARI) A347102(n) = { my(f=factor(n), s=0); for(i=1, #f~, s += f[i, 2]*(nextprime(f[i, 1]+1)-f[i,1])); (s); };

%Y Cf. A001223, A001414, A003961, A007814, A056239, A064989, A347101, A347123.

%K nonn

%O 1,3

%A _Antti Karttunen_, Aug 19 2021