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-4 of 4 results.

A071376 Duplicate of A064502.

Original entry on oeis.org

0, 2, 3, 0, 5, 0, 7, 15, 14, 21, 11, 35, 13, 33, 26, 39, 17, 65, 19, 51, 38, 57, 23, 95, 46
Offset: 1

Views

Author

Keywords

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

A056240 Smallest number whose prime divisors (taken with multiplicity) add to n.

Original entry on oeis.org

2, 3, 4, 5, 8, 7, 15, 14, 21, 11, 35, 13, 33, 26, 39, 17, 65, 19, 51, 38, 57, 23, 95, 46, 69, 92, 115, 29, 161, 31, 87, 62, 93, 124, 155, 37, 217, 74, 111, 41, 185, 43, 123, 86, 129, 47, 215, 94, 141, 188, 235, 53, 329, 106, 159, 212, 265, 59, 371, 61, 177, 122
Offset: 2

Views

Author

Adam Kertesz, Aug 19 2000

Keywords

Comments

a(n) is the index of first occurrence of n in A001414.
From David James Sycamore and Michel Marcus, Jun 16 2017, Jun 28 2017: (Start)
Recursive calculation of a(n):
For prime p, a(p) = p.
For even composite n, let P_n denote the largest prime < n-1 such that n-P_n is prime (except if n = 6).
For odd composite n, let P_n denote the largest prime < n-1 such that n-3-P_n is prime.
Conjecture: a(n) = min { q*a(n-q); q prime, P_n <= q < n-1 }.
Examples:
For n = 9998, P_9998 = 9967 and a(9998) = min { 9973*a(25), 9967*a(31) } = 9967*31 = 308977.
For n = 875, P_875 = 859 and a(875) = min { 863*a(12), 859*a(16) } = 863*35 = 30205.
Note: A000040 and A288313 are both subsequences of this sequence. (End)

Examples

			a(8) = 15 = 3*5 because 15 is the smallest number whose prime divisors sum to 8.
a(10000) = 586519: Let pp(n) be the largest prime < n and the candidate being the current value that might be a(10000). Then we see that pp(10000 - 1) = 9973, giving a candidate 9973 * a(10000 - 9973) = 9973 * 92. pp(9973) = 9967, giving a candidate 9967 * a(10000 - 9967) = 9967 * 62. pp(9967) = 9949, giving the candidate 9949 * a(10000 - 9949) = 9962 * 188. This is larger than our candidate so we keep 9967 * 62 as our candidate. pp(9949) = 9941, giving a candidate 9941 * pp(10000 - 9941) = 9941 * 59. We see that (n - p) * a(p) >= (n - p) * p > candidate = 9941 * 59 for p > 59 so we stop iterating to conclude a(10000) = 9941 * 59 = 586519. - _David A. Corneth_, Mar 23 2018, edited by _M. F. Hasler_, Jan 19 2019
		

Crossrefs

First column of array A064364, n>=2.
See A000792 for the maximal numbers whose prime factors sums up to n.

Programs

  • Haskell
    a056240 = (+ 1) . fromJust . (`elemIndex` a001414_list)
    -- Reinhard Zumkeller, Jun 14 2012
    
  • Maple
    A056240 := proc(n)
        local k ;
        for k from 1 do
            if A001414(k) = n then
                return k ;
            end if;
        end do:
    end proc:
    seq(A056240(n),n=2..80) ; # R. J. Mathar, Apr 15 2024
  • Mathematica
    a = Table[0, {75}]; Do[b = Plus @@ Flatten[ Table[ #1, {#2}] & @@@ FactorInteger[n]]; If[b < 76 && a[[b]] == 0, a[[b]] = n], {n, 2, 1000}]; a (* Robert G. Wilson v, May 04 2002 *)
    b[n_] := b[n] = Total[Times @@@ FactorInteger[n]];
    a[n_] := For[k = 2, True, k++, If[b[k] == n, Return[k]]];
    Table[a[n], {n, 2, 63}] (* Jean-François Alcover, Jul 03 2017 *)
  • PARI
    isok(k, n) = my(f=factor(k)); sum(j=1, #f~, f[j,1]*f[j,2]) == n;
    a(n) = my(k=2); while(!isok(k, n), k++); k; \\ Michel Marcus, Jun 21 2017
    
  • PARI
    a(n) = {if(n < 7, return(n + 2*(n==6))); my(p = precprime(n), res); if(p == n, return(p), p = precprime(n - 2); res = p * a(n - p); while(res > (n - p) * p && p > 2, p = precprime(p - 1); res = min(res, a(n - p) * p)); res)} \\ David A. Corneth, Mar 23 2018
    
  • PARI
    A056240(n, p=n-1, m=oo)=if(n<6 || isprime(n), n, n==6, 8, until(p<3 || (n-p=precprime(p-1))*p >= m=min(m,A056240(n-p)*p),); m) \\ M. F. Hasler, Jan 19 2019

Formula

Trivial but essential: a(n) >= n. - David A. Corneth, Mar 23 2018
a(n) >= n with equality iff n = 4 or n is prime. - M. F. Hasler, Jan 19 2019

Extensions

More terms from James Sellers, Aug 25 2000

A363266 Maximum product of distinct primes with sum n, or -1 if n is not the sum of distinct primes.

Original entry on oeis.org

1, -1, 2, 3, -1, 6, -1, 10, 15, 14, 30, 11, 42, 22, 70, 105, 66, 210, 110, 165, 154, 330, 182, 462, 170, 770, 1155, 910, 2310, 858, 2730, 1430, 2145, 2002, 4290, 1870, 6006, 2618, 10010, 15015, 7854, 30030, 13090, 19635, 15470, 39270, 17290, 46410, 24310, 51870
Offset: 0

Views

Author

Zhao Hui Du, May 23 2023

Keywords

Examples

			Expressed as a sum of distinct primes, 12 = 5 + 7 = 2 + 3 + 7. Products are 5*7 = 35 and 2*3*7 = 42; 42 > 35, so a(12) = 42.
13 = 2 + 11; products are 13 = 13 and 2*11 = 22; 22 > 13, so a(13) = 22.
		

Crossrefs

Cf. A000586, A000792 (the same without condition distinct), A064502 (with min).

Programs

  • PARI
    alist(n)={local(v); v=vector(n, x, -1); forprime(p=2, n, forstep(h=n, p+1, -1, v[h]=max(v[h], v[h-p]*p)); v[p]=max(v[p], p)); v}
Showing 1-4 of 4 results.