The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A284599 Sum of twin prime (A001097) divisors of n. 2
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
Eric Weisstein's World of Mathematics, Twin Primes
FORMULA
G.f.: Sum_{k>=1} A001097(k)*x^A001097(k)/(1 - x^A001097(k)).
a(n) = Sum_{d|n, d twin prime} d.
a(A062729(n)) = 0.
a(A001097(n)) = A001097(n).
EXAMPLE
a(15) = 8 because 15 has 4 divisors {1, 3, 5, 15} among which 2 are twin primes {3, 5} therefore 3 + 5 = 8.
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}]
PROG
(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
(PARI) a(n) = sumdiv(n, d, d*(isprime(d) && (isprime(d-2) || isprime(d+2)))); \\ Michel Marcus, Apr 02 2017
CROSSREFS
Sequence in context: A336597 A076109 A078788 * A005069 A366840 A284233
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Mar 30 2017
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 4 14:25 EDT 2024. Contains 373099 sequences. (Running on oeis4.)