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 17 results. Next

A130739 Sum of primes < 2^n.

Original entry on oeis.org

0, 5, 17, 41, 160, 501, 1720, 6081, 22548, 80189, 289176, 1070091, 3908641, 14584641, 54056763, 202288087, 761593692, 2867816043, 10862883985, 41162256126, 156592635694, 596946687124, 2280311678414, 8729068693022
Offset: 1

Views

Author

Graeme McRae, Jul 06 2007

Keywords

Examples

			a(3) is 17 because the sum of primes less than 2^3 is 2+3+5+7=17.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[Prime[i], {i, PrimePi[2^n-1]}], {n, 1, 10}]
  • PARI
    a(n) = {s = 0; forprime(p=2, 2^n-1, s +=p); return (s);} \\ Michel Marcus, Jul 17 2013

Formula

a(n) = Sum_{i=2..2^n-1} A061397(i).

A092800 Mean (rounded) of primes below 10^n.

Original entry on oeis.org

4, 42, 453, 4668, 47372, 478361, 4820082, 48461680, 486543007, 4880365186, 48922874243, 490205054291, 4910186835993, 49170709786317, 492297202098380, 4928087057164426, 49325636340385940, 493651449428949382, 4940027276202057447, 49431711317962542892, 494600136049092471546
Offset: 1

Views

Author

Enoch Haga, Mar 06 2004

Keywords

Comments

Add primes and divide total by the count of primes below 10^n.

Examples

			a(7) = 4820082 because the mean of primes below 10^7 is 4820081.577...
		

Crossrefs

Formula

a(n) = round(A046731(n)/A006880(n)). - Robert G. Wilson v, Jan 19 2007

Extensions

a(9)-a(13) from Robert G. Wilson v, Jan 19 2007
a(14) onwards from Amiram Eldar, Jun 14 2024

A092802 Mean (rounded) of composite numbers below 10^n.

Original entry on oeis.org

7, 53, 510, 5047, 50279, 501844, 5012809, 50094049, 500720912, 5005703554, 50046261712, 500382762350, 5003219541311, 50027458290511, 500236958622730, 5002065769284422, 50018168989895296, 500161047150051653, 5001437349858735047, 50012907314623137795, 500116546694296773760
Offset: 1

Views

Author

Enoch Haga, Mar 06 2004

Keywords

Comments

As with the primes in A092800, each succeeding term seems a close multiple of that preceding.

Examples

			a(3) = 510 because the mean of composites below 10^3 is 510.087... .
		

Crossrefs

Formula

Add composites and divide total by the count of composites below 10^n.
a(n) = floor((10^n(10^n + 1)/2 - A046731(n) - 1)/(10^n - A006880(n) - 1)). - Charles R Greathouse IV, Sep 25 2008

Extensions

More terms from Charles R Greathouse IV, Sep 25 2008

A073224 Partial sum of Pi(k) from 1 to 10^n.

Original entry on oeis.org

27, 1465, 92041, 6554833, 504813055, 40947676475, 3442465670223, 296935715374179, 26108021958592999, 2329702677873323273, 210338403560373373799, 19172323465486902000641, 1761408925012566646647345, 162904914369466264400189781, 15152171905761023446344720303
Offset: 1

Views

Author

Robert G. Wilson v, Jul 20 2002

Keywords

Crossrefs

Programs

  • Mathematica
    s = 0; k = 1; Do[ While[ k <= 10^n, s = s + PrimePi[k]; k++ ]; Print[s], {n, 1, 8}]

Formula

a(n) = (10^n + 1) * A006880(n) - A046731(n). - Hiroaki Yamanouchi, Jul 06 2014

Extensions

a(9)-a(10) from Donovan Johnson, Dec 15 2009
a(11)-a(12) from Donovan Johnson, Mar 19 2011
a(13)-a(14) from Hiroaki Yamanouchi, Jul 06 2014

A136021 Sum of the proper prime divisors of all numbers up to 10^n.

Original entry on oeis.org

0, 19, 1047, 64373, 4481640, 340900331, 27436000061, 2292176360707, 196818634871899, 17246903703574357, 1534951275195670059, 138293592048140425181, 12583738258227621100170, 1154435823206834353336284, 106638384745041347295504523
Offset: 0

Views

Author

Enoch Haga, Dec 10 2007

Keywords

Comments

The sum of the distinct prime factors less than k for all 1 <= k <= 10^n, as tabulated for the individual k in A105221.

Examples

			a(1)=19 because 10^1=10 and the factors to be summed are 2 for 4, added to 2 and 3 for 6, added to 2 for 8, added to 3 for 9, added to 2 and 5 for 10.
		

Crossrefs

Programs

  • Maple
    A105221 := proc(n) local a,pfs,i ; a :=0 ; pfs := ifactors(n)[2] ; for i in pfs do if op(1,i) <> 1 and op(1,i) <> n then a := a+op(1,i) ; fi ; od: RETURN(a) ; end: A136021 := proc(n) add(A105221(i),i=2..10^n) ; end: for n from 1 do print(n,A136021(n)) ; od: # R. J. Mathar, Dec 12 2007
  • Mathematica
    f[n_] := Plus @@ (First@# & /@ FactorInteger@ n); k = 2; s = 0; lst = {}; Do[While[k < 10^n + 1, If[ ! PrimeQ@k, s = s + f@k]; k++ ]; AppendTo[ lst, s]; Print[{n, s}], {n, 8}] (* Robert G. Wilson v, Aug 06 2010 *)
  • UBASIC
    10 'distinct prime factors of composites <=10^n 20 S=0:N=N+1:Z=N\2 30 'print N; 40 for F=1 to Z:Q=N/F: if Q<>int(Q) then 60 50 S=S+F: if F=prmdiv(F) and F>1 then C=C+1:G=G+F 60 next F 70 'print C,G 80 if N=10^1 or N=10^2 or N=10^3 or N=10^4 or N=10^5 or N=10^6 or N=10^7 then print G:stop 90 C=0 100 goto 20

Formula

a(n) = Sum_{k=1..10^n} A105221(k). - R. J. Mathar, Dec 12 2007
a(n) = Sum_{prime p<10^n} p*floor((10^n-p)/p) = A006880(n)*10^n - A024934(10^n) - A046731(n). - Max Alekseyev, Jan 30 2012

Extensions

One more term from R. J. Mathar, Dec 12 2007
Edited by R. J. Mathar, Apr 17 2009
a(7) & a(8) from Robert G. Wilson v, Aug 06 2010
a(9)-a(11) from Max Alekseyev, Jan 30 2012
a(12)-a(14) from Hiroaki Yamanouchi, Jun 29 2014

A178221 Sum of the primes < n*10^6.

Original entry on oeis.org

37550402023, 142913828922, 312471072265, 544501644261, 838596693108, 1192390967254, 1607061425171, 2080483502248, 2613521583098, 3203324994356, 3853640069780, 4561368404019, 5326234575619, 6147376715980, 7026422648071
Offset: 1

Views

Author

Robert G. Wilson v, Jul 21 2010

Keywords

Crossrefs

Programs

  • Mathematica
    k = 1; p = 2; s = 0; lst = {}; While[k < 16, While[p < 10^6*k, s = s + p; p = NextPrime@ p]; k++; AppendTo[lst, s]]; lst

A139562 Sum of primes < n^2.

Original entry on oeis.org

0, 0, 5, 17, 41, 100, 160, 328, 501, 791, 1060, 1593, 2127, 2914, 3831, 4661, 6081, 7982, 9523, 11599, 13887, 16840, 20059, 23592, 26940, 32353, 37561, 42468, 48494, 55837, 62797, 70241, 80189, 89672, 100838, 111587, 124211, 136114, 148827
Offset: 0

Views

Author

Cino Hilliard, Jun 11 2008

Keywords

Comments

This is also the sum of primes <= n^2.
Pi(x) is the prime counting function or the number of primes <= x.
SumP(n) is the sum of primes <= n.
SumP(n) ~ Pi(n^2).
For large n, a(n) is closely approximated by Pi(n^4). E.g., for n = 55, SumP(55^2) = 605877 and Pi(55^4) = 611827 with error = 0.0098...
For n = 10^5, SumP(10) = 2220822432581729238 and Pi(10^20) = 2220819602560918840 with error = 0.0000012...

Examples

			For n = 3, n^2 = 9, the sum of primes <= 9 is 2+3+5+7 = 17 = a(3).
		

Crossrefs

First differences: A108314.

Programs

  • Mathematica
    Array[Sum[p,{p,Prime@Range@PrimePi[#^2-1]}]&,51,0]
    (* or *)
    Table[Total@Select[Range[n^2-1],PrimeQ],{n,0,50}] (* Giorgos Kalogeropoulos, Jul 27 2021 *)
  • PARI
    a(n) = sum(k=1, n^2, k*isprime(k)); \\ Michel Marcus, Jul 27 2021
    
  • Python
    from sympy import primerange
    def a(n): return sum(p for p in primerange(1, n*n))
    print([a(n) for n in range(39)]) # Michael S. Branicky, Jul 29 2021

Formula

a(n) = A034387(n^2) for n >= 1. - Alois P. Heinz, Jul 30 2021

Extensions

a(16) corrected by Michael S. Branicky, Jul 29 2021

A092849 Number of primes <= A092800(n).

Original entry on oeis.org

2, 13, 87, 631, 4884, 39876, 336756, 2914140, 25683614, 229595323, 2075911061, 18944394204, 174219183788, 1612626081244, 15010195375589, 140387627837380, 1318553324421089, 12430152478650578, 117566893367826528, 1115249538463126642, 10607400237283187171, 101131327003506262770, 966289700136857769743
Offset: 1

Views

Author

Enoch Haga, Mar 07 2004

Keywords

Examples

			Below 10^1 there are 4 primes: 2 + 3 + 5 + 7 = 17. The rounded mean is 17/4 =~ 4. There are 2 primes less than 4: 2 and 3, so a(1) = 2.
		

Crossrefs

Formula

a(n) = PrimePi(A092800(n)) = PrimePi(A046731(n)/A006880(n)). - Robert G. Wilson v, Jan 19 2007

Extensions

a(9)-a(13) from Robert G. Wilson v, Jan 19 2007
a(14)-a(23) from Amiram Eldar, Jun 14 2024

A092850 Number of primes between A092800(n) and 10^n.

Original entry on oeis.org

2, 12, 81, 598, 4708, 38622, 327823, 2847315, 25163920, 225457188, 2042143752, 18663517814, 171846353051, 1592315669558, 14834375047080, 138850713196545, 1305003833233144, 12309801809090282, 116490773908518079, 1105570064097792198, 10519869248735544757, 100335959685809643520
Offset: 1

Views

Author

Enoch Haga, Mar 07 2004

Keywords

Examples

			Below 10^1 there are 4 primes: 2 + 3 + 5 + 7 = 17. The rounded mean is 17/4 =~ 4. There are 2 primes > 4: 5 and 7, so a(1) = 2.
		

Crossrefs

Formula

a(n) = PrimePi(10^n) - PrimePi(A092800(n)) = PrimePi(10^n) - PrimePi(A046731(n)/A006880(n)). - Robert G. Wilson v, Jan 19 2007
a(n) = A006880(n) - A092849(n). - Amiram Eldar, Jun 14 2024

Extensions

a(9)-a(13) from Robert G. Wilson v, Jan 19 2007
a(14)-a(22) from Amiram Eldar, Jun 14 2024

A124202 a(n) = median of the largest prime dividing a random n-digit number.

Original entry on oeis.org

3, 12, 53, 229, 947, 3863, 15731, 63823, 258737
Offset: 1

Views

Author

Mark Thornquist (mthornqu(AT)fhcrc.org), Dec 07 2006

Keywords

Comments

A randomly selected n-digit number (uniformly distributed on 10^(n-1) to 10^n-1) has at least a 50% probability of having a prime factor at least as large as a(n).
For n >= 2 the number m = 9*10^(n-1) of n-digit numbers is even. The median is taken to be the average of the (m/2)-th and (m/2+1)-th of the sorted list of largest prime factors. - Robert Israel, Dec 11 2015

Examples

			The largest prime divisors of the nonunit 1-digit numbers are 2, 3, 2, 5, 3, 7, 2 and 3 respectively, with median 3.
Of the 90 2-digit numbers, there are 45 whose largest prime divisor is 11 or less and 45 whose largest prime divisor is 13 or greater, so any of 11, 12, or 13 could be used for the second term, although the arithmetic average of the endpoints is commonly used.
		

References

  • D. E. Knuth, The Art of Computer Programming, Seminumerical Algorithms, Addison-Wesley, Reading, MA, 1969, Vol. 2.

Crossrefs

Programs

  • GAUSS
    n = 1;
    a = 2 | 3 | 2 | 5 | 3 | 7 | 2 | 3;
    meana = meanc(a);
    mediana = median(a);
    format /rdn 1,0;
    print n;; "-digit numbers:";
    print " Median = ";; mediana;
    format /rdn 10,5;
    print " Mean = ";; meana;
    print;
    b = 1 | a;
    dim = 1;
    _01: wait;
    n = n+1;
    dim = 10*dim;
    a = b | zeros(9*dim,1);
    i = dim;
    do until i == 10*dim;
    if i == 2*floor(i/2);
    a[i] = a[i/2];
    else;
    p = firstp(i);
    if p == i;
    a[i] = i;
    else;
    a[i] = a[i/p];
    endif;
    endif;
    i = i+1;
    endo;
    b = a[dim:10*dim-1];
    meana = meanc(b);
    mediana = median(b);
    format /rdn 1,0;
    print n;; "-digit numbers:";
    print " Median = ";; mediana;
    format /rdn 10,5;
    print " Mean = ";; meana;
    print;
    b = a;
    goto _01;
    proc firstp(n);
    local i;
    i = 3;
    do until i > sqrt(n);
    if n == i*floor(n/i);
    retp(i);
    endif;
    i = i+2;
    endo;
    retp(n);
    endp;
    
  • MATLAB
    P = primes(10^8);
    L = zeros(1,10^8);
    for p = P
         L([p:p:10^8]) = p;
    end
    A(1) = median(L(2:9));
    for d = 2:8
        A(d) = median(L(10^(d-1):10^d-1));
    end
    A   % Robert Israel, Dec 11 2015
    
  • Maple
    seq(Statistics:-Median([seq(max(numtheory:-factorset(n)),n=10^(d-1)..10^d-1)]),d=1..7); # Robert Israel, Dec 11 2015
  • Mathematica
    f[n_] := Block[{k = If[n == 1, 1, 0], lst = {}, pt = 10^(n - 1)}, While[k < 9*pt, AppendTo[lst, FactorInteger[pt + k][[ -1, 1]]]; k++ ]; Median@ lst]; (* Robert G. Wilson v, Dec 14 2006 *)
  • Python
    from sympy import factorint
    from statistics import median
    def a(n):
      lb, ub = max(2, 10**(n-1)), 10**n
      return int(round(median([max(factorint(i)) for i in range(lb, ub)])))
    print([a(n) for n in range(1, 6)]) # Michael S. Branicky, Mar 12 2021

Extensions

Edited by Robert G. Wilson v, Dec 14 2006
a(8) from Robert Israel, Dec 11 2015
a(9) from Giovanni Resta, Apr 19 2016
Showing 1-10 of 17 results. Next