OFFSET
1,18
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
FORMULA
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.
From Amiram Eldar, Sep 30 2023: (Start)
Additive with a(p^e) = 1 if e = primepi(p), and 0 otherwise.
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)
EXAMPLE
For n = 12 = 2*2*3 = prime(1)^2 * prime(2)^1, neither of the prime factors satisfies the condition, thus a(12) = 0.
For n = 18 = 2*3*3 = prime(1)^1 * prime(2)^2, both prime factors satisfy the condition, thus a(18) = 1+1 = 2.
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.
MATHEMATICA
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 *)
PROG
(Scheme, with Antti Karttunen's IntSeq-library)
(PARI) a(n) = {my(f = factor(n)); sum(i = 1, #f~, primepi(f[i, 1]) == f[i, 2]); } \\ Amiram Eldar, Sep 30 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Antti Karttunen, Sep 24 2016
STATUS
approved