cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A284599 Sum of twin prime (A001097) divisors of n.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Mar 30 2017

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.
		

Crossrefs

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
    

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).
Additive with a(p^e) = p if p is in A001097, and 0 otherwise. - Amiram Eldar, May 15 2025

A339558 Number of divisors of 2n that are the average of a pair of twin primes.

Original entry on oeis.org

0, 1, 1, 1, 0, 3, 0, 1, 2, 1, 0, 3, 0, 1, 2, 1, 0, 4, 0, 1, 2, 1, 0, 3, 0, 1, 2, 1, 0, 5, 0, 1, 1, 1, 0, 5, 0, 1, 1, 1, 0, 4, 0, 1, 3, 1, 0, 3, 0, 1, 2, 1, 0, 5, 0, 1, 1, 1, 0, 5, 0, 1, 3, 1, 0, 3, 0, 1, 2, 1, 0, 5, 0, 1, 3, 1, 0, 3, 0, 1, 2, 1, 0, 4, 0, 1, 1, 1, 0, 7, 0
Offset: 1

Views

Author

Wesley Ivan Hurt, Dec 08 2020

Keywords

Examples

			a(6) = 3; There are 3 divisors of 2*6 = 12 that are the average of twin primes, namely 4, 6 and 12.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) nops(select(t -> isprime(t-1) and isprime(t+1), numtheory:-divisors(2*n))) end proc:
    map(f, [$1..100]); # Robert Israel, Jan 06 2021
  • Mathematica
    Table[Sum[(PrimePi[2n/i + 1] - PrimePi[2n/i]) (PrimePi[2n/i - 1] - PrimePi[2n/i - 2]) (1 - Ceiling[2n/i] + Floor[2n/i]), {i, 2n}], {n, 100}]
  • PARI
    a(n) = sumdiv(2*n, d, (d>1) && (bigomega(d^2-1)==2)); \\ Michel Marcus, Dec 16 2020
    
  • PARI
    a(n) = sumdiv(2*n, d, d > 1 && isprime(d-1) && isprime(d+1)); \\ Amiram Eldar, Jun 03 2024

Formula

a(n) = Sum_{d|(2*n)} c(d+1) * c(d-1), where c is the prime characteristic (A010051).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2 * A241560 = 1.857671... . - Amiram Eldar, Jun 03 2024
Showing 1-2 of 2 results.