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 51-60 of 114 results. Next

A061235 Number of primes between n^4 and (n+1)^4.

Original entry on oeis.org

0, 6, 16, 32, 60, 96, 147, 207, 283, 382, 486, 619, 773, 945, 1139, 1351, 1610, 1870, 2165, 2496, 2848, 3237, 3653, 4125, 4572, 5118, 5698, 6269, 6894, 7586, 8309, 9033, 9907, 10656, 11616, 12522, 13509, 14552, 15639, 16708, 18009, 19140, 20527
Offset: 0

Views

Author

Amarnath Murthy, Apr 23 2001

Keywords

Examples

			a(3) = 32, as the number of primes between 3^4 = 81 and 4^4 = 256 is 32.
		

Crossrefs

Programs

  • Magma
    [0] cat [#PrimesInInterval(n^4, (n+1)^4): n in [1..50]]; // Vincenzo Librandi, Apr 30 2017
  • Mathematica
    Table[PrimePi[(w+1)^4]-PrimePi[w^4], {w, 0, 100}]
  • PARI
    a(n) = primepi((n+1)^4) - primepi(n^4); \\ Michel Marcus, Apr 29 2017
    

Extensions

More terms from Labos Elemer, Jul 10 2001
Edited for consistency by Peter Munn, Apr 28 2017

A062517 Number of primes between n^5 and (n+1)^5.

Original entry on oeis.org

0, 11, 42, 119, 273, 540, 954, 1573, 2456, 3624, 5181, 7177, 9666, 12797, 16514, 21098, 26454, 32836, 40134, 48760, 58508, 69714, 82277, 96723, 112702, 130639, 150488, 172617, 197039, 223915, 253318, 285540, 320450, 358839, 400159, 445011, 493504
Offset: 0

Views

Author

Labos Elemer, Jul 10 2001

Keywords

Examples

			a(1) = 11 the number of primes between 1 = 1^5 and 32 = 2^5.
		

Crossrefs

Programs

  • Mathematica
    Table[PrimePi[(w+1)^5]-PrimePi[w^5], {w, 0, 50}]
  • PARI
    a(n) = { primepi((n + 1)^5) - primepi((n)^5) } \\ Harry J. Smith, Aug 08 2009

Extensions

Edited for consistency by Peter Munn, Apr 30 2017

A076957 Smallest k such that there are exactly n primes strictly between k^2 and (k+1)^2.

Original entry on oeis.org

1, 4, 6, 10, 15, 16, 25, 24, 31, 39, 38, 45, 64, 48, 52, 57, 75, 82, 81, 70, 76, 79, 106, 112, 145, 111, 121, 117, 123, 134, 144, 139, 146, 154, 163, 192, 169, 176, 179, 193, 202, 218, 204, 226, 223, 240, 233, 238, 243, 259, 291, 256, 286, 309, 278
Offset: 2

Views

Author

Amarnath Murthy, Oct 20 2002

Keywords

Comments

From David W. Wilson, Jan 08 2017: (Start)
a(n)^2 = A076956(n).
A014085(a(n)) = n.
Conjecturally, a(n) is undefined for n = 1 and defined for all n >= 2. (End)

Crossrefs

Programs

  • Maple
    a := proc(n) local k, h, SEARCHLIMIT; SEARCHLIMIT := 10000; h := proc(k) option remember; nops(select(j->isprime(j), [$k^2+1..(k+1)^2])) end: k := 1; while h(k) <> n and k < SEARCHLIMIT do k := k+1 od; `if`(k=SEARCHLIMIT, print("Search limit reached!"), k) end: seq(a(n), n=2..56); # Peter Luschny, Jan 10 2017
  • Mathematica
    Table[k = 1; While[Count[Map[PrimeQ, Range[k^2 + 1, (k + 1)^2]], True] != n, k++]; k, {n, 2, 56}] (* Michael De Vlieger, Jan 10 2017 *)
    With[{pp=Table[Count[Range[n^2+1,(n+1)^2-1],?(PrimeQ[#]&)],{n,500}]},Table[ Position[pp,k,1,1],{k,60}]]//Flatten (* _Harvey P. Dale, Aug 01 2021 *)

Extensions

More terms from Ralf Stephan, Oct 31 2002

A091591 Number of pairs of twin primes between n^2 and (n+1)^2.

Original entry on oeis.org

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

Views

Author

Hugo Pfoertner, Jan 22 2004

Keywords

Comments

a(1) and a(2) are omitted because they are dependent on the treatment of the twin pair (3,5). It is conjectured that a(n)>0 for all n>122. Proving this would also prove the twin prime conjecture.
Proving a(n)>0 for n>122 would also prove Legendre's conjecture that there is a prime between n^2 and (n+1)^2. - T. D. Noe, Feb 28 2007

Examples

			a(3)=1 because the interval [3^2,4^2] contains one pair of twins (11,13).
a(9)=0 because the interval [9^2,10^2] is one of the few known intervals (given in A091592) not containing twin primes.
		

Crossrefs

Cf. A014085 (number of primes between n^2 and (n+1)^2)

Programs

A117896 Number of perfect powers between consecutive squares n^2 and (n+1)^2.

Original entry on oeis.org

0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0
Offset: 1

Views

Author

T. D. Noe, Mar 31 2006, Feb 15 2010

Keywords

Comments

a(n)=2 only 14 times for n^2 < 2^63. What is the least n such that a(n)=3? Is a(n) bounded?

Examples

			a(5)=2 because powers 27 and 32 are between 25 and 36.
		

Crossrefs

Cf. A001597 (perfect powers), A014085 (primes between squares), A097055, A097056, A117934.

Programs

  • Mathematica
    nn=151^2; powers=Join[{1}, Union[Flatten[Table[n^i, {i,Prime[Range[PrimePi[Log[2,nn]]]]}, {n,2,nn^(1/i)}]]]]; t=Table[0,{Sqrt[nn]-1}]; Do[n=Floor[Sqrt[i]]; If[i>n^2, t[[n]]++], {i,powers}]; t (* revised, T. D. Noe, Apr 19 2011 *)
  • PARI
    a(n)=my(k);-sum(e=3,2*log(n+1)\log(2),k=round((n+1/2)^(2/e))^e;if(n^2Charles R Greathouse IV, Dec 19 2011

Formula

Trivially, a(n) << log n/log log n. Turk gives a(n) << sqrt(log n) and Loxton improves this to a(n) <= exp(40 sqrt(log log n log log log n)). Stewart improves the constant from 40 to 30 and conjectures that a(n) < 3 for all but finitely many n. - Charles R Greathouse IV, Dec 11 2012

A144831 (n+1)^2 - (smallest prime > n^2).

Original entry on oeis.org

2, 4, 5, 8, 7, 12, 11, 14, 17, 20, 17, 20, 23, 28, 29, 32, 31, 30, 33, 40, 41, 42, 35, 48, 45, 52, 51, 54, 47, 54, 57, 58, 65, 62, 67, 72, 71, 74, 77, 80, 71, 72, 75, 76, 89, 80, 91, 92, 89, 98, 95, 102, 97, 108, 99, 112, 113, 110, 109, 114, 117, 122, 107, 126, 127, 132, 131
Offset: 1

Views

Author

Enoch Haga, Sep 21 2008

Keywords

Comments

Suggested by Conjecture 60 in Carlos Rivera's The Prime Puzzles & Problems Connection.
Legendre's conjecture that there is always a prime between n^2 and (n+1)^2 is equivalent to a(n) >= 0 for all n. As the conjecture is still opened, it is not proved that a(n) is nonn, although the keyword is automatically added. - Jean-Christophe Hervé, Oct 26 2013

Examples

			a(2)=4 because n=2, 2^2=4 and (2+1)^2=9. The gap in which primes are to be found is 4 - 9. Next prime=5 and 9-5=4. For a(3)=5, 3^2=9 and (3+1)^2=16. Next prime=11 and 16-11=5.
		

Crossrefs

Programs

  • Mathematica
    Table[n^2-NextPrime[(n-1)^2],{n,2,70}] (* Harvey P. Dale, Jan 22 2019 *)
  • PARI
    a(n) = (n+1)^2 - nextprime(n^2); \\ Michel Marcus, Jun 08 2014

Formula

Calculate n^2 and (n+1)^2, e.g. 4 - 9. Find the next prime following n^2 and subtract from (n+1)^2. Next prime is 5 so 9-5=4, the distance from next prime to (n+1)^2.
a(n) = (n+1)^2 - A007491(n).

Extensions

Definition rewritten by N. J. A. Sloane, Sep 28 2008
Definition rewritten by Jean-Christophe Hervé, Oct 26 2013

A161622 Denominators of the ratios (in lowest terms) of numbers of primes in one square interval to that of the interval and its successor.

Original entry on oeis.org

2, 2, 5, 5, 3, 7, 7, 7, 8, 9, 9, 2, 9, 5, 13, 12, 11, 2, 13, 2, 2, 13, 5, 17, 15, 15, 17, 17, 2, 9, 19, 19, 19, 19, 19, 2, 7, 23, 23, 23, 20, 7, 23, 24, 23, 23, 28, 5, 21, 26, 31, 7, 25, 24, 23, 29, 30, 29, 2, 29, 30, 32, 29, 15, 31, 2, 32, 30, 34, 12, 2, 32, 2, 35, 20, 18, 16, 41, 36, 33
Offset: 1

Views

Author

Daniel Tisdale, Jun 14 2009

Keywords

Comments

The numerators are derived from sequence A014085.
The expression is: R(n) = (PrimePi((n+1)^2) - PrimePi(n^2))/(PrimePi((n+2)^2) - PrimePi(n^2)).
The first few ratios are 1/2, 2/5, 3/5, 1/3, 4/7, ...
Conjecture: lim_{n->infinity} R(n) = 1/2. See also more extensive comment entered with sequence of numerators. This conjecture implies Legendre's conjecture.

Examples

			R(3) = (PrimePi(4^2)-PrimePi(3^2)) / (PrimePi(5^2)-PrimePi(3^2)) = (PrimePi(16)-PrimePi(9)) / (PrimePi(25)-PrimePi(9)) = (6-4)/(9-4) = 2/5. Hence a(3) = 5. - _Klaus Brockhaus_, Jun 15 2009
		

Crossrefs

Cf. A014085.
Cf. A161621 (numerators). - Klaus Brockhaus, Jun 15 2009

Programs

  • Magma
    [ Denominator((#PrimesUpTo((n+1)^2) - a) / (#PrimesUpTo((n+2)^2) - a)) where a is #PrimesUpTo(n^2): n in [1..80] ]; // Klaus Brockhaus, Jun 15 2009

Extensions

a(1) inserted and extended beyond a(11) by Klaus Brockhaus, Jun 15 2009

A185150 Number of odd primes p between n^2 and (n+1)^2 with (n/p) = 1, where (-) is the Legendre symbol.

Original entry on oeis.org

1, 1, 2, 3, 2, 2, 2, 3, 3, 1, 4, 2, 4, 3, 5, 7, 2, 3, 4, 6, 5, 3, 3, 4, 8, 5, 4, 5, 4, 4, 6, 6, 6, 4, 9, 9, 7, 7, 5, 6, 7, 5, 9, 5, 7, 3, 9, 6, 10, 6, 10, 6, 8, 8, 7, 7, 10, 3, 12, 8, 7, 10, 8, 14, 11, 7, 10, 10, 5, 9, 11, 8, 7, 9, 9, 18, 11, 11, 12, 9, 20, 6, 13, 6, 10, 9, 13, 9, 8, 10, 10, 12, 12, 6, 13, 9, 12, 12, 8, 23
Offset: 1

Views

Author

Zhi-Wei Sun, Dec 29 2012

Keywords

Comments

Conjecture: a(n)>0 for all n>0.
This is a refinement of Legendre's conjecture that for each n=1,2,3,... the interval (n^2,(n+1)^2) contains a prime.
We have verified the conjecture for n up to 10^9.
Zhi-Wei Sun also made some similar conjectures involving primes and Legendre symbols, below are few examples:
(1) If n>10 then there is a prime p between n^2 and (n+1)^2 with (n/p) = ((1-n)/p) = 1. If n>2 is different from 7 and 17, then there is a prime p between n^2 and (n+1)^2 with (n/p) = ((n+1)/p) = 1. If n>1 is not equal to 27, then there is a prime p between n^2 and (n+1)^2 with (n/p) = ((n+2)/p) = 1.
(2) If n>2 is different from 6, 12, 58, then there is a prime p between n^2 and n^2+n such that (n/p) = 1. If n>20 is not a square, and different from 37 and 77, then there is a prime p between n^2 and n^2+n such that (n/p) = -1.
(3) For each n=15,16,... there is a prime p between n and 2n such that (n/p) = 1. If n>0 is not a square, then
there is a prime p between n and 2n such that (n/p) = -1.

Examples

			a(10)=1 since 107 is the only prime p between 10^2 and 11^2 with (10/p) = 1.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[n^2+k>2&&PrimeQ[n^2+k]==True&&JacobiSymbol[n,n^2+k]==1,1,0],{k,1,2n}]
    Do[Print[n," ",a[n]],{n,1,100}]

A191225 Number of Ramanujan primes R_k between triangular numbers T(n-1) < R_k <= T(n).

Original entry on oeis.org

0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 2, 0, 2, 1, 1, 2, 1, 2, 0, 2, 3, 2, 1, 2, 2, 2, 1, 4, 2, 2, 1, 0, 4, 3, 5, 1, 3, 2, 1, 5, 1, 2, 3, 4, 4, 4, 2, 2, 2, 4, 2, 3, 4, 3, 5, 4, 3, 2, 5, 4, 2, 5, 1, 6, 1, 5, 5, 7, 2, 2, 1, 10, 6, 6, 2, 2, 5, 0, 3, 7, 5, 4, 6, 7, 4
Offset: 1

Views

Author

John W. Nicholson, May 27 2011

Keywords

Comments

The function eta(x), A191228, returns the greatest value of k of R_k <= x, and where R_k is the k-th Ramanujan prime (A104272).

Examples

			Write the numbers 1, 2, ... in a triangle with n terms in the n-th row; a(n) = number of Ramanujan primes in n-th row.
Triangle begins
1                 (0 Ramanujan primes, eta(1) = 0)
2  3              (1 Ramanujan primes, eta(3) - eta(1) = 1)
4  5  6           (0 Ramanujan primes, eta(6) - eta(3) = 0)
7  8  9  10       (0 Ramanujan primes, eta(10) - eta(6) = 0)
11 12 13 14 15    (1 Ramanujan primes, eta(15) - eta(10) = 1)
16 17 18 19 20 21 (1 Ramanujan primes, eta(21) - eta(15) = 1)
		

Crossrefs

Programs

  • Mathematica
    terms = 100; nn = terms^2; R = Table[0, {nn}]; s = 0;
    Do[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; If[s < nn, R[[s+1]] = k], {k, Prime[3 nn]}];
    A104272 = R + 1;
    eta = Table[Boole[MemberQ[A104272, k]], {k, 1, nn}] // Accumulate;
    T[n_] := n(n+1)/2;
    a[1] = 0; a[n_] := eta[[T[n]]] - eta[[T[n-1]]];
    Array[a, terms] (* Jean-François Alcover, Nov 07 2018, using T. D. Noe's code for A104272 *)
  • Perl
    use ntheory ":all"; sub a191225 { my $n = shift; ramanujan_prime_count( (($n-1)*$n)/2+1, ($n*($n+1))/2 ); } say a191225($) for 1..10; # _Dana Jacobsen, Dec 30 2015

Formula

a(n) = eta(T(n))- eta(T(n-1)).

A333846 Numbers k such that the number of primes between k^2 and (k+1)^2 increases to a new record.

Original entry on oeis.org

0, 1, 4, 6, 10, 15, 16, 24, 31, 38, 45, 48, 52, 57, 70, 76, 79, 106, 111, 117, 123, 134, 139, 146, 154, 163, 169, 176, 179, 193, 202, 204, 223, 233, 238, 243, 256, 278, 284, 318, 326, 336, 359, 369, 412, 419, 430, 456, 458, 468, 479, 517, 550, 564, 595, 601, 612
Offset: 1

Views

Author

Bernard Schott, Apr 08 2020

Keywords

Comments

Legendre's conjecture (still open) states that for n > 0 there is always a prime between n^2 and (n+1)^2. The number of primes between n^2 and (n+1)^2 is equal to A014085(n), so, the corresponding records are given by A014085(a(n)) = 0, 2, 3, 4, 5, 6, 7, 9, 10, 12, 13, ... (A349996).
m = 25 is the smallest number such that there are exactly 8 primes between m^2 = 625 et (m+1)^2 = 676, namely {631, 641, 643, 647, 653, 659, 661, 673} but there are 9 primes between 24^2 = 576 et 25^2 = 625, namely {577, 587, 593, 599, 601, 607, 613, 617, 619} so 24 is a term but not 25; hence, 25 is the first term of A076957 that is not a record.
This sequence is infinite. Suppose for contradiction that a(n) = k was the last term, with s primes between k^2 and (k+1)^2. Then there are at most s primes between (k+1)^2 and (k+2)^2, at most s primes between (k+2)^2 and (k+3)^3, and at most s*sqrt(x) + pi(k^2) primes up to x. But there are ~ x/log x primes up to x by the Prime Number Theorem, a contradiction. This can be made sharp with various explicit estimates. - Charles R Greathouse IV, Apr 10 2020

Examples

			There are 7 primes between 16^2 and 17^2, i.e., 256 and 289, which are 257, 263, 269, 271, 277, 281, 283, and there does not exist k < 16 with 7 or more primes between k^2 and (k+1)^2, hence, 16 is in the sequence.
		

Crossrefs

Cf. A333241 (Similar records between k and (9/8)*k).

Programs

  • Mathematica
    primeCount[n_] := PrimePi[(n + 1)^2] - PrimePi[n^2]; pmax = -1; seq = {}; Do[p = primeCount[n]; If[p > pmax, pmax = p; AppendTo[seq, n]], {n, 0, 612}]; seq (* Amiram Eldar, Apr 08 2020 *)
  • PARI
    print1(pr=0,", ");pp=0;for(k=1,650,my(pc=primepi(k*k));if(pc-pp>pr,print1(k-1,", ");pr=pc-pp);pp=pc) \\ Hugo Pfoertner, Apr 10 2020

Extensions

More terms from Michel Marcus, Apr 08 2020
Previous Showing 51-60 of 114 results. Next