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

A034387 Sum of primes <= n.

Original entry on oeis.org

0, 2, 5, 5, 10, 10, 17, 17, 17, 17, 28, 28, 41, 41, 41, 41, 58, 58, 77, 77, 77, 77, 100, 100, 100, 100, 100, 100, 129, 129, 160, 160, 160, 160, 160, 160, 197, 197, 197, 197, 238, 238, 281, 281, 281, 281, 328, 328, 328, 328, 328, 328, 381, 381, 381, 381, 381
Offset: 1

Views

Author

Keywords

Comments

Also sum of all prime factors in n!.
For large n, these numbers can be closely approximated by the number of primes < n^2. For example, the sum of primes < 10^10 = 2220822432581729238. The number of primes < (10^10)^2 or 10^20 = 2220819602560918840. This has a relative error of 0.0000012743... - Cino Hilliard, Jun 08 2008
Equals row sums of triangle A143537. - Gary W. Adamson, Aug 23 2008
Partial sums of A061397. - Reinhard Zumkeller, Mar 21 2014

Crossrefs

This is a lower bound on A287881.

Programs

  • Haskell
    a034387 n = a034387_list !! (n-1)
    a034387_list = scanl1 (+) a061397_list
    -- Reinhard Zumkeller, Mar 21 2014
    
  • Maple
    a:= proc(n) option remember; `if`(n<1, 0,
          a(n-1)+`if`(isprime(n), n, 0))
        end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Jun 29 2022
  • Mathematica
    s=0; Table[s=s+n*Boole[PrimeQ[n]],{n,100}] (* Zak Seidov, Apr 11 2011 *)
    Accumulate[Table[If[PrimeQ[n],n,0],{n,60}]] (* Harvey P. Dale, Jul 25 2016 *)
  • PARI
    a(n)=sum(i=1,primepi(n),prime(i)) \\ Michael B. Porter, Sep 22 2009
    
  • PARI
    a=0;for(k=1,100,print1(a=a+k*isprime(k),", ")) \\ Zak Seidov, Apr 11 2011
    
  • PARI
    a(n) = if(n <= 1, return(0)); my(r=sqrtint(n)); my(V=vector(r, k, n\k)); my(L=n\r-1); V=concat(V, vector(L, k, L-k+1)); my(T=vector(#V, k, V[k]*(V[k]+1)\2)); my(S=Map(matrix(#V,2,x,y,if(y==1,V[x],T[x])))); forprime(p=2, r, my(sp=mapget(S,p-1), p2=p*p); for(k=1, #V, if(V[k] < p2, break); mapput(S, V[k], mapget(S,V[k]) - p*(mapget(S,V[k]\p) - sp)))); mapget(S,n)-1; \\ Daniel Suteu, Jun 29 2022
    
  • Python
    from sympy import isprime
    from itertools import accumulate
    def alist(n): return list(accumulate(k*isprime(k) for k in range(1, n+1)))
    print(alist(57)) # Michael S. Branicky, Sep 18 2021

Formula

From the prime number theorem a(n) has the asymptotic expression: a(n) ~ n^2 / (2 log n). - Dan Fux (dan.fux(AT)OpenGaia.com), Apr 07 2001
a(n) = A158662(n) - 1. a(p) - a(p-1) = p, for p = primes (A000040), a(c) - a(c-1) = 0, for c = composite numbers (A002808). - Jaroslav Krizek, Mar 23 2009
a(n) = n^2/(2 log n) + O(n^2 log log n/log^2 n). - Vladimir Shevelev and Charles R Greathouse IV, May 29 2014
Conjecture: G.f.: Sum_{i>0} Sum_{j>=i} Sum_{k>=j|i-j+k is prime} x^k. - Benedict W. J. Irwin, Mar 31 2017
a(n) = (n+1)*A000720(n) - A046992(n). - Ridouane Oudra, Sep 18 2021
a(n) = A007504(A000720(n)). - Ridouane Oudra, Feb 22 2022
a(n) = Sum_{p<=n, p prime} p. - Wesley Ivan Hurt, Dec 31 2023

A158976 a(n) = sum of numbers k <= n such that not all proper divisors of k are divisors of n.

Original entry on oeis.org

0, 0, 0, 0, 4, 0, 10, 6, 18, 23, 37, 10, 49, 45, 54, 66, 94, 75, 112, 90, 123, 149, 175, 120, 199, 220, 241, 251, 305, 236, 335, 307, 358, 396, 409, 385, 505, 501, 534, 499, 622, 568, 664, 630, 632, 749, 799, 688, 847, 857, 937, 959, 1049, 985, 1078, 1039, 1205
Offset: 1

Views

Author

Jaroslav Krizek, Apr 01 2009

Keywords

Comments

For primes p, a(p) = A000217(p) - A158662(p) = A000217(p) - A014284(A036234(p)).

Examples

			For n = 7 we have the following proper divisors for k <= n: {1}, {1}, {1}, {1, 2}, {1}, {1, 2, 3}, {1}. Only 4 and 6 have proper divisors that are not divisors of 7, viz. 2 and 2, 3. Hence a(7) = 4 + 6 = 10.
		

Crossrefs

Programs

  • Magma
    [ IsEmpty(S) select 0 else &+S where S is [ k: k in [1..n] | exists(t){ d: d in Divisors(k) | d ne k and d notin Divisors(n) } ]: n in [1..57] ];

Extensions

Edited and extended by Klaus Brockhaus, Apr 06 2009

A159073 Sum of the k in the range 1

Original entry on oeis.org

0, 2, 5, 9, 10, 20, 17, 29, 26, 31, 28, 67, 41, 59, 65, 69, 58, 95, 77, 119, 107, 103, 100, 179, 125, 130, 136, 154, 129, 228, 160, 220, 202, 198, 220, 280, 197, 239, 245, 320, 238, 334, 281, 359, 402, 331, 328, 487, 377, 417, 388, 418, 381, 499, 461, 556, 447, 443, 440
Offset: 1

Views

Author

Jaroslav Krizek, Apr 04 2009

Keywords

Comments

Here proper divisors include 1 but not the argument (k or n, respectively) in the divisor set, as defined in A032741.
Terms of the sum are counted in A159070.

Examples

			a(8) = 29 is the sum of the following six k: 2 {1}, 3 {1}, 4 {1, 2}, 5 {1}, 7 {1}, 8 {1, 2, 4} with subsets of the proper divisors {1, 2, 4} of n = 8. 2 + 3 + 4 + 5 + 7 + 8 = 29.
		

Crossrefs

Formula

a(n) = A158975(n) - 1.
If p = prime, element of A000040, a(p) = A158662(p) - 1 = A014284(A036234(p)) - 1.

Extensions

Edited and extended by R. J. Mathar, Apr 06 2009

A158975 a(n) = sum of numbers k <= n such that all proper divisors of k are divisors of n.

Original entry on oeis.org

1, 3, 6, 10, 11, 21, 18, 30, 27, 32, 29, 68, 42, 60, 66, 70, 59, 96, 78, 120, 108, 104, 101, 180, 126, 131, 137, 155, 130, 229, 161, 221, 203, 199, 221, 281, 198, 240, 246, 321, 239, 335, 282, 360, 403, 332, 329, 488, 378, 418, 389, 419, 382, 500, 462, 557, 448
Offset: 1

Views

Author

Jaroslav Krizek, Apr 01 2009

Keywords

Comments

For primes p, a(p) = A158662(p) = A014284(A036234(p)).

Examples

			For n = 8 we have the following proper divisors of k <= n: {1}, {1}, {1}, {1, 2}, {1}, {1, 2, 3}, {1}, {1, 2, 4}. Only k = 6 has a proper divisor that is not a divisor of 8, viz. 3. Hence a(8) = 1 + 2 + 3 + 4 + 5 + 7 + 8 = 30.
		

Crossrefs

Cf. A000040, A158662, A014284, A036234, 158973.

Programs

  • Magma
    [ &+[ k: k in [1..n] | forall(t){ d: d in Divisors(k) | d eq k or d in Divisors(n) } ]: n in [1..57] ];

Extensions

Edited and extended by Klaus Brockhaus, Apr 06 2009

A159074 Sum of the k in the range 1<=k<=n such that set of proper divisors of k is not a subset of the set of proper divisors of n.

Original entry on oeis.org

1, 1, 1, 1, 5, 1, 11, 7, 19, 24, 38, 11, 50, 46, 55, 67, 95, 76, 113, 91, 124, 150, 176, 121, 200, 221, 242, 252, 306, 237
Offset: 1

Views

Author

Jaroslav Krizek, Apr 04 2009

Keywords

Comments

The nomenclature of A159072 applies, where the terms in that sum are counted.

Examples

			a(8) = 7 adds k = 6, where {1, 2, 3} is not a subset of the divisor set {1, 2, 4} of n = 8, and k = 1, with an empty proper divisor set.
		

Crossrefs

Formula

a(n) = A158976(n) + 1.
If p = prime, a(p) = A000217(p) - A158662(p) + 1 = A000217(p) - A014284[A036234(p)] + 1.
a(n)+A159073(n)=A000217(n). - R. J. Mathar, Apr 06 2009

Extensions

Edited by R. J. Mathar, Apr 06 2009
Showing 1-5 of 5 results.