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.

A339640 a(n) = (A062772(n) + A054270(n)) / 2 - A001248(n).

Original entry on oeis.org

0, 0, 1, 1, -1, 1, -1, 2, 3, 5, -1, 1, 0, 5, 1, 2, -1, 2, -1, 4, -1, -3, 2, 2, -1, 1, 1, 8, -4, 3, 4, 2, -4, 5, 10, -4, -4, -2, -1, 8, -1, -1, 5, -1, 3, -7, 4, 4, 1, 2, 1, 4, 5, 8, 8, 8, -1, 2, -4, -2, 3, 1, -8, -4, 1, -1, -4, 10, -2, 15, 8, 10, 2
Offset: 1

Views

Author

Dimitris Valianatos, Dec 11 2020

Keywords

Comments

Conjecture: The partial sums of this sequence are greater than or equal to zero. This means that the squares of the prime numbers are smaller than the average of the previous and the next prime number most of the time.

Examples

			For n = 10 prime(10)^2 = 29^2 = 841. The previous prime of 841 is 839 and the next 853. The average of 839 and 853 is (839 + 853)/2 = 846. So a(10) = 846 - 841 = 5.
		

Crossrefs

Programs

  • Maple
    f:= p -> (nextprime(p^2) + prevprime(p^2))/2 - p^2:
    map(f, [seq(ithprime(i),i=1..100)]); # Robert Israel, Nov 24 2024
  • Mathematica
    Array[(Total@ NextPrime[#, {-1, 1}])/2 - # &[Prime[#]^2] &, 73] (* Michael De Vlieger, Dec 11 2020 *)
  • PARI
    forprime(n = 2, 370, print1((nextprime(n^2) + precprime(n^2)) / 2 - n^2", "))

Formula

a(n) = (nextprime(prime(n)^2) + precprime(prime(n)^2)) / 2 - prime(n)^2.

A173926 First differences of A054270.

Original entry on oeis.org

4, 16, 24, 66, 54, 116, 76, 164, 316, 114, 414, 302, 178, 360, 596, 666, 250, 764, 556, 284, 906, 654, 1036, 1484, 790, 414, 840, 420, 896, 3364, 1032, 1598, 562, 2874, 594, 1844, 1930, 1322, 2044, 2102, 720, 3730, 764, 1560, 778, 4938, 5208, 1794, 912, 1854
Offset: 1

Views

Author

Zak Seidov, Nov 26 2010

Keywords

Crossrefs

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

Programs

  • Mathematica
    Differences[NextPrime[Prime[Range[60]]^2,-1]] (* Harvey P. Dale, May 19 2016 *)

A000879 Number of primes < prime(n)^2.

Original entry on oeis.org

2, 4, 9, 15, 30, 39, 61, 72, 99, 146, 162, 219, 263, 283, 329, 409, 487, 519, 609, 675, 705, 811, 886, 1000, 1163, 1252, 1294, 1381, 1423, 1523, 1877, 1976, 2141, 2190, 2489, 2547, 2729, 2915, 3043, 3241, 3436, 3512, 3868, 3945, 4089, 4164, 4627, 5106
Offset: 1

Views

Author

gandalf(AT)hrn.office.ssi.net (James D. Ausfahl)

Keywords

Comments

a(n) is the least index i such that A052180(i) = prime(n). - Labos Elemer, May 14 2003
Number of primes determined at the n-th step of the sieve of Eratosthenes. - Jean-Christophe Hervé, Oct 21 2013
There are only 3 squares in the current data: 4, 9, 7745089. - Michel Marcus, Apr 07 2018
There are no other squares up to a(780000). - Giovanni Resta, Apr 09 2018

Crossrefs

Cf. A050216 (first differences), A089609, A052180, A000720, A001248, A000885, A054270 (primes of rank a(n)).

Programs

  • Mathematica
    PrimePi[Prime[Range[50]]^2] (* Harvey P. Dale, Jan 16 2013 *)
  • PARI
    a(n) = primepi(prime(n)^2); \\ Michel Marcus, Oct 28 2013

Formula

a(n) = A000720(A001248(n)). - Michel Marcus, Apr 07 2018

Extensions

Edited by Ralf Stephan, Aug 24 2004

A054271 Difference between prime(n)^2 and the previous prime.

Original entry on oeis.org

1, 2, 2, 2, 8, 2, 6, 2, 6, 2, 8, 2, 12, 2, 2, 6, 12, 2, 6, 2, 6, 12, 6, 2, 6, 8, 2, 2, 14, 6, 2, 2, 12, 2, 8, 14, 18, 8, 6, 2, 12, 12, 2, 6, 6, 20, 2, 2, 8, 8, 2, 2, 8, 12, 2, 6, 8, 8, 12, 20, 12, 2, 20, 18, 2, 6, 14, 2, 8, 12, 8, 2, 6, 6, 12, 6, 18, 30, 12, 12, 18, 2, 8, 12, 24, 2, 2, 6, 14, 6
Offset: 1

Views

Author

Labos Elemer, May 05 2000

Keywords

Comments

From Jean-Christophe Hervé, Oct 22 2013: (Start)
Contains only even numbers, except the first term.
Even integers of the form 3*k+1 (or equivalently integers of form 6*k+4) never appear because prime(n)^2 = 3*k+1 = 1 (mod 3), and prime(n)^2 - (3*k+1) is multiple of 3.
Conjecture: every other even integer appears in the sequence an infinite number of times. (End)

Examples

			From _Zak Seidov_, Feb 20 2012: (Start)
n=4 and prime(4)^2=49, preceded by prime(15)=47, so a(4)=49-47=2;
n=97 and prime(97)^2=509^2=259081, preceded by prime(22765)=259033, so a(97)=259081-259033=48. (End)
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=Module[{n2=n^2},n2-NextPrime[n2,-1]]; f/@Prime[Range[90]] (* Harvey P. Dale, Oct 19 2011 *)
  • PARI
    a(n) = my(p=prime(n)); p^2 - precprime(p^2); \\ Michel Marcus, Feb 27 2023

Formula

a(n) = prime(n)^2 - precprime(prime(n)^2), where precprime(x) is the largest prime less than x. [Corrected by Jean-Christophe Hervé, Oct 21 2013]

A062772 Smallest prime larger than square of n-th prime.

Original entry on oeis.org

5, 11, 29, 53, 127, 173, 293, 367, 541, 853, 967, 1373, 1693, 1861, 2213, 2819, 3491, 3727, 4493, 5051, 5333, 6247, 6899, 7927, 9413, 10211, 10613, 11467, 11887, 12781, 16139, 17167, 18773, 19333, 22229, 22807, 24659, 26573, 27893, 29947, 32051
Offset: 1

Views

Author

Labos Elemer, Jul 18 2001

Keywords

Comments

Subsequence of A007491. - Zak Seidov, Apr 30 2015

Examples

			100th prime, 541 immediately follows 529, square of 9th prime.
		

Crossrefs

Cf. A007491. - Zak Seidov, Apr 30 2015

Programs

  • Maple
    with(numtheory): [seq(nextprime(ithprime(w)^2),w=1..100)];
  • Mathematica
    Array[NextPrime[Prime[#]^2] &, 41] (* Michael De Vlieger, Nov 02 2017 *)
  • PARI
    a(n) = { nextprime(prime(n)^2) } \\ Harry J. Smith, Aug 10 2009

Formula

a(n) = A007918(A001248(n)) = A151800(A001248(n)). - Michel Marcus, Jun 24 2014
a(n) = A007491(A000040(n)). - Zak Seidov, Apr 30 2015

A229488 Conjecturally, possible differences between prime(k)^2 and the previous prime for some k.

Original entry on oeis.org

1, 2, 6, 8, 12, 14, 18, 20, 24, 26, 30, 32, 38, 42, 44, 48, 50, 54, 56, 60, 62, 66, 68, 72, 74, 78, 80, 84, 86, 90, 92, 96, 98, 102, 104, 108, 110, 114, 116, 120, 122, 126, 128, 132, 134, 138, 140, 146, 150, 152, 156, 158, 162, 164, 168, 170, 174, 176, 180
Offset: 1

Views

Author

T. D. Noe, Oct 21 2013

Keywords

Comments

Are there any missing terms? The first 10^7 primes were examined. All these differences occur for some k < 10^5. Note that the first differences of these terms is 1, 2, 4, or 6.
From R. J. Mathar, Oct 29 2013: (Start)
This sequence of possible differences d= prime(k)^2 -q looks similar to A047238; 1 is an exception associated with the single even prime, 1=2^2-3.
[Reason: Otherwise primes are odd, squared primes are also odd, so the differences are even and therefore in the class {0,2,4} mod 6.
Furthermore primes are of the form 3n+1 or 3n+2, squared primes are of the form 9n^2+6n+1 or 9n^2+12n+4, so squared primes are of the form ==1 (mod 3).
The difference prime(k)^2-q is therefore the difference between a number ==1 (mod 3) and a number == {1,2} (mod 3) and therefore a number == {0,2} mod 3. This is never of the form 6n+4 ( == 1 mod 3). So the differences are in the class {0,2} mod 6, demonstrating that this is essentially a subsequence of A047238.]
Furthermore, differences 36, 144, 324,... of the form (6n)^2, A016910, appear in A047238 but not here, because prime(k)^2 -q=(6n)^2 is equivalent to prime(k)^2-(6n)^2 =q =(prime(k)+6n)*(prime(k)-6n), which requires an explicit factorization of the prime q. This is a contradiction if we assure that prime(k)-6n is not equal 1; if we scanned explicitly all primes up to prime(k)=10^7, for example, all (6n)^2 up to 6n<=10^7 are proved not to be in the sequence. (End)

Crossrefs

Cf. A000040 (primes), A001248 (primes squared).
Cf. A004277 (conjecturally, possible gaps between adjacent primes).
Cf. A054270 (prime below prime(n)^2).
Cf. A229489 (possible differences between prime(k)^2 and the next prime).

Programs

  • Mathematica
    t = Table[p2 = Prime[k]^2; p2 - NextPrime[p2, -1], {k, 100000}]; Take[Union[t], 60]

A062773 Index of the smallest prime which follows square of n-th prime.

Original entry on oeis.org

3, 5, 10, 16, 31, 40, 62, 73, 100, 147, 163, 220, 264, 284, 330, 410, 488, 520, 610, 676, 706, 812, 887, 1001, 1164, 1253, 1295, 1382, 1424, 1524, 1878, 1977, 2142, 2191, 2490, 2548, 2730, 2916, 3044, 3242, 3437, 3513, 3869, 3946, 4090, 4165, 4628
Offset: 1

Views

Author

Labos Elemer, Jul 18 2001

Keywords

Examples

			100th prime, 541 immediately follows 529, square of 9th prime, a(9)=100.
		

Crossrefs

Programs

  • Mathematica
    PrimePi[NextPrime[#]]&/@(Prime[Range[50]]^2) (* Harvey P. Dale, Apr 12 2023 *)
  • PARI
    a(n) = { primepi(prime(n)^2) + 1 } \\ Harry J. Smith, Aug 10 2009

Formula

a(n) = pi( nextprime( prime(n)^2 ) ).
a(n) = A000720(A062772(n)). - Michel Marcus, Jun 24 2014

Extensions

Offset changed from 0 to 1 by Harry J. Smith, Aug 10 2009

A382834 Smallest number k > P(n) - prime(n+1)^2 which is coprime to P(n), where P(n)= A002110(n) are the primorials.

Original entry on oeis.org

-5, -17, -17, 97, 2143, 29747, 510151, 9699167, 223092031, 6469692277, 200560488763, 7420738133141, 304250263525363, 13082761331667823, 614889782588488607, 32589158477190041261, 1922760350154212635351, 117288381359406970978787, 7858321551080267055874051
Offset: 1

Views

Author

Jakub Buczak, Apr 06 2025

Keywords

Comments

The difference d = P(n) - k is also coprime to P(n), and satisfies d < prime(n+1)^2, which means it must be prime since composite d would have at least one prime factor <= prime(n).
There is always at least one prime strictly between prime(n) and prime(n+1)^2, consequently d is the largest prime < prime(n+1)^2, and so a(n) = A002110(n) - A054270(n+1).
There are no negative terms after a(3).

Examples

			a(4) = 97, since 2*3*5*7 - 11^2 = 89, the smallest number coprime to 2*3*5*7 greater than 89 is 97.
a(2) = -17, since 2*3 - 5^2 = -19, the smallest number x>-19 coprime here is thus -17, and its difference d = 30 -(-17) = 47 is the largest prime < 7^2.
		

Crossrefs

Programs

  • PARI
    a(n) = my(P=vecprod(primes(n)), k=P-prime(n+1)^2+1); while (gcd(k,P)!=1, k++); k; \\ Michel Marcus, Apr 07 2025
Showing 1-8 of 8 results.