OFFSET
1,105
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..100000
FORMULA
EXAMPLE
For n = 45 = 3^2 * 5, there exists one twin prime pair (3,5) whose both members divide 45, thus a(45) = 1.
For n = 105 = 3 * 5 * 7, there exists two twin prime pairs, (3,5) and (5,7) whose both members divide 105, thus a(105) = 2.
MATHEMATICA
f[p_, n_] := If[PrimeQ[p + 2] && Divisible[n, p*(p + 2)], 1, 0]; a[n_] := Plus @@ (f[#, n] & /@ FactorInteger[n][[;; , 1]]); Array[a, 105] (* Amiram Eldar, Dec 16 2018 *)
PROG
(PARI) A322358(n) = { my(ps=factor(n)[, 1]~); sum(i=1, #ps, isprime(ps[i]+2)*!(n%(ps[i]+2))); };
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 16 2018
STATUS
approved