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

A348194 a(n) = A077767(n) - A077766(n).

Original entry on oeis.org

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

Views

Author

Seiichi Manyama, Oct 06 2021

Keywords

Crossrefs

Programs

  • PARI
    a(n) = sum(k=n^2, (n+1)^2, (isprime(k)&&k%4==3)-(isprime(k)&&k%4==1));

Formula

a(n) = A348193(n+1) - A348193(n).

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

Original entry on oeis.org

0, 2, 2, 2, 3, 2, 4, 3, 4, 3, 5, 4, 5, 5, 4, 6, 7, 5, 6, 6, 7, 7, 7, 6, 9, 8, 7, 8, 9, 8, 8, 10, 9, 10, 9, 10, 9, 9, 12, 11, 12, 11, 9, 12, 11, 13, 10, 13, 15, 10, 11, 15, 16, 12, 13, 11, 12, 17, 13, 16, 16, 13, 17, 15, 14, 16, 15, 15, 17, 13, 21, 15, 15, 17, 17, 18, 22, 14, 18, 23, 13
Offset: 0

Views

Author

Jon Wild, Jul 14 1997

Keywords

Comments

Suggested by Legendre's conjecture (still open) that for n > 0 there is always a prime between n^2 and (n+1)^2.
a(n) is the number of occurrences of n in A000006. - Philippe Deléham, Dec 17 2003
See the additional references and links mentioned in A143227. - Jonathan Sondow, Aug 03 2008
Legendre's conjecture may be written pi((n+1)^2) - pi(n^2) > 0 for all positive n, where pi(n) = A000720(n), [the prime counting function]. - Jonathan Vos Post, Jul 30 2008 [Comment corrected by Jonathan Sondow, Aug 15 2008]
Legendre's conjecture can be generalized as follows: for all integers n > 0 and all real numbers k > K, there is a prime in the range n^k to (n+1)^k. The constant K is conjectured to be log(127)/log(16). See A143935. - T. D. Noe, Sep 05 2008
For n > 0: number of occurrences of n^2 in A145445. - Reinhard Zumkeller, Jul 25 2014

Examples

			a(17) = 5 because between 17^2 and 18^2, i.e., 289 and 324, there are 5 primes (which are 293, 307, 311, 313, 317).
		

References

  • J. R. Goldman, The Queen of Mathematics, 1998, p. 82.

Crossrefs

First differences of A038107.
Counts of primes between consecutive higher powers: A060199, A061235, A062517.

Programs

  • Haskell
    a014085 n = sum $ map a010051 [n^2..(n+1)^2]
    -- Reinhard Zumkeller, Mar 18 2012
    
  • Mathematica
    Table[PrimePi[(n + 1)^2] - PrimePi[n^2], {n, 0, 80}] (* Lei Zhou, Dec 01 2005 *)
    Differences[PrimePi[Range[0,90]^2]] (* Harvey P. Dale, Nov 25 2015 *)
  • PARI
    a(n)=primepi((n+1)^2)-primepi(n^2) \\ Charles R Greathouse IV, Jun 15 2011
    
  • Python
    from sympy import primepi
    def a(n): return primepi((n+1)**2) - primepi(n**2)
    print([a(n) for n in range(81)]) # Michael S. Branicky, Jul 05 2021

Formula

a(n) = A000720((n+1)^2) - A000720(n^2). - Jonathan Vos Post, Jul 30 2008
a(n) = Sum_{k = n^2..(n+1)^2} A010051(k). - Reinhard Zumkeller, Mar 18 2012
Conjecture: for all n>1, abs(a(n)-(n/log(n))) < sqrt(n). - Alain Rocchelli, Sep 20 2023
Up to n=10^6 there are no counterexamples to this conjecture. - Hugo Pfoertner, Dec 16 2024
Sorenson & Webster show that a(n) > 0 for all 0 < n < 7.05 * 10^13. - Charles R Greathouse IV, Jan 31 2025

A077767 Number of primes of form 4k+3 between n^2 and (n+1)^2.

Original entry on oeis.org

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

Views

Author

T. D. Noe, Nov 20 2002

Keywords

Comments

Related to Legendre's conjecture that there is always a prime between two consecutive squares.

Examples

			a(8)=3 because primes 67, 71 and 79 are between squares 64 and 81
		

Crossrefs

Programs

A348193 (Number of primes == 3 mod 4 less than n^2) - (number of primes == 1 mod 4 less than n^2).

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 2, 1, 3, 2, 1, 3, 4, 3, 5, 5, 4, 3, 3, 3, 2, 3, 6, 6, 5, 5, 6, 4, 5, 5, 5, 5, 6, 4, 3, 3, 4, 3, 7, 12, 10, 7, 10, 8, 9, 10, 10, 7, 6, 6, 9, 8, 6, 6, 9, 6, 4, 9, 6, 8, 8, 7, 12, 11, 11, 9, 8, 9, 12, 9, 12, 17, 12, 13, 16, 12, 16, 18, 16, 15, 12, 12, 11, 17, 18, 14, 11, 13, 9, 5, 7, 7, 6, 7, 8, 7, 6, 8, 7, 10
Offset: 1

Views

Author

Seiichi Manyama, Oct 06 2021

Keywords

Comments

a(790) = -1.

Crossrefs

Programs

  • PARI
    a(n) = sum(k=2, n^2-1, (isprime(k)&&k%4==3)-(isprime(k)&&k%4==1));

Formula

a(n) = A348195(n) - A348196(n).

A077769 Number of times that the sum of two coprime squares of opposite parity is an integer between n^2 and (n+1)^2; multiple representations are counted multiply.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 2, 3, 4, 3, 2, 4, 5, 5, 3, 6, 5, 5, 7, 6, 7, 8, 9, 5, 6, 11, 7, 8, 8, 12, 9, 10, 12, 13, 11, 10, 11, 14, 11, 11, 13, 11, 17, 15, 12, 14, 18, 14, 15, 18, 18, 15, 16, 17, 18, 17, 20, 18, 19, 18, 19, 22, 20, 21, 17, 20, 21, 25, 18, 20, 23, 26, 24, 23, 23, 25, 28, 24, 24
Offset: 1

Views

Author

T. D. Noe, Nov 20 2002

Keywords

Comments

See A077768 for a similar, but less restrictive sequence. A077774 counts multiple representations only once. Note that by also requiring a unique representation, we obtain sequence A077766, which counts primes of the form 4k+1.

Examples

			a(8)=3 because 65=64+1, 65=49+16 and 73=64+9 are between squares 49 and 64. Note that 65 occurs twice.
		

Crossrefs

Programs

  • Mathematica
    maxN=100; lst={}; For[n=1, n<=maxN, n++, cnt=0; i=n; j=0; While[i>=j, j=1; While[i^2+j^2<(n+1)^2, If[i>=j&&i^2+j^2>n^2&&GCD[i, j]==1&&OddQ[i]==EvenQ[j], cnt++ ]; j++ ]; i--; j-- ]; AppendTo[lst, cnt]]; lst

A132657 a(n) is the product of the least prime > n^2 and the greatest prime < (n+1)^2.

Original entry on oeis.org

6, 35, 143, 391, 899, 1739, 3233, 5293, 8051, 11413, 17653, 24883, 33389, 43931, 56977, 72731, 92881, 118829, 145699, 176039, 212197, 254701, 308911, 357163, 424663, 492179, 566609, 660293, 756611, 864371, 987307, 1120697, 1257923
Offset: 1

Views

Author

Jonathan Vos Post, Nov 15 2007

Keywords

Examples

			a(1) = 6 = 2*3 = (smallest prime in [1^2,2^2]) * (largest prime in [1^2,2^2]).
a(2) = 35 = 5*7 = (smallest prime in [2^2,3^2]) * (largest prime in [2^2,3^2]).
		

Crossrefs

Programs

  • Maple
    seq(nextprime(n^2)*prevprime((n+1)^2,n=1..100); # Robert Israel, Jan 26 2020
  • Mathematica
    Table[Prime[PrimePi[n^2] + 1]*Prime[PrimePi[(n + 1)^2]], {n, 1, 40}] (* Stefan Steinerberger, Nov 20 2007 *)
    NextPrime[#[[1]]]NextPrime[#[[2]],-1]&/@Partition[Range[40]^2,2,1] (* Harvey P. Dale, Aug 27 2022 *)
  • PARI
    for(n=1,33,print1(nextprime(n^2)*precprime((n+1)^2),", ")) \\ Hugo Pfoertner, Jan 26 2020

Formula

a(n) = A007491(n) * A053001(n+1).

Extensions

More terms from Stefan Steinerberger, Nov 20 2007

A118492 Number of Gaussian primes with floor(abs(p)) = n.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Cf. A077766.

Formula

a(n) = A077766(n) + 1 if n is 1 or a prime = 3 (mod 4), A077766(n) otherwise.
Showing 1-7 of 7 results.