A330944 Number of nonprime prime indices of n.
0, 1, 0, 2, 0, 1, 1, 3, 0, 1, 0, 2, 1, 2, 0, 4, 0, 1, 1, 2, 1, 1, 1, 3, 0, 2, 0, 3, 1, 1, 0, 5, 0, 1, 1, 2, 1, 2, 1, 3, 0, 2, 1, 2, 0, 2, 1, 4, 2, 1, 0, 3, 1, 1, 0, 4, 1, 2, 0, 2, 1, 1, 1, 6, 1, 1, 0, 2, 1, 2, 1, 3, 1, 2, 0, 3, 1, 2, 1, 4, 0, 1, 0, 3, 0, 2, 1
Offset: 1
Examples
24 has prime indices {1,1,1,2}, of which {1,1,1} are nonprime, so a(24) = 3.
Crossrefs
Programs
-
Mathematica
Table[Total[Cases[If[n==1,{},FactorInteger[n]],{p_,k_}/;!PrimeQ[PrimePi[p]]:>k]],{n,30}]
-
PARI
a(n) = my(f=factor(n)); sum(k=1, #f~, if(!isprime(primepi(f[k,1])), f[k,2], 0)); \\ Daniel Suteu, Jan 14 2020
Formula
Additive with a(p^e) = e if primepi(p) is nonprime, and 0 otherwise. - Amiram Eldar, Nov 03 2023
Comments