login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A284203
Number of twin prime (A001097) divisors of n.
2
0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 1, 0, 1, 1, 1, 1, 1, 1, 2, 1, 0, 2, 1, 2, 1, 0, 1, 2, 1, 1, 2, 1, 1, 2, 0, 0, 1, 1, 1, 2, 1, 0, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 0, 2, 2, 0, 1, 1, 2, 1, 1, 1, 0, 2, 1, 2, 2, 0, 1, 1, 1, 0, 2, 2, 1, 2, 1, 0, 2, 2, 0, 2, 0, 2, 1, 0, 1, 2, 1, 1, 2, 1, 1, 3, 0, 1, 1, 1, 2
OFFSET
1,15
LINKS
Eric Weisstein's World of Mathematics, Twin Primes.
FORMULA
G.f.: Sum_{k>=1} x^A001097(k)/(1 - x^A001097(k)).
a(A062729(n)) = 0. - Ilya Gutkovskiy, Apr 02 2017
From Amiram Eldar, Jun 03 2024: (Start)
a(A048599(n)) = n.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A065421 - 1/5 = 1.7021605... . (End)
EXAMPLE
--------------------------------------------
| n | divisors of n | twin prime | a(n) |
| | | divisors of n | |
|------------------------------------------
| 1 | {1} | {-} | 0 |
| 2 | {1, 2} | {-} | 0 |
| 3 | {1, 3} | {3} | 1 |
| 4 | {1, 2, 4} | {-} | 0 |
| 5 | {1, 5} | {5} | 1 |
| 6 | {1, 2, 3, 6} | {3} | 1 |
| 7 | {1, 7} | {7} | 1 |
| 8 | {1, 2, 4, 8} | {-} | 0 |
| 9 | {1, 3, 9} | {3} | 1 |
--------------------------------------------
MATHEMATICA
nmax = 110; Rest[CoefficientList[Series[Sum[Boole[PrimeQ[k] && (PrimeQ[k - 2] || PrimeQ[k + 2])] x^k/(1 - x^k), {k, 1, nmax}], {x, 0, nmax}], x]]
Table[Length[Select[Divisors[n], PrimeQ[#] && (PrimeQ[# - 2] || PrimeQ[# + 2]) &]], {n, 110}]
PROG
(PARI) concat([0, 0], Vec(sum(k=1, 110, (isprime(k) && (isprime(k - 2) || isprime(k + 2)))* x^k/(1 - x^k)) + O(x^111))) \\ Indranil Ghosh, Mar 22 2017
(PARI) a(n) = sumdiv(n, d, isprime(d) && (isprime(d-2) || isprime(d+2))); \\ Amiram Eldar, Jun 03 2024
(Python)
from sympy import isprime, divisors
print([len([i for i in divisors(n) if isprime(i) and (isprime(i - 2) or isprime(i + 2))]) for n in range(1, 111)]) # Indranil Ghosh, Mar 22 2017
CROSSREFS
Cf. A048599 (positions of records).
Sequence in context: A282355 A199322 A351567 * A375106 A341594 A368774
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Mar 22 2017
STATUS
approved