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-10 of 11 results. Next

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

A024934 Sum of remainders n mod p, over all primes p < n.

Original entry on oeis.org

0, 0, 0, 1, 1, 3, 1, 4, 6, 7, 4, 8, 8, 13, 10, 8, 12, 18, 20, 27, 28, 26, 21, 29, 33, 37, 31, 37, 37, 46, 46, 56, 65, 62, 54, 53, 59, 70, 61, 57, 62, 74, 75, 88, 89, 95, 84, 98, 108, 116, 124, 119, 119, 134, 145, 145, 152, 146, 131, 147, 154, 171, 156, 164, 180, 180, 182, 200, 200, 193, 198, 217
Offset: 0

Views

Author

Keywords

Examples

			a(5) = 3. The remainder when 5 is divided by primes 2, 3 respectively is 1, 2, and their sum = 3.
10 = 2*5+0 = 3*3+1 = 5*2+0 = 7*1+3: a(10) = 0+1+0+3 = 4.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[Mod[n, Prime[i]], {i, PrimePi@ n}]; Array[a, 72, 0] (* Giovanni Resta, Jun 24 2016 *)
    Table[Total[Mod[n,Prime[Range[PrimePi[n]]]]],{n,0,80}] (* Harvey P. Dale, Jul 02 2025 *)
  • PARI
    a(n)=my(r=0);forprime(p=2,n,r+=n%p); r; \\ Joerg Arndt, Nov 05 2016

Formula

a(n) = n*A000720(n) - A024924(n). - Max Alekseyev, Feb 10 2012
a(n) = a(n-1) + A000720(n-1) - A105221(n). - Max Alekseyev, Nov 28 2017

Extensions

Edited by Max Alekseyev, Jan 30 2012
a(0)=0 prepended by Max Alekseyev, Dec 10 2013

A143851 Primes p that divide the sum of their residues modulo all smaller primes (=A024934(p)).

Original entry on oeis.org

2, 13, 167, 2239, 439867, 724031017, 1990127567, 54892225873
Offset: 1

Views

Author

Neil Fernandez, Sep 03 2008

Keywords

Comments

Also, primes p such that p divides A024924(p). The prime terms of A065132.

Examples

			13 is congruent to 1,1,3,6 and 2, modulo 2,3,5,7 and 11 respectively. 1+1+3+6+2=13, which is a multiple of the original number, 13. So the original number, is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    For[n = 1, n < 1000001, n++, p = Prime[n]; m = Mod[Sum[Mod[p, Prime[i]], {i, 1, n - 1}], p]; If[m == 0, Print[p]]]

Extensions

a(6)-a(8) from Max Alekseyev, Feb 10 2012

A065132 Arithmetic mean of first n terms of A008472 is an integer.

Original entry on oeis.org

2, 13, 134, 167, 2239, 62268, 75255, 135681, 439867, 18139940, 23671044, 40892256, 312083956, 724031017, 1990127567, 2144843867, 2588619526, 7439533243, 15054156002, 54892225873, 69959798320, 79760490898, 282311798922
Offset: 1

Views

Author

Labos Elemer, Oct 15 2001

Keywords

Examples

			Sum of first 13 terms of A008472 gives A024924(13) = 65 which is divisible by n = 13, so 13 is here: 0+2+3+2+5+5+7+2+3+7+11+5+13 = 65 = 13*5 = A024924(13).
		

Crossrefs

Programs

  • Mathematica
    s=0; Do[s=s+sp[n]; If[IntegerQ[n/25000], Print[n]]; If[IntegerQ[s/n], Print[{n, s, s/n}]], {n, 2, 4000000}] where sp[n]=A008472(n).

Formula

Integers n that divide A024924(n)=A008472(1)+A008472(2)+...+A008472(n).
Also, integers n that divide A024934(n).
Prime terms are listed in A143851.

Extensions

a(10)-a(19) from Donovan Johnson, Nov 22 2009
a(20)-a(23) from Donovan Johnson, Aug 31 2010

A303482 Numbers k such that the average of all distinct prime factors of all positive integers <= k is an integer.

Original entry on oeis.org

2, 5, 81, 10742, 10130527, 1041972864, 23292549600
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 24 2018

Keywords

Comments

Numbers k such that A013939(k)|A024924(k).

Examples

			5 is in the sequence because the distinct prime factors of 2, 3, 4, and 5 are 2, 3, 2 and 5 respectively and their average (2 + 3 + 2 + 5) / 4 = 3 is an integer. - _David A. Corneth_, Apr 26 2018
		

Crossrefs

Programs

  • Mathematica
    s = t = 0; k = 2; lst = {}; While[k < 1000000000, p = #[[1]] & /@ FactorInteger@ k; s = s + Plus @@ p; t = t + Length@ p; If[ Mod[s, t] == 0, AppendTo[lst, k]]; k++]; lst (* Robert G. Wilson v, Apr 26 2018 *)

Extensions

a(5) from Daniel Suteu, Apr 24 2018
a(6)-a(7) from Giovanni Resta, Apr 26 2018

A309192 a(n) = Sum_{k=1..n} mu(k)^2 * k * floor(n/k).

Original entry on oeis.org

1, 4, 8, 11, 17, 29, 37, 40, 44, 62, 74, 86, 100, 124, 148, 151, 169, 181, 201, 219, 251, 287, 311, 323, 329, 371, 375, 399, 429, 501, 533, 536, 584, 638, 686, 698, 736, 796, 852, 870, 912, 1008, 1052, 1088, 1112, 1184, 1232, 1244, 1252, 1270, 1342, 1384, 1438, 1450, 1522
Offset: 1

Views

Author

Ilya Gutkovskiy, Jul 16 2019

Keywords

Comments

Partial sums of A048250.

Crossrefs

Programs

  • Mathematica
    Table[Sum[MoebiusMu[k]^2 k Floor[n/k], {k, 1, n}], {n, 1, 55}]
    nmax = 55; CoefficientList[Series[1/(1 - x) Sum[MoebiusMu[k]^2 k x^k/(1 - x^k), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
    Accumulate[Table[Total[Select[Divisors[n], SquareFreeQ]], {n, 1, 100}]] (* Vaclav Kotesovec, Jul 16 2019 *)

Formula

G.f.: (1/(1 - x)) * Sum_{k>=1} mu(k)^2 * k * x^k/(1 - x^k).
a(n) ~ n^2/2. - Vaclav Kotesovec, Jul 16 2019

A380314 Numerator of sum of reciprocals of all prime divisors of all positive integers <= n.

Original entry on oeis.org

0, 1, 5, 4, 23, 71, 527, 316, 117, 283, 3183, 5737, 75736, 170777, 186793, 100904, 1730383, 1295397, 24782713, 13522987, 42878411, 91488457, 2113934201, 1149922463, 234446350, 494634185, 169835681, 89698402, 2608690087, 84946052281, 2639797313941, 1370038779503, 1412581913773
Offset: 1

Views

Author

Ilya Gutkovskiy, Jan 20 2025

Keywords

Comments

Prime divisors counted without multiplicity.

Examples

			0, 1/2, 5/6, 4/3, 23/15, 71/30, 527/210, 316/105, 117/35, 283/70, 3183/770, 5737/1155, 75736/15015, ...
		

Crossrefs

Programs

  • Maple
    N:= 100: # for a(1) .. a(N)
    P:= select(isprime,[$1..N]):
    f:= proc(n) local k;
      numer(add(floor(n/P[k])/P[k],k=1..numtheory:-pi(n)))
    end proc:
    map(f, [$1..N]); # Robert Israel, Jan 26 2025
  • Mathematica
    Table[DivisorSum[n, 1/# &, PrimeQ[#] &], {n, 1, 33}] // Accumulate // Numerator
    Table[Sum[Floor[n/Prime[k]]/Prime[k], {k, 1, n}], {n, 1, 33}] // Numerator
    nmax = 33; CoefficientList[Series[1/(1 - x) Sum[x^Prime[k]/(Prime[k] (1 - x^Prime[k])), {k, 1, nmax}], {x, 0, nmax}], x] // Numerator // Rest
  • PARI
    a(n) = my(vp=primes(primepi(n))); numerator(sum(k=1, #vp, (n\vp[k])/vp[k])); \\ Michel Marcus, Jan 26 2025

Formula

G.f. for fractions: (1/(1 - x)) * Sum_{k>=1} x^prime(k) / (prime(k)*(1 - x^prime(k))).
a(n) is the numerator of Sum_{k=1..pi(n)} floor(n/prime(k)) / prime(k).

A279910 a(n) = Sum_{k=1..n} prime(k+1)*floor(n/prime(k+1)).

Original entry on oeis.org

0, 0, 3, 3, 8, 11, 18, 18, 21, 26, 37, 40, 53, 60, 68, 68, 85, 88, 107, 112, 122, 133, 156, 159, 164, 177, 180, 187, 216, 224, 255, 255, 269, 286, 298, 301, 338, 357, 373, 378, 419, 429, 472, 483, 491, 514, 561, 564, 571, 576, 596, 609, 662, 665, 681, 688, 710, 739, 798, 806, 867, 898, 908, 908, 926, 940, 1007, 1024, 1050, 1062
Offset: 1

Views

Author

Ilya Gutkovskiy, Dec 24 2016

Keywords

Comments

Sum of all odd prime divisors of all positive integers <= n.

Examples

			For n = 7 the odd prime divisors of the first seven positive integers are {0}, {0}, {3}, {0}, {5}, {3}, {7} so a(7) = 0 + 0 + 3 + 0 + 5 + 3 + 7 = 18.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[Prime[k + 1] Floor[n/Prime[k + 1]], {k, 1, n}], {n, 70}]
    Rest[nmax = 70; CoefficientList[Series[(1/(1 - x)) Sum[Prime[k] x^Prime[k]/(1 - x^Prime[k]), {k, 2, nmax}], {x, 0, nmax}], x]]

Formula

G.f.: (1/(1 - x))*Sum_{k>=2} prime(k)*x^prime(k)/(1 - x^prime(k)).
a(n) = -2*floor(n/2) + Sum_{k=1..n} prime(k)*floor(n/prime(k)) .
a(n) = A024924(n) - A052928(n).

A380315 Denominator of sum of reciprocals of all prime divisors of all positive integers <= n.

Original entry on oeis.org

1, 2, 6, 3, 15, 30, 210, 105, 35, 70, 770, 1155, 15015, 30030, 30030, 15015, 255255, 170170, 3233230, 1616615, 4849845, 9699690, 223092870, 111546435, 22309287, 44618574, 14872858, 7436429, 215656441, 6469693230, 200560490130, 100280245065, 100280245065
Offset: 1

Views

Author

Ilya Gutkovskiy, Jan 20 2025

Keywords

Comments

Prime divisors counted without multiplicity.
Differs from A379370 first at n=15.

Examples

			0, 1/2, 5/6, 4/3, 23/15, 71/30, 527/210, 316/105, 117/35, 283/70, 3183/770, 5737/1155, 75736/15015, ...
		

Crossrefs

Programs

  • Mathematica
    Table[DivisorSum[n, 1/# &, PrimeQ[#] &], {n, 1, 33}] // Accumulate // Denominator
    Table[Sum[Floor[n/Prime[k]]/Prime[k], {k, 1, n}], {n, 1, 33}] // Denominator
    nmax = 33; CoefficientList[Series[1/(1 - x) Sum[x^Prime[k]/(Prime[k] (1 - x^Prime[k])), {k, 1, nmax}], {x, 0, nmax}], x] // Denominator // Rest
  • PARI
    a(n) = my(vp=primes(primepi(n))); denominator(sum(k=1, #vp, (n\vp[k])/vp[k])); \\ Michel Marcus, Jan 26 2025

Formula

G.f. for fractions: (1/(1 - x)) * Sum_{k>=1} x^prime(k) / (prime(k)*(1 - x^prime(k))).
a(n) is the denominator of Sum_{k=1..pi(n)} floor(n/prime(k)) / prime(k).

A280385 a(n) = Sum_{k=1..n} prime(k)^2*floor(n/prime(k)) .

Original entry on oeis.org

0, 4, 13, 17, 42, 55, 104, 108, 117, 146, 267, 280, 449, 502, 536, 540, 829, 842, 1203, 1232, 1290, 1415, 1944, 1957, 1982, 2155, 2164, 2217, 3058, 3096, 4057, 4061, 4191, 4484, 4558, 4571, 5940, 6305, 6483, 6512, 8193, 8255, 10104, 10229, 10263, 10796, 13005, 13018, 13067, 13096, 13394, 13567, 16376, 16389, 16535
Offset: 1

Views

Author

Ilya Gutkovskiy, Jan 01 2017

Keywords

Comments

Sum of all squares of prime divisors of all positive integers <= n.
Partial sums of A005063.

Examples

			For n = 6 the prime divisors of the first six positive integers are {0}, {2}, {3}, {2}, {5}, {2, 3} so a(6) = 0^2 + 2^2 + 3^2 + 2^2 + 5^2 + 2^2 + 3^2 = 55.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[Prime[k]^2 Floor[n/Prime[k]], {k, 1, n}], {n, 55}]
    Table[Sum[DivisorSum[k, #1^2 &, PrimeQ[#1] &], {k, 1, n}], {n, 55}]
    nmax = 55; Rest[CoefficientList[Series[(1/(1 - x)) Sum[Prime[k]^2 x^Prime[k]/(1 - x^Prime[k]), {k, 1, nmax}], {x, 0, nmax}], x]]
  • PARI
    a(n) = sum(k=1, n, prime(k)^2 * (n\prime(k))); \\ Indranil Ghosh, Apr 03 2017
    
  • Python
    from sympy import prime
    print([sum([prime(k)**2 * (n//prime(k)) for k in range(1, n + 1)]) for n in range(1, 21)]) # Indranil Ghosh, Apr 03 2017

Formula

G.f.: (1/(1 - x))*Sum_{k>=1} prime(k)^2*x^prime(k)/(1 - x^prime(k)).
Showing 1-10 of 11 results. Next