A284599 Sum of twin prime (A001097) divisors of n.
0, 0, 3, 0, 5, 3, 7, 0, 3, 5, 11, 3, 13, 7, 8, 0, 17, 3, 19, 5, 10, 11, 0, 3, 5, 13, 3, 7, 29, 8, 31, 0, 14, 17, 12, 3, 0, 19, 16, 5, 41, 10, 43, 11, 8, 0, 0, 3, 7, 5, 20, 13, 0, 3, 16, 7, 22, 29, 59, 8, 61, 31, 10, 0, 18, 14, 0, 17, 3, 12, 71, 3, 73, 0, 8, 19, 18, 16, 0, 5, 3, 41, 0, 10, 22, 43, 32, 11, 0, 8
Offset: 1
Keywords
Examples
a(15) = 8 because 15 has 4 divisors {1, 3, 5, 15} among which 2 are twin primes {3, 5} therefore 3 + 5 = 8.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Twin Primes.
- Index entries for sequences related to sums of divisors.
Programs
-
Maple
N:= 200: # to get a(1)..a(N) P:= select(isprime, {seq(i,i=3..N+2)}): TP:= P intersect map(`-`,P,2): TP:= TP union map(`+`,TP,2): V:= Vector(N): for p in TP do pm:= [seq(i,i=p..N,p)]; V[pm]:= map(`+`,V[pm],p); od: convert(V,list); # Robert Israel, Mar 30 2017
-
Mathematica
Table[Total[Select[Divisors[n], PrimeQ[#1] && (PrimeQ[#1 - 2] || PrimeQ[#1 + 2]) &]], {n, 80}]
-
PARI
a(n) = sumdiv(n, d, d*(isprime(d) && (isprime(d-2) || isprime(d+2)))); \\ Michel Marcus, Apr 02 2017
-
Python
from sympy import divisors, isprime def a(n): return sum([i for i in divisors(n) if isprime(i) and (isprime(i - 2) or isprime(i + 2))]) print([a(n) for n in range(1, 91)]) # Indranil Ghosh, Mar 30 2017