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.

A008472 Sum of the distinct primes dividing n.

Original entry on oeis.org

0, 2, 3, 2, 5, 5, 7, 2, 3, 7, 11, 5, 13, 9, 8, 2, 17, 5, 19, 7, 10, 13, 23, 5, 5, 15, 3, 9, 29, 10, 31, 2, 14, 19, 12, 5, 37, 21, 16, 7, 41, 12, 43, 13, 8, 25, 47, 5, 7, 7, 20, 15, 53, 5, 16, 9, 22, 31, 59, 10, 61, 33, 10, 2, 18, 16, 67, 19, 26, 14, 71, 5, 73
Offset: 1

Views

Author

Keywords

Comments

Sometimes called sopf(n).
Sum of primes dividing n (without repetition) (compare A001414).
Equals A051731 * A061397 = inverse Mobius transform of [0, 2, 3, 0, 5, 0, 7, ...]. - Gary W. Adamson, Feb 14 2008
Equals row sums of triangle A143535. - Gary W. Adamson, Aug 23 2008
a(n) = n if and only if n is prime. - Daniel Forgues, Mar 24 2009
a(n) = n is a new record if and only if n is prime. - Zak Seidov, Jun 27 2009
a(A001043(n)) = A191583(n);
For n > 0: a(A000079(n)) = 2, a(A000244(n)) = 3, a(A000351(n)) = 5, a(A000420(n)) = 7;
a(A006899(n)) <= 3; a(A003586(n)) = 5; a(A033846(n)) = 7; a(A033849(n)) = 8; a(A033847(n)) = 9; a(A033850(n)) = 10; a(A143207(n)) = 10. - Reinhard Zumkeller, Jun 28 2011
For n > 1: a(n) = Sum(A027748(n,k): 1 <= k <= A001221(n)). - Reinhard Zumkeller, Aug 27 2011
If n is the product of twin primes (A037074), a(n) = 2*sqrt(n+1) = sqrt(4n+4). - Wesley Ivan Hurt, Sep 07 2013
From Wilf A. Wilson, Jul 21 2017: (Start)
a(n) + 2, n > 2, is the number of maximal subsemigroups of the monoid of orientation-preserving or -reversing mappings on a set with n elements.
a(n) + 3, n > 2, is the number of maximal subsemigroups of the monoid of orientation-preserving or -reversing partial mappings on a set with n elements.
(End)
The smallest m such that a(m) = n, or 0 if no such number m exists is A064502(n). The only integers that are not in the sequence are 1, 4 and 6. - Bernard Schott, Feb 07 2022

Examples

			a(18) = 5 because 18 = 2 * 3^2 and 2 + 3 = 5.
a(19) = 19 because 19 is prime.
a(20) = 7 because 20 = 2^2 * 5 and 2 + 5 = 7.
		

Crossrefs

First difference of A024924.
Sum of the k-th powers of the primes dividing n for k=0..10 : A001221 (k=0), this sequence (k=1), A005063 (k=2), A005064 (k=3), A005065 (k=4), A351193 (k=5), A351194 (k=6), A351195 (k=7), this sequence (k=8), A351197 (k=9), A351198 (k=10).
Cf. A010051.

Programs

  • Haskell
    a008472 = sum . a027748_row  -- Reinhard Zumkeller, Mar 29 2012
    
  • Magma
    [n eq 1 select 0 else &+[p[1]: p in Factorization(n)]: n in [1..100]]; // Vincenzo Librandi, Jun 24 2017
    
  • Maple
    A008472 := n -> add(d, d = select(isprime, numtheory[divisors](n))):
    seq(A008472(i), i = 1..40); # Peter Luschny, Jan 31 2012
    A008472 := proc(n)
            add( d, d= numtheory[factorset](n)) ;
    end proc: # R. J. Mathar, Jul 08 2012
  • Mathematica
    Prepend[Array[Plus @@ First[Transpose[FactorInteger[#]]] &, 100, 2], 0]
    Join[{0}, Rest[Total[Transpose[FactorInteger[#]][[1]]]&/@Range[100]]] (* Harvey P. Dale, Jun 18 2012 *)
    (* Requires version 7.0+ *) Table[DivisorSum[n, # &, PrimeQ[#] &], {n, 75}] (* Alonso del Arte, Dec 13 2014 *)
    Table[Sum[p, {p, Select[Divisors[n], PrimeQ]}], {n, 1, 100}] (* Vaclav Kotesovec, May 20 2020 *)
  • PARI
    sopf(n) = local(fac=factor(n)); sum(i=1,matsize(fac)[1],fac[i,1])
    
  • PARI
    vector(100,n,vecsum(factor(n)[,1]~)) \\ Derek Orr, May 13 2015
    
  • PARI
    A008472(n)=vecsum(factor(n)[,1]) \\ M. F. Hasler, Jul 18 2015
    
  • Python
    from sympy import primefactors
    def A008472(n): return sum(primefactors(n)) # Chai Wah Wu, Feb 03 2022
  • Sage
    def A008472(n):
        return add(d for d in divisors(n) if is_prime(d))
    print([A008472(i) for i in (1..40)]) # Peter Luschny, Jan 31 2012
    
  • Sage
    [sum(prime_factors(n)) for n in range(1,74)] # Giuseppe Coppoletta, Jan 19 2015
    

Formula

Let n = Product_j prime(j)^k(j) where k(j) >= 1, then a(n) = Sum_j prime(j).
Additive with a(p^e) = p.
G.f.: Sum_{k >= 1} prime(k)*x^prime(k)/(1-x^prime(k)). - Franklin T. Adams-Watters, Sep 01 2009
L.g.f.: -log(Product_{k>=1} (1 - x^prime(k))) = Sum_{n>=1} a(n)*x^n/n. - Ilya Gutkovskiy, May 06 2017
Dirichlet g.f.: primezeta(s-1)*zeta(s). - Benedict W. J. Irwin, Jul 11 2018
a(n) = Sum_{p|n, p prime} p. - Wesley Ivan Hurt, Feb 04 2022
From Bernard Schott, Feb 07 2022: (Start)
For n > 0: a(A001020(n)) = 11, a(A001022(n)) = 13, a(A001026(n)) = 17, a(A001029(n)) = 19, a(A009967(n)) = 23, a(A009973(n)) = 29, a(A009975(n)) = 31, a(A009981(n)) = 37, a(A009985(n)) = 41, a(A009987(n)) = 43, a(A009991(n)) = 47.
For p odd prime, a(2*p) = p+2 <==> a(A100484(n)) = A052147(n) for n > 1. (End)
a(n) = Sum_{d|n} d * c(d), where c = A010051. - Wesley Ivan Hurt, Jun 22 2024

A001043 Numbers that are the sum of 2 successive primes.

Original entry on oeis.org

5, 8, 12, 18, 24, 30, 36, 42, 52, 60, 68, 78, 84, 90, 100, 112, 120, 128, 138, 144, 152, 162, 172, 186, 198, 204, 210, 216, 222, 240, 258, 268, 276, 288, 300, 308, 320, 330, 340, 352, 360, 372, 384, 390, 396, 410, 434, 450, 456, 462, 472, 480, 492, 508, 520
Offset: 1

Views

Author

Keywords

Comments

Arithmetic derivative (see A003415) of prime(n)*prime(n+1). - Giorgio Balzarotti, May 26 2011
A008472(a(n)) = A191583(n). - Reinhard Zumkeller, Jun 28 2011
With the exception of the first term, all terms are even. a(n) is divisible by 4 if the difference between prime(n) and prime(n + 1) is not divisible by 4; e.g., prime(n) = 1 mod 4 and prime(n + 1) = 3 mod 4. In general, for a(n) to be divisible by some even number m > 2 requires that prime(n + 1) - prime(n) not be a multiple of m. - Alonso del Arte, Jan 30 2012

Examples

			2 + 3 = 5.
3 + 5 = 8.
5 + 7 = 12.
7 + 11 = 18.
		

References

  • Archimedeans Problems Drive, Eureka, 26 (1963), 12.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Subsequence of A050936.
Cf. A000040 (primes), A031131 (first differences), A092163 (bisection), A100479 (bisection).

Programs

  • Haskell
    a001043 n = a001043_list !! (n-1)
    a001043_list = zipWith (+) a000040_list $ tail a000040_list
    -- Reinhard Zumkeller, Oct 19 2011
  • Magma
    [(NthPrime(n+1) + NthPrime(n)): n in [1..100]]; // Vincenzo Librandi, Apr 02 2011
    
  • Maple
    Primes:= select(isprime,[2,seq(2*i+1,i=1..1000)]):
    n:= nops(Primes):
    Primes[1..n-1] + Primes[2..n]; # Robert Israel, Aug 29 2014
  • Mathematica
    Table[Prime[n] + Prime[n + 1], {n, 55}] (* Ray Chandler, Feb 12 2005 *)
    Total/@Partition[Prime[Range[60]], 2, 1] (* Harvey P. Dale, Aug 23 2011 *)
    Abs[Differences[Table[(-1)^n Prime[n], {n, 60}]]] (* Alonso del Arte, Feb 03 2016 *)
  • PARI
    p=2;forprime(q=3,1e3,print1(p+q", ");p=q) \\ Charles R Greathouse IV, Jun 10 2011
    
  • PARI
    is(n)=precprime((n-1)/2)+nextprime(n/2)==n&&n>2 \\ Charles R Greathouse IV, Jun 21 2012
    
  • Sage
    BB = primes_first_n(56)
    L = []
    for i in range(55): L.append(BB[1 + i] + BB[i])
    L # Zerinvary Lajos, May 14 2007
    

Formula

a(n) = prime(n) + prime(n + 1) = A000040(n) + A000040(n+1).
a(n) = A116366(n, n - 1) for n > 1. - Reinhard Zumkeller, Feb 06 2006
a(n) = 2*A024675(n-1), n>1. - R. J. Mathar, Jan 12 2024

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Mar 17 2000
Showing 1-2 of 2 results.