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

A099825 Sum of the first 2^n primes.

Original entry on oeis.org

2, 5, 17, 77, 381, 1851, 8893, 41741, 191755, 868151, 3875933, 17120309, 74950547, 325590115, 1405167561, 6029676711, 25750781177, 109495928099, 463852117169, 1958476902435, 8244703036797, 34615624751259, 144991244981985, 605994279458465, 2527803622205465
Offset: 0

Views

Author

Robert G. Wilson v, Oct 25 2004

Keywords

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; f[0] = 2; f[n_] := f[n] = Block[{k = 0, mx = 2^n/2, np = Prime[2^n/2], s = f[n - 1]}, While[k < mx, k++; np = NextPrim@np; s = s + np]; s]; Table[ f@n, {n, 0, 23}] (* Robert G. Wilson v, Aug 24 2006 *)
    Module[{nn=22,ap},ap=Accumulate[Prime[Range[2^nn]]];Table[ap[[2^n]],{n,0,nn}]] (* Harvey P. Dale, Apr 12 2017 *)
  • PARI
    a(n)=my(s); n=2^n; forprime(p=2,, s+=p; if(n--==0, return(s))) \\ Charles R Greathouse IV, Feb 16 2017 \\ corrected by David A. Corneth, Aug 05 2025

Formula

a(n) = A007504(A000079(n)). - Amiram Eldar, Jul 01 2024

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).

A099826 Sum of the first 3^n primes.

Original entry on oeis.org

2, 10, 100, 1264, 15116, 171148, 1864190, 19697700, 203534530, 2067129306, 20706364528, 205144046742, 2014349179358, 19632546354498, 190150622868298, 1831906588192414, 17567504017456404, 167794196312059488, 1597037992049539274
Offset: 0

Views

Author

Robert G. Wilson v, Oct 25 2004

Keywords

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; k = p = 1; s = 0; Do[ While[p = NextPrim[p]; s = s + p; k < 10^n, k++ ]; k++; Print[s], {n, 0, 16}]

Formula

a(n) = A007504(A000244(n)). - Amiram Eldar, Jul 01 2024

Extensions

More terms from Cino Hilliard, Jan 14 2006

A134182 Difference between the sums of the first 10^n odd primes and the first 10^n odd positive integers > 1.

Original entry on oeis.org

38, 14478, 2688838, 396250152, 52261798440, 6472980453364, 770530574266708, 89262852894258444, 10138479465982004008, 1134379338819040693132, 125436174619351016716668, 13738971133578180130155676, 1493061976858459711065006050, 161191473337955042966337346114
Offset: 1

Views

Author

Enoch Haga, Oct 13 2007

Keywords

Comments

Original name: 10^n-th difference between cumulative prime and odd sums.
Beginning at 3, compute the sums of the prime and odd sequences at 10^n and take the difference.

Examples

			a(1) = (3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 + 29 + 31) - (3 + 5 + 7 + 9 + 11 + 13 + 15 + 17 + 19 + 21) = 158 - 120 = 38.
a(2) = 14478 because at 10^2, 100 sums of primes and odds, the prime sum is 24678, the odd sum is 10200 and the difference is 14478.
		

Crossrefs

Programs

  • UBASIC
    10 N=1: A=2
    20 A=nxtprm(A): B=B+A
    30 N=N+2: D=D+N
    40 if C=9 then print A;N;B;D;B-D: stop
    50 C=C+1: if C<10 then 20

Formula

a(n) = A134181(10^n).
a(n) = A099824(n) + prime(10^n+1) - (10^n*(10^n+2)) - 2. - Chai Wah Wu, Mar 30 2020
a(n) = A071148(10^n) - (10^n+1)^2 + 1, where A071148 are the partial sums of odd primes, and N^2 is the sum of the first N odd integers. - M. F. Hasler, Aug 08 2025

Extensions

Edited by M. F. Hasler, Aug 08 2025

A113489 Composite numbers of the form "Sum of the first 10^k primes".

Original entry on oeis.org

129, 3682913, 496165411, 62260698721, 7472966967499, 99262851056183695, 1234379338586942892505, 135436174616790289414111, 14738971133550183905879827, 1593061976858155930556059673, 171191473337951767580578821529, 18305009217958957209544913346089
Offset: 1

Views

Author

Cino Hilliard, Jan 09 2006

Keywords

Examples

			The first 10^10 primes add up to 1234379338586942892505, which is composite.
		

Crossrefs

Composite terms of A099824.

Programs

Extensions

Terms a(8) and beyond from David Baugh, Sep 27 2016

A131558 Primes which are the sum of the first 10^k primes for some k.

Original entry on oeis.org

2, 24133, 870530414842019, 11138479445180240497, 1948856725874605823462196012533593
Offset: 1

Views

Author

Cino Hilliard, Aug 27 2007

Keywords

Comments

Also numbers n such that A099824(n) is prime.

Examples

			The sum of the first 10^1 primes is 129 which is not prime and not in the sequence. The sum of the first 10^9 primes is 11138479445180240497 which is prime and in the sequence.
		

Crossrefs

Cf. A099824.

Programs

  • PARI
    sm=0;  ct=0;  p=1;  bb=1;
    { while ( 1,
        p = nextprime(p+1);  sm += p;  ct++;
        if ( (ct==bb), if ( isprime(sm),print1(sm,", ")); bb*=10; );
    ); }

Extensions

a(5) from David Baugh, Sep 27 2016

A222558 Least prime p such that 2*n*p is a sum of 10^6 subsequent primes.

Original entry on oeis.org

3736971300983, 1868582442157, 1245659681423, 934275734321, 747425233469, 622762733249, 534156162737, 467093343419, 415824854441, 373728877943, 339743670103, 311538175027, 287741107327, 266994001331, 249114901193, 233613943273, 219815919913, 208214150917
Offset: 1

Views

Author

Zak Seidov, Feb 25 2013

Keywords

Comments

Indices of first primes are: 64, 89, 65, 81, 84, 13, 338, 35, 768, 105, 91, 256, 537, 186, 32, 174, 51, 1469, 519, 277, 2132, 232, 241, 310, 179, 744, 1835, 535, 787, 167, 664, 1538, 1253, 484, 620, 1450, 961, 649, 1472, 166, 480, 918, 107, 418, 173, 370, 871, 1967, 71, 534.
First primes are: 311, 461, 313, 419, 433, 41, 2273, 149, 5849, 571, 467, 1619, 3877, 1109, 131, 1033, 233, 12281, 3719, 1787, 18671, 1459, 1523, 2053, 1063, 5653, 15737, 3853, 6037, 991, 4967, 12917, 10211, 3461, 4583, 12109, 7573, 4817, 12323, 983, 3413, 7187, 587, 2887, 1031, 2531, 6763, 17047, 353, 3851.

Examples

			a(1) = 3736971300983 = (p(64)+...+p(1000063))/2 = (311 + ... + 15486871)/2.
a(2) = 1868582442157 = (p(89)+...+p(1000088))/4 = (461 + ... + 15487253)/4.
		

Crossrefs

Programs

  • Mathematica
    Do[s = 7472966967499 ; a = 2; b = 15485863; Do[s = s - a + (b = NextPrime[b]); a = NextPrime[a]; If[PrimeQ[s/m] , Print[{m, k, a, b, s/m}]; Break[]], {k, 2, 10^6}], {m, 2, 100, 2}]

A301599 Numbers k at which the ratio r(k) = (k-th prime) / (average of first k primes) reaches a record high.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 9, 10, 12, 17, 25, 31, 35, 48
Offset: 1

Views

Author

Jon E. Schoenfield, Mar 24 2018

Keywords

Comments

Equivalently, define the function f(k) = k*prime(k)/Sum_{j=1..k} prime(j); sequence lists numbers k such that f(k) > f(m) for all m < k.
a(14)=48 is the final term. Beyond k=48, r(k) decreases fairly smoothly (although nonmonotonically); see the Example section.
For m = 4..18, the first k > 48 at which r(k) < 2 - 1/m is 50, 53, 61, 775, 2678, 8973, 23483, 63535, 159863, 431988, 1091840, 2753459, 7186422, 18479367, 47260890, respectively. Does lim_{k->inf} r(k) equal 2? - Jon E. Schoenfield, Mar 27 2018

Examples

			The table below shows k, prime(k), the sum and average of the first k primes, and r(k), for each number k in the sequence, and also for k = 100, 1000, ..., 10^7.
.
   n|   a(n)=k  prime(k)             sum         avg    r(k)
  --+--------------------------------------------------------
   1|        1         2               2        2.000 1.00000
   2|        2         3               5        2.500 1.20000
   3|        3         5              10        3.333 1.50000
   4|        4         7              17        4.250 1.64706
   5|        5        11              28        5.600 1.96429
   6|        7        17              58        8.286 2.05172
   7|        9        23             100       11.111 2.07000
   8|       10        29             129       12.900 2.24806
   9|       12        37             197       16.417 2.25381
  10|       17        59             440       25.882 2.27955
  11|       25        97            1060       42.400 2.28774
  12|       31       127            1720       55.484 2.28895
  13|       35       149            2276       65.029 2.29130
  14|       48       223            4661       97.104 2.29650
           100       541           24133      241.330 2.24174
          1000      7919         3682913     3682.913 2.15020
         10000    104729       496165411    49616.541 2.11077
        100000   1299709     62260698721   622606.987 2.08753
       1000000  15485863   7472966967499  7472966.967 2.07225
      10000000 179424673 870530414842019 87053041.484 2.06110
		

Crossrefs

Cf. A000040 (primes), A007504 (sum of first n primes), A006988 ((10^n)-th prime), A099824 (sum of first 10^n primes).
Showing 1-8 of 8 results.