%I #14 Sep 30 2023 21:56:28
%S 0,1,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,
%T 0,1,0,1,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,1,0,0,1,0,0,
%U 0,1,0,1,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,1,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,1,1,0,0
%N Number of distinct prime factors prime(k) of n such that prime(k)^k, but not prime(k)^(k+1) is a divisor of n.
%H Antti Karttunen, <a href="/A276935/b276935.txt">Table of n, a(n) for n = 1..10000</a>
%F a(1) = 0, for n > 1, a(n) = a(A028234(n)) + [A067029(n) = A055396(n)], where [] is Iverson bracket, giving 1 as its result when the stated equivalence is true and 0 otherwise.
%F From _Amiram Eldar_, Sep 30 2023: (Start)
%F Additive with a(p^e) = 1 if e = primepi(p), and 0 otherwise.
%F Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{k>=1} (1/prime(k)^k - 1/prime(k)^(k+1)) = 0.33083690651252383414... . (End)
%e For n = 12 = 2*2*3 = prime(1)^2 * prime(2)^1, neither of the prime factors satisfies the condition, thus a(12) = 0.
%e For n = 18 = 2*3*3 = prime(1)^1 * prime(2)^2, both prime factors satisfy the condition, thus a(18) = 1+1 = 2.
%e For n = 750 = 2*3*5*5*5 = prime(1)^1 * prime(2)^1 * prime(3)^3, only the prime factors 2 and 5 satisfy the condition, thus a(750) = 1+1 = 2.
%t f[p_, e_] := If[PrimePi[p] == e, 1, 0]; a[1] = 0; a[n_] := Plus @@ f @@@ FactorInteger[n]; Array[a, 100] (* _Amiram Eldar_, Sep 30 2023 *)
%o (Scheme, with _Antti Karttunen_'s IntSeq-library)
%o (definec (A276935 n) (if (= 1 n) 0 (+ (A276935 (A028234 n)) (if (= (A067029 n) (A055396 n)) 1 0))))
%o (PARI) a(n) = {my(f = factor(n)); sum(i = 1, #f~, primepi(f[i,1]) == f[i,2]);} \\ _Amiram Eldar_, Sep 30 2023
%Y Cf. A276077, A276936.
%K nonn,easy
%O 1,18
%A _Antti Karttunen_, Sep 24 2016