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

A014234 Largest prime <= 2^n.

Original entry on oeis.org

2, 3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139, 524287, 1048573, 2097143, 4194301, 8388593, 16777213, 33554393, 67108859, 134217689, 268435399, 536870909, 1073741789, 2147483647, 4294967291, 8589934583, 17179869143, 34359738337, 68719476731, 137438953447
Offset: 1

Views

Author

Keywords

Comments

For n>1 largest prime factor of the denominator of A027611(2^n) = 2^n*(2^n)-th harmonic number. - Alexander Adamchuk, Aug 02 2006

References

  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 2, p. 390.

Crossrefs

Cf. A013603 (2^n - a(n)).
See comment for the relationship to A027611.
These primes have indices A007053 = number of primes <= 2^n.
The opposite is A104080, delta A092131, indices A372684.
For squarefree instead of prime we have A372889, indices A143658.
A036378 counts primes between powers of 2, A293697 adds them up.

Programs

  • Maple
    a:= n-> prevprime(2^n+1):
    seq(a(n), n=1..40);  # Alois P. Heinz, Apr 23 2020
  • Mathematica
    PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; Table[ Abs[ PrevPrim[2^n]], {n, 1, 30} ]
    Join[{2},NextPrime[2^Range[2,40],-1]] (* Harvey P. Dale, Jun 26 2011 *)
  • PARI
    a(n) = precprime(2^n) \\ Michel Marcus, Aug 08 2013

Extensions

Terms for n=31, n=32 added by Fred Curtis (fred(AT)f2.org), Dec 08 2009

A104080 Smallest prime >= 2^n.

Original entry on oeis.org

2, 2, 5, 11, 17, 37, 67, 131, 257, 521, 1031, 2053, 4099, 8209, 16411, 32771, 65537, 131101, 262147, 524309, 1048583, 2097169, 4194319, 8388617, 16777259, 33554467, 67108879, 134217757, 268435459, 536870923, 1073741827, 2147483659
Offset: 0

Views

Author

Cino Hilliard, Mar 03 2005

Keywords

Crossrefs

Except initial terms and offset, same as A014210 and A203074.
The opposite (greatest prime <= 2^n) is A014234, indices A007053.
The distance from 2^n is A092131, opposite A013603.
Counting zeros instead of both bits gives A372474, cf. A035103, A211997.
Counting ones instead of both bits gives A372517, cf. A014499, A061712.
For squarefree instead of prime we have A372683, cf. A143658, A372540.
The indices of these prime are given by A372684.

Programs

Formula

a(n) = A014210(n), n <> 1. - R. J. Mathar, Oct 14 2008
Sum_{n >= 0} 1/a(n) = A338475 + 1/6 = 1.4070738... (because 1/6 = 1/2 - 1/3). - Bernard Schott, Nov 01 2020
From Gus Wiseman, Jun 03 2024: (Start)
a(n) = A007918(2^n).
a(n) = 2^n + A092131(n).
a(n) = prime(A372684(n)).
(End)

A293697 a(n) is the sum of prime numbers between 2^n+1 and 2^(n+1).

Original entry on oeis.org

2, 3, 12, 24, 119, 341, 1219, 4361, 16467, 57641, 208987, 780915, 2838550, 10676000, 39472122, 148231324, 559305605, 2106222351, 7995067942, 30299372141, 115430379568, 440354051430, 1683364991290, 6448757014608, 24754017328490, 95132828618112, 366232755206338
Offset: 0

Views

Author

Olivier Gérard, Oct 15 2017

Keywords

Examples

			From _Gus Wiseman_, Jun 02 2024: (Start)
Row-sums of:
   2
   3
   5   7
  11  13
  17  19  23  29  31
  37  41  43  47  53  59  61
  67  71  73  79  83  89  97 101 103 107 109 113 127
(End)
		

Crossrefs

Cf. A036378 (number of primes summed).
Cf. A293696 (triangle of partial sums).
Minimum is A014210 or A104080, indices A372684.
Maximum is A014234, delta A013603.
Counting all numbers (not just prime) gives A049775.
For squarefree instead of prime numbers we have A373123, length A077643.
For prime indices we have A373124.
Partial sums give A130739(n+1).

Programs

  • Mathematica
    Table[Plus @@
      Table[Prime[i], {i, PrimePi[2^(n)] + 1, PrimePi[2^(n + 1)]}], {n, 0,
       24}]

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

A086680 Number of primes < 4^n.

Original entry on oeis.org

0, 2, 6, 18, 54, 172, 564, 1900, 6542, 23000, 82025, 295947, 1077871, 3957809, 14630843, 54400028, 203280221, 762939111, 2874398515, 10866266172, 41203088796, 156661034233, 597116381732, 2280998753949, 8731188863470, 33483379603407, 128625503610475, 494890204904784
Offset: 0

Views

Author

Cino Hilliard, Jul 28 2003

Keywords

Comments

These numbers approximate the sum of primes < 2^n. The sum of primes < 2^20 = A130739(20) = 41162256126. The number of primes < 2^40 = 41203088796. The error is -0.000991993. From A007053, we have number of primes < 2^74 = 375744164937699609596 and sum of primes < 2^37 = 375743480734175191581 for an error of -0.0000018209325.

Examples

			a(2) = 6 because there are 6 primes, 2, 3, 5, 7, 11, and 13 that are < 4^2.
		

Crossrefs

Formula

a(n) = A007053(2*n). - Amiram Eldar, Jun 06 2024

Extensions

Extended by Cino Hilliard, Feb 13 2009
a(25)-a(27) from Amiram Eldar, Jun 06 2024

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

A139390 Sum of primes <= 3^n.

Original entry on oeis.org

0, 5, 17, 100, 791, 5830, 42468, 327198, 2575838, 20476640, 166554645, 1353822880, 11150031169, 92258920888, 769310640408, 6447635236133, 54292816788848, 459112338326268, 3896226837717653, 33172345145637461, 283258796052356059, 2425130743589880412, 20812174068479995267
Offset: 0

Views

Author

Cino Hilliard, Jun 09 2008

Keywords

Comments

For large n, these numbers can be closely approximated by the number of primes < (3^n)^2. For example, the sum of primes < 3^12 = 11150031169. The number of primes < (3^12)^2 = 3^24 = 11152818693. The error here 0.000250.
The second term, 5, is the addition of the primes 2 and 3 since we defined the sequence as less than or equal.

Crossrefs

Programs

  • PARI
    a(n) = vecsum(primes([1, 3^n])); \\ Michel Marcus, Jul 02 2024

Formula

a(n) = A034387(A000244(n)). - Amiram Eldar, Jul 02 2024

Extensions

Duplicated term removed and a(20)-a(22) added by Amiram Eldar, Jul 02 2024

A211548 Sum of primes below Fibonacci(n).

Original entry on oeis.org

0, 0, 0, 0, 2, 5, 17, 28, 77, 160, 381, 874, 2127, 5117, 12339, 30504, 74139, 182109, 443685, 1111475, 2735692, 6782748, 16853486, 42013901, 104671293, 262299143, 657330956, 1650934893, 4150915841, 10458898439, 26396485368
Offset: 0

Views

Author

Alex Ratushnyak, Jun 26 2012

Keywords

Comments

a(n)*100/a(n-1):
250, 340, 164, 275, 207, 238, 229, 243, 240, 241, 247, 243, 245, 243, 250, 246, 247, 248, 249, 249, 250, 250, 251, 251, 251, 252

Examples

			Fibonacci(8)=21, sum of primes below 21 is 2+3+5+7+11+13+17+19=77, so a(8)=77.
		

Crossrefs

Programs

  • Mathematica
    Table[Total[Prime[Range[PrimePi[Fibonacci[n]-1]]]],{n,0,30}] (* Harvey P. Dale, Nov 18 2018 *)

Formula

a(n) ~ phi^(2n)/(10n log phi) where phi = (1+sqrt(5))/2 is the golden ratio. - Charles R Greathouse IV, Jun 26 2012

A300692 Primes that are the sum of all primes up to some power of 2.

Original entry on oeis.org

2, 5, 17, 41, 202288087, 4394533064208947008756469709307
Offset: 1

Views

Author

Christoph Zurnieden, Apr 03 2018

Keywords

Comments

Elements in the sequence are certified primes.
The corresponding exponents of 2 are 1, 2, 3, 4, 16 and 54.

Examples

			17 is a term because the sum of all primes below 2^3 is 2+3+5+7 = 17 which is prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Array[Total@ Prime@ Range@ PrimePi[2^#] &, 27, 0], PrimeQ] (* Michael De Vlieger, Apr 10 2018 *)
  • PARI
    lista(nn) = {for (n=0, nn, s = 0; forprime(k=0, 2^n, s+=k); if (isprime(s), print1(s, ", ")));}

Formula

Numbers of the form Sum_{i=2..2^n-1} A061397(i) that are prime.
Showing 1-9 of 9 results.