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.

A182235 Terms of A091666 in the order of their first appearances.

Original entry on oeis.org

1, 2, 4, 6, 12, 10, 18, 28, 22, 16, 42, 24, 36, 30, 52, 40, 34, 48, 70, 58, 46, 60, 54, 66, 72, 64, 78, 76, 102, 82, 84, 88, 130, 96, 150, 114, 100, 94, 106, 120, 90, 148, 108, 112, 156, 126, 144, 132, 136, 166, 124, 204, 118, 160, 138, 142, 172, 162, 192, 202
Offset: 1

Views

Author

Zak Seidov, Apr 20 2012

Keywords

Comments

No terms = 2 mod 6 larger than 2.

Examples

			a(1)=1=A091666(1), a(4)=6=A091666(5), a(5)=12=A091666(9), a(6)=10=A091666(16).
		

Crossrefs

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]

A133517 Smallest k such that p(n)^3 - k is prime where p(n) is the n-th prime.

Original entry on oeis.org

1, 4, 12, 6, 4, 18, 4, 2, 4, 10, 2, 2, 4, 14, 10, 4, 22, 38, 2, 28, 14, 12, 4, 22, 24, 4, 14, 24, 2, 10, 14, 4, 16, 12, 10, 2, 12, 30, 10, 16, 48, 18, 10, 20, 30, 42, 2, 14, 4, 26, 18, 10, 2, 10, 4, 4, 16, 12, 2, 34, 24, 58, 30, 4, 38, 6, 14, 14, 10, 12, 36, 6, 2, 24, 68, 4, 6, 26, 10
Offset: 1

Views

Author

Carl R. White, Sep 14 2007

Keywords

Examples

			p(4)=7, 7^3 = 343; for odd k and n > 1, p(n)^r - k is even and thus not prime, so we only need consider even k.
for k = 2: 343 - 2 = 341, which is 11 * 31 and not prime.
for k = 4: 343 - 4 = 339, which is 3 * 113, also not prime.
for k = 6: 343 - 6 = 337, which is prime, so 6 is the smallest number that can be subtracted from 343 to make another prime.
Hence a(4) = 6.
		

Crossrefs

Programs

  • Mathematica
    sk[n_]:=With[{c=Prime[n]^3},c-NextPrime[c,-1]]; Array[sk,80] (* Harvey P. Dale, May 07 2019 *)
  • PARI
    a(n) = {k = 0; while (! isprime(prime(n)^3 - k), k++); return (k);} \\Michel Marcus, Aug 02 2013

A133518 Smallest k such that p(n)^3 + k is prime where p(n) is the n-th prime.

Original entry on oeis.org

3, 2, 2, 4, 30, 6, 6, 4, 30, 2, 12, 18, 6, 24, 14, 14, 12, 10, 16, 2, 6, 4, 2, 14, 54, 6, 4, 18, 4, 2, 30, 26, 56, 10, 24, 12, 24, 10, 30, 2, 18, 6, 26, 24, 14, 28, 18, 10, 14, 10, 12, 24, 16, 6, 18, 2, 20, 6, 4, 12, 4, 6, 10, 2, 6, 14, 16, 4, 18, 10, 14, 14, 16, 24, 4, 12, 32, 16, 50, 12, 2
Offset: 1

Views

Author

Carl R. White, Sep 14 2007

Keywords

Examples

			p(1)=2, 2^3 = 8. for even k, 2^r + k is even and thus not prime, so we only need consider odd k.
for k = 1: 8 + 1 = 9, which is 3^2 and not prime.
for k = 3: 8 + 3 = 11, which is prime, so 3 is the smallest number that can be added to 8 to make a new prime.
Hence a(1) = 3.
		

Crossrefs

Programs

  • Magma
    [NextPrime(p^3)-p^3: p in PrimesUpTo(500)]; // Bruno Berselli, Sep 03 2013
  • Mathematica
    Table[NextPrime[Prime[n]^3] - Prime[n]^3, {n, 100}] (* Bruno Berselli, Sep 03 2013 *)
  • PARI
    a(n) = {k = 0; p3 = prime(n)^3; while (! isprime(p3+k), k++); k;} \\ Michel Marcus, Sep 03 2013
    
  • PARI
    a(n) = {p3 = prime(n)^3; nextprime(p3) - p3;} \\ Michel Marcus, Sep 03 2013
    

A133519 Smallest k such that p(n)^4 - k is prime where p(n) is the n-th prime.

Original entry on oeis.org

3, 2, 6, 2, 2, 2, 24, 14, 18, 2, 8, 8, 2, 2, 12, 2, 2, 24, 24, 38, 2, 8, 2, 54, 12, 2, 12, 12, 44, 18, 14, 18, 12, 32, 12, 24, 38, 14, 12, 12, 54, 2, 50, 8, 32, 8, 12, 14, 24, 8, 8, 2, 2, 12, 18, 30, 50, 12, 2, 24, 12, 2, 32, 2, 84, 12, 8, 12, 8, 74, 14, 18, 2, 20, 24, 14, 2, 14, 14, 2, 18
Offset: 1

Views

Author

Carl R. White, Sep 14 2007

Keywords

Examples

			p(3)=5, 5^4 = 625; for odd k and n > 1, p(n)^r - k is even and thus not prime, so we only need consider even k.
for k = 2: 625 - 2 = 623, which is 7 * 89 and not prime.
for k = 4: 625 - 4 = 621, which is 3^3 * 23, also not prime.
for k = 6: 625 - 6 = 619, which is prime, so 6 is the smallest number that can be subtracted from 625 to make another prime.
Hence a(3) = 6.
		

Crossrefs

Programs

  • Mathematica
    sk[p_]:=Module[{k=1,c=p^4},While[CompositeQ[c-k],k++];k]; sk/@Prime[Range[100]] (* Harvey P. Dale, Nov 19 2023 *)
    Table[With[{c=p^4},c-NextPrime[c,-1]],{p,Prime[Range[100]]}] (* Harvey P. Dale, Nov 20 2023 *)

A133520 Smallest k such that p(n)^4 + k is prime where p(n) is the n-th prime.

Original entry on oeis.org

1, 2, 6, 10, 12, 10, 16, 16, 6, 12, 18, 16, 12, 28, 6, 22, 6, 16, 6, 16, 6, 16, 30, 6, 16, 42, 22, 42, 28, 52, 22, 16, 28, 10, 28, 70, 30, 42, 78, 36, 12, 42, 6, 12, 40, 12, 12, 16, 16, 16, 18, 10, 6, 22, 60, 46, 76, 46, 18, 126, 12, 22, 22, 6, 16, 16, 22, 18, 120, 22, 12, 6, 6, 36
Offset: 1

Views

Author

Carl R. White, Sep 14 2007

Keywords

Examples

			p(2)=3, 3^4 = 81; for odd k and n > 1, p(n)^r + k is even and thus not prime, so we only need consider even k.
for k = 2: 81 + 2 = 83, which is prime, so 2 is the smallest number that can be added to 81 to make a new prime.
Hence a(2) = 2.
		

Crossrefs

Programs

  • Mathematica
    NextPrime[#]-#&/@(Prime[Range[80]]^4) (* Harvey P. Dale, May 17 2015 *)

A133521 Smallest k such that p(n)^5 - k is prime where p(n) is the n-th prime.

Original entry on oeis.org

1, 2, 4, 20, 4, 2, 18, 18, 16, 6, 2, 6, 24, 12, 36, 22, 10, 8, 8, 24, 20, 86, 22, 6, 18, 42, 26, 6, 50, 52, 20, 12, 48, 2, 196, 68, 18, 14, 16, 16, 18, 2, 10, 6, 16, 38, 2, 36, 6, 2, 16, 42, 18, 42, 40, 34, 22, 2, 38, 4, 36, 52, 26, 132, 36, 28, 24, 74, 46, 36, 4, 16, 8, 24, 80, 16
Offset: 1

Views

Author

Carl R. White, Sep 14 2007

Keywords

Examples

			p(10)=29, 29^5 = 20511149; for odd k and n > 1, p(n)^r - k is even and thus not prime, so we only need consider even k.
for k = 2: 20511149 - 2 = 20511147, which is 3 * 23 * 297263 and not prime.
for k = 4: 20511149 - 4 = 20511145, which is 5 * 4102229, also not prime.
for k = 6: 20511149 - 6 = 20511141, which is prime, so 6 is the smallest number that can be subtracted from 20511149 to make another prime.
Hence a(10) = 6.
		

Crossrefs

Programs

  • Mathematica
    #-NextPrime[#,-1]&/@(Prime[Range[80]]^5) (* Harvey P. Dale, Sep 27 2020 *)

A133522 Smallest k such that p(n)^5 + k is prime where p(n) is the n-th prime.

Original entry on oeis.org

5, 8, 12, 4, 2, 6, 20, 22, 8, 8, 12, 22, 26, 30, 20, 20, 74, 52, 22, 26, 4, 22, 6, 42, 40, 8, 58, 44, 42, 8, 40, 6, 36, 28, 2, 28, 6, 4, 20, 14, 2, 12, 8, 46, 2, 40, 10, 4, 110, 12, 18, 44, 42, 6, 24, 20, 8, 28, 46, 2, 18, 6, 60, 36, 24, 2, 18, 4, 24, 48, 6, 30, 6, 6, 22, 6, 2, 6, 2, 40, 2
Offset: 1

Views

Author

Carl R. White, Sep 14 2007

Keywords

Examples

			p(2)=3, 3^5 = 243; for odd k and n > 1, p(n)^r - k is even and thus not prime, so we only need consider even k.
for k = 2: 243 + 2 = 245, which is 5 * 7^2 and not prime.
for k = 4: 243 + 4 = 247, which is 13 * 19, also not prime.
for k = 6: 243 + 6 = 249, which is 3 * 83, also not prime.
for k = 8: 243 + 8 = 251, which is prime, so 8 is the smallest number that can be added to 243 to make another prime.
Hence a(2) = 8.
		

Crossrefs

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

Original entry on oeis.org

1, 2, 4, 6, 10, 12, 16, 18, 22, 24, 28, 30, 34, 36, 40, 42, 46, 48, 52, 54, 58, 60, 64, 66, 70, 72, 76, 78, 82, 84, 88, 90, 94, 96, 100, 102, 106, 108, 112, 114, 118, 120, 124, 126, 130, 132, 136, 138, 142, 144, 148, 150, 154, 156, 160, 162, 166, 168, 172, 174
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, or 4.
The similarity to A047233 is understood by a comment in A091666. - R. J. Mathar, Oct 28 2013

Crossrefs

Cf. A000040 (primes), A001248 (primes squared).
Cf. A004277 (conjecturally, possible gaps between adjacent primes).
Cf. A091666 (prime greater than prime(n)^2).
Cf. A229488 (possible differences between prime(k)^2 and the previous prime).

Programs

  • Mathematica
    t = Table[p2 = Prime[k]^2; NextPrime[p2] - p2, {k, 100000}]; Take[Union[t], 60]
    NextPrime[#]-#&/@(Prime[Range[100000]]^2)//Union (* Harvey P. Dale, Apr 19 2020 *)
Showing 1-9 of 9 results.