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.

Previous Showing 11-20 of 54 results. Next

A053767 Sum of first n composite numbers.

Original entry on oeis.org

0, 4, 10, 18, 27, 37, 49, 63, 78, 94, 112, 132, 153, 175, 199, 224, 250, 277, 305, 335, 367, 400, 434, 469, 505, 543, 582, 622, 664, 708, 753, 799, 847, 896, 946, 997, 1049, 1103, 1158, 1214, 1271, 1329, 1389, 1451, 1514, 1578, 1643, 1709, 1777, 1846, 1916, 1988
Offset: 0

Views

Author

G. L. Honaker, Jr., Mar 29 2000

Keywords

Comments

a(A196415(n)) = A036691(A196415(n)) / A141092(n). - Reinhard Zumkeller, Oct 03 2011

Crossrefs

First differences of A023539.

Programs

  • Haskell
    a053767 n = a053767_list !! (n-1)
    a053767_list = scanl1 (+) a002808_list -- Reinhard Zumkeller, Oct 03 2011
    
  • Maple
    A053767 := proc(n)
            add(A002808(i),i=1..n) ;
    end proc: # R. J. Mathar, Oct 03 2011
    ListTools[PartialSums](remove(isprime,[$2..1000])); # Robert Israel, Jan 09 2015
  • Mathematica
    lst={};s=0;Do[If[ !PrimeQ[n], s=s+n;AppendTo[lst, s]], {n, 2, 10^2}];lst (* Vladimir Joseph Stephan Orlovsky, Aug 14 2008 *)
    Accumulate[Complement[Range[2,100],Prime[Range[PrimePi[100]]]]] (* Harvey P. Dale, Dec 28 2010 *)
    Accumulate[Select[Range[2, 100], ! PrimeQ[#] &]]
  • PARI
    lista(nn) = {my(s=0); forcomposite(n=0, nn, print1(s, ", "); s += n;);} \\ Michel Marcus, Jan 09 2015

Formula

a(n) = A000217(A002808(n)) - A034387(A002808(n)) - 1 . - Robert Israel, Jan 09 2015
a(n) = A051349(n+1) - 1. - Michel Marcus, Feb 16 2018

Extensions

a(0)=0 prepended by Max Alekseyev, Feb 10 2018

A046731 a(n) = sum of primes < 10^n.

Original entry on oeis.org

0, 17, 1060, 76127, 5736396, 454396537, 37550402023, 3203324994356, 279209790387276, 24739512092254535, 2220822432581729238, 201467077743744681014, 18435588552550705911377, 1699246443377779418889494, 157589260710736940541561021, 14692398516908006398225702366
Offset: 0

Views

Author

Keywords

Comments

a(21) was already correctly computed by Marc Deleglise in 2009 but in 2011 he withdrew his result because his verification failed. - Kim Walisch, Jun 06 2016

Examples

			The primes less than 10 give 2+3+5+7 = 17.
		

Crossrefs

Cf. A034387.

Programs

  • Mathematica
    Join[{0, s = 17}, Table[Do[If[PrimeQ[i], s += i], {i, 10^n + 1, 10^(n + 1), 2}]; s, {n, 7}]] (* Jayanta Basu, Jun 28 2013 *)
    Table[Sum[Prime[i], {i, PrimePi[10^n]}], {n, 0, 7}]  (* Kim Walisch, Dec 21 2017 *)
  • PARI
    a(n) = my(s=0); forprime(p=1, 10^n, s += p); s; \\ Michel Marcus, Jan 14 2015
    
  • Perl
    use ntheory ":all"; say "$ ",sum_primes(10**$) for 0..15; # Dana Jacobsen, May 04 2017

Formula

a(n) is about 100^n/(n log 100). - Charles R Greathouse IV, Jan 29 2013
a(n) = Sum_{i=2..10^n} A061397(i). - José de Jesús Camacho Medina, Aug 08 2016

Extensions

Corrected and extended by Jud McCranie
a(12) and a(13) from Cino Hilliard, Aug 14 2006
New value for a(13) from Cino Hilliard, Oct 24 2007
There was indeed an error in a(13) both in the entry here and in the b-file. This has now been corrected. - N. J. A. Sloane, Nov 23 2007
Two new values from Marc Deleglise, May 21 2008 - see the b-file.
a(21) from Marc Deleglise, Jun 29 2008 - see the b-file.
Nov 15 2011: Marc Deleglise has withdrawn his value for a(21).
a(21)-a(22) from Kim Walisch, Jun 06 2016
a(23) from Kim Walisch, Jun 11 2016
a(24) from David Baugh using Kim Walisch's primesum program, Jun 17 2016
a(25) from David Baugh using Kim Walisch's primesum program, Oct 16 2016
a(26) from Kim Walisch, May 25 2022, added by Lorenzo Pieri

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

Original entry on oeis.org

0, 0, 2, 5, 7, 12, 17, 24, 26, 29, 36, 47, 52, 65, 74, 82, 84, 101, 106, 125, 132, 142, 155, 178, 183, 188, 203, 206, 215, 244, 254, 285, 287, 301, 320, 332, 337, 374, 395, 411, 418, 459, 471, 514, 527, 535, 560, 607, 612, 619, 626, 646, 661, 714, 719, 735, 744, 766, 797, 856
Offset: 0

Views

Author

Keywords

Comments

For n > 2, sum of all distinct prime factors composing numbers from 2 to n.

References

  • M. Kalecki, On certain sums extended over primes or prime factors (in Polish), Prace Mat., Vol. 8 (1963/64), pp. 121-129.
  • József Sándor, Dragoslav S. Mitrinovic and Borislav Crstici, Handbook of Number Theory I, Springer Science & Business Media, 2005, Chapter IV, p. 144.

Crossrefs

Partial sums of A008472.

Programs

  • Magma
    [0] cat [ &+[ NthPrime(k)*Floor(n/NthPrime(k)): k in [1..n]]: n in [1..60]]; // Vincenzo Librandi, Jul 28 2019
    
  • Mathematica
    Join[{0}, Table[Sum[Prime[k] Floor[n / Prime[k]], {k, 1, n}], {n, 1, 60}]] (* Vincenzo Librandi, Jul 28 2019 *)
    Join[{0}, Accumulate[Table[Sum[p, {p, Select[Divisors[n], PrimeQ]}], {n, 1, 100}]]] (* Vaclav Kotesovec, May 20 2020 *)
  • PARI
    a(n) = sum(k=1, n, prime(k)*(n\prime(k))); \\ Michel Marcus, Mar 01 2015
    
  • PARI
    a(n)=my(s); forprime(p=2,n, s+=n\p*p); s \\ Charles R Greathouse IV, Jun 26 2020
    
  • Python
    from sympy import prime
    def A024924(n): return sum((p:=prime(k))*(n//p) for k in range(1,n+1)) # Chai Wah Wu, Sep 18 2023

Formula

a(n) = n*A000720(n) - A024934(n). - Max Alekseyev, Feb 10 2012
a(n) = A034387([n/1]) + A034387([n/2]) + ... + A034387([n/n]). Terms can be computed efficiently with the following formula: a(n) = A034387([n/1]) + ... + A034387([n/m]) - m*A034387([n/m]) + Sum_{prime p<=n/m} p*[n/p], where m = [sqrt(n)]. - Max Alekseyev, Feb 10 2012
G.f.: Sum_{k >=1} (prime(k)*x^prime(k)/(1-x^prime(k)))/(1-x). - Vladeta Jovovic, Aug 11 2004
a(n) ~ ((Pi^2 + o(1))/12) * n^2/log(n) (Kalecki, 1963/64). - Amiram Eldar, Mar 04 2021

Extensions

a(0)=0 prepended by Max Alekseyev, Feb 10 2012

A073837 Sum of primes p satisfying n <= p <= 2n.

Original entry on oeis.org

2, 5, 8, 12, 12, 18, 31, 24, 41, 60, 60, 72, 72, 59, 88, 119, 119, 102, 139, 120, 161, 204, 204, 228, 228, 228, 281, 281, 281, 311, 372, 341, 341, 408, 408, 479, 552, 515, 515, 594, 594, 636, 636, 593, 682, 682, 682, 635, 732, 732, 833, 936, 936, 990, 1099, 1099
Offset: 1

Views

Author

Amarnath Murthy, Aug 12 2002

Keywords

Comments

a(n) = A034387(2*n) - A034387(n-1); a(n) <= A179213(n). [Reinhard Zumkeller, Jul 05 2010]

Examples

			a(7) = 31 = 7+11+13 (sum of primes between 7 and 14).
		

Crossrefs

Cf. A073838.

Programs

  • Maple
    for n from 1 to 150 do l := 0:for j from n to 2*n do if isprime(j) then l := l+j:fi:od:a[n] := l:od:seq(a[j],j=1..150);
  • Mathematica
    Table[Total[Select[Range[n, 2 n], PrimeQ]], {n, 56}] (* Jayanta Basu, Aug 12 2013 *)
  • PARI
    a(n)=sum(i=n,2*n,i*isprime(i))

Extensions

More terms from Sascha Kurz and Benoit Cloitre, Aug 14 2002

A066779 Sum of squarefree numbers <= n.

Original entry on oeis.org

1, 3, 6, 6, 11, 17, 24, 24, 24, 34, 45, 45, 58, 72, 87, 87, 104, 104, 123, 123, 144, 166, 189, 189, 189, 215, 215, 215, 244, 274, 305, 305, 338, 372, 407, 407, 444, 482, 521, 521, 562, 604, 647, 647, 647, 693, 740, 740, 740, 740, 791, 791, 844, 844, 899, 899
Offset: 1

Views

Author

Benoit Cloitre, Jan 18 2002

Keywords

References

  • D. Suryanarayana, The number and sum of k-free integers <= x which are prime to n, Indian J. Math., Vol. 11 (1969), pp. 131-139.

Crossrefs

Programs

  • Mathematica
    Table[ n*Boole[ SquareFreeQ[n] ], {n, 1, 56}] // Accumulate (* Jean-François Alcover, Jun 18 2013 *)
  • PARI
    s=0; for (n=1, 1000, write("b066779.txt", n, " ", s+=moebius(n)^2*n) ) \\ Harry J. Smith, Mar 24 2010
    
  • PARI
    a(n)=sum(d=1,sqrtint(n),moebius(d)*d^2*binomial(n\d^2+1,2)) \\ Charles R Greathouse IV, Apr 26 2012
    
  • PARI
    a(n)=my(s,k2); forsquarefree(k=1,sqrtint(n), k2=k[1]^2; s+= k2*binomial(n\k2+1,2)*moebius(k)); s \\ Charles R Greathouse IV, Jan 08 2018
    
  • Python
    from sympy.ntheory.factor_  import core
    def a(n): return sum ([i for i in range(1, n + 1) if core(i) == i]) # Indranil Ghosh, Apr 16 2017

Formula

a(n) = Sum_{i=1..n} mu(i)^2*i.
a(n) = Sum_{k=1..n} k*A008966(k). - Reinhard Zumkeller, Jul 05 2010
a(n) = Sum_{d=1..sqrt(n)} mu(d)*d^2*floor(n/d^2)*floor(n/d^2+1)/2. - Charles R Greathouse IV, Apr 26 2012
G.f.: Sum_{k>=1} mu(k)^2*k*x^k/(1 - x). - Ilya Gutkovskiy, Apr 16 2017
a(n) ~ (3/Pi^2) * n^2 + O(n^(3/2)) (Suryanarayana, 1969). - Amiram Eldar, Mar 07 2021

A063956 Sum of unitary prime divisors of n.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Sep 04 2001

Keywords

Examples

			The prime divisors of 420 = 2^2 * 3 * 5 * 7. Among them, those that have exponent 1 (i.e., unitary prime divisors) are {3, 5, 7}, so a(420) = 3 + 5 + 7 = 15.
		

Crossrefs

Programs

  • Mathematica
    Table[DivisorSum[n, # &, And[PrimeQ@ #, GCD[#, n/#] == 1] &], {n, 81}] (* Michael De Vlieger, Feb 17 2019 *)
    f[p_, e_] := If[e == 1, p, 0]; a[1] = 0; a[n_] := Plus @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jul 24 2024 *)
    Join[{0},Table[Total[Select[FactorInteger[n],#[[2]]==1&][[;;,1]]],{n,2,100}]] (* Harvey P. Dale, Jan 26 2025 *)
  • PARI
    { for (n=1, 1000, f=factor(n)~; a=0; for (i=1, length(f), if (f[2, i]==1, a+=f[1, i])); write("b063956.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 04 2009

Formula

a(n*m) = a(n) + a(m) - a(gcd(n^2, m)) - a(gcd(n, m^2)) for all n and m > 0 (conjecture). - Velin Yanev, Feb 17 2019
From Amiram Eldar, Jul 24 2024: (Start)
a(n) = A008472(n) - A063958(n).
Additive with a(p^e) = p is e = 1, and 0 otherwise. (End)

Extensions

Example clarified by Harvey P. Dale, Jan 26 2025

A101203 a(n) = sum of nonprimes <= n.

Original entry on oeis.org

0, 1, 1, 1, 5, 5, 11, 11, 19, 28, 38, 38, 50, 50, 64, 79, 95, 95, 113, 113, 133, 154, 176, 176, 200, 225, 251, 278, 306, 306, 336, 336, 368, 401, 435, 470, 506, 506, 544, 583, 623, 623, 665, 665, 709, 754, 800, 800, 848, 897, 947, 998, 1050, 1050, 1104, 1159, 1215
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 23 2005

Keywords

Crossrefs

Partial sums of A191558.

Programs

  • Haskell
    a101203 n = a101203_list !! (n-1)
    a101203_list = scanl (+) 0 $ zipWith (*) [1..] $ map (1 -) a010051_list
    -- Reinhard Zumkeller, Oct 10 2013
  • Mathematica
    Accumulate[Table[If[PrimeQ[n],0,n],{n,0,60}]] (* Harvey P. Dale, Oct 02 2020 *)
  • PARI
    my(s=0); for(k=0,100,if(!isprime(k),s+=k);print1(s", ")); \\ Cino Hilliard, Feb 04 2006
    

Formula

a(n) = A000217(n) - A034387(n) = A101256(n) + 1.

A158662 Sum of primes <= n if 1 is counted as a prime.

Original entry on oeis.org

1, 3, 6, 6, 11, 11, 18, 18, 18, 18, 29, 29, 42, 42, 42, 42, 59, 59, 78, 78, 78, 78, 101, 101, 101, 101, 101, 101, 130, 130, 161, 161, 161, 161, 161, 161, 198, 198, 198, 198, 239, 239, 282, 282, 282, 282, 329, 329, 329, 329, 329, 329
Offset: 1

Views

Author

Jaroslav Krizek, Mar 23 2009, Apr 12 2009

Keywords

Comments

a(n) = A034387(n) + 1. a(p) - a(p-1) = p, for p = primes (A000040), a(c) - a(c-1) = 0, for c = composite numbers (A002808).

Crossrefs

Programs

  • Mathematica
    Module[{nn=60,c},c=Join[{1},Prime[Range[PrimePi[nn]]]];Table[Total[ Select[ c,#<=n&]],{n,nn}]] (* Harvey P. Dale, Jun 01 2014 *)
    Accumulate[Join[{1},Table[If[PrimeQ[n],n,0],{n,60}]]] (* Harvey P. Dale, Feb 27 2017 *)

A182936 Greatest common divisor of the proper divisors of n, 0 if there are none.

Original entry on oeis.org

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

Views

Author

Peter Luschny, Mar 22 2011

Keywords

Comments

Here a proper divisor d of n is a divisor of n such that 1 < d < n.

Crossrefs

Programs

  • Maple
    A182936 := n -> igcd(op(numtheory[divisors](n) minus {1,n}));
    seq(A182936(i), i=1..79); # Peter Luschny, Mar 22 2011
  • Mathematica
    Join[{0}, Table[GCD@@Most[Rest[Divisors[n]]],{n,2,110}]] (* Harvey P. Dale, May 04 2018 *)
    (* From Peter Luschny, Jan 31 2025: (Start) *)
    Join[{0}, Table[Exp[MangoldtLambda[n]] - If[PrimeQ[n], n, 0], {n,2,110}]]
    (* or *)
    Table[Cyclotomic[n, 1] - If[PrimeQ[n], n, 0], {n,1,110}] (* End *)
  • PARI
    A182936(n) = { my(divs=divisors(n)); if(#divs<3,0,gcd(vector(numdiv(n)-2,k,divs[k+1]))); }; \\ Antti Karttunen, Sep 23 2017

Formula

a(n) = 0 if n is not composite, p if n is a proper power of prime p, and 1 otherwise. - Franklin T. Adams-Watters, Mar 22 2011
Conjecture: Sum_{k=1..n} a(k) = A072107(n) - A034387(n) - 1. - Vaclav Kotesovec, Jan 29 2025
From Peter Luschny, Jan 31 2025: (Start)
a(n) = A014963(n) - A061397(n) for n > 1. In other words, this sequence is the exponential von Mangoldt function restricted to proper divisors of n. See A380118. This implies the above conjecture.
a(n) = A020500(n) - A061397(n). (End)

Extensions

More terms from Antti Karttunen, Sep 23 2017

A051352 a(0) = 0; for n>0, a(n) = a(n-1) + n if n not prime else a(n-1) - n.

Original entry on oeis.org

0, 1, -1, -4, 0, -5, 1, -6, 2, 11, 21, 10, 22, 9, 23, 38, 54, 37, 55, 36, 56, 77, 99, 76, 100, 125, 151, 178, 206, 177, 207, 176, 208, 241, 275, 310, 346, 309, 347, 386, 426, 385, 427, 384, 428, 473, 519, 472, 520, 569, 619, 670, 722, 669, 723, 778
Offset: 0

Views

Author

Armand Turpel armandt(AT)unforgettable.com

Keywords

Comments

Sequence is not monotonic.
Difference between sum of nonprime numbers and prime numbers <= n. - Zak Seidov, Sep 27 2003

Crossrefs

Programs

  • Haskell
    a051352 n = a051352_list !! n
    a051352_list = 0 : zipWith (+)
       (a051352_list) (zipWith (*) [1..] $ map ((1 -) . (* 2)) a010051_list)
    -- Reinhard Zumkeller, Jan 02 2015
    
  • Maple
    A034387 := proc(n)
        option remember;
        if n <= 1 then
            0;
        else
            procname(n-1)+ `if`(isprime(n), n, 0)
        end if;
    end proc:
    A051352 := proc(n)
        n*(n+1)/2 - 2*A034387(n) ;
    end proc:
    seq(A051352(n),n=0..40) ; # R. J. Mathar, Jun 26 2024
  • Mathematica
    a[0]=0;a[n_]:=a[n]=If[PrimeQ[n],a[n-1]-n,a[n-1]+n]; Table[a[i], {i,0,60}] (* Harvey P. Dale, Apr 07 2011 *)
    nxt[{n_,a_}]:={n+1,If[PrimeQ[n+1],a-n-1,a+n+1]}; NestList[nxt,{0,0},60][[All,2]] (* Harvey P. Dale, Sep 07 2022 *)
  • PARI
    a(n) = my(v=primes([1, n])); n*(n+1)/2 -2*vecsum(v); \\ Michel Marcus, Jun 24 2024

Formula

a(n) = a(n-1) + n * (1 - 2*A010051(n)) = a(n-1) + n * (2*A005171(n) - 1) = a(n-1) + n * (A005171(n) - A010051(n)). - Reinhard Zumkeller, Nov 25 2009
a(n) = A000217(n) - 2*A034387(n). - Michel Marcus, Jun 24 2024
Previous Showing 11-20 of 54 results. Next