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

A158038 Difference between n-th prime and next cube.

Original entry on oeis.org

6, 5, 3, 1, 16, 14, 10, 8, 4, 35, 33, 27, 23, 21, 17, 11, 5, 3, 58, 54, 52, 46, 42, 36, 28, 24, 22, 18, 16, 12, 89, 85, 79, 77, 67, 65, 59, 53, 49, 43, 37, 35, 25, 23, 19, 17, 5, 120, 116, 114, 110, 104, 102, 92, 86, 80, 74, 72, 66, 62, 60, 50, 36, 32, 30, 26, 12, 6, 165, 163
Offset: 1

Views

Author

Keywords

Comments

Could be read as a table, since there are always several primes between two cubes. Whenever a(n+1) > a(n), the n-th prime is the largest one below a given cube and prime(n+1) is the smallest prime larger than that cube. For n > 1, these are also the indices where the parity of the terms changes. - M. F. Hasler, Oct 19 2018

Examples

			The first terms are: 8 - 2 = 6, 8 - 3 = 5, 8 - 5 = 3, 8 - 7 = 1, 27 - 11 = 16, ...
From _M. F. Hasler_, Oct 19 2018: (Start)
Starting a new row when going to the next cube, the sequence reads:
  6, 5, 3, 1,                      // = 8 - {primes between 1^3 = 1 and 2^3 = 8}
  16, 14, 10, 8, 4,                // = 27 - {primes between 2^3 = 8 and 3^3 = 27}
  35, 33, 27, 23, 21, 17, 11, 5, 3, // = 64 - {primes between 27 and 4^3 = 64}
  58, 54, 52, ..., 18, 16, 12,     // = 125 - {primes between 64 and 5^3 = 125}
  89, 85, 79, ..., 19, 17, 5,      // = 216 - {primes between 125 and 6^3 = 216}
  120, 116, 114, ..., 26, 12, 6,   // = 343 - {primes between 216 and 7^3 = 343}
  etc. (End)
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=Prime[n];s=p^(1/3);f=Floor[s];a=(f+1)^3;d=a-p;AppendTo[lst,d],{n,6!}];lst
    nc[n_]:=(Floor[Surd[n,3]]+1)^3-n; Table[nc[n],{n,Prime[Range[70]]}] (* Harvey P. Dale, Jun 19 2014 *)
  • PARI
    A158038(n)=(sqrtnint(n=prime(n),3)+1)^3-n \\ M. F. Hasler, Oct 19 2018
    
  • PARI
    first(n) = my(res = vector(n), t = 0, c = 2, c3 = 8); forprime(p = 2, oo, t++; if(p > c3, c++; c3 = c^3); res[t] = c3 - p; if(t==n, return(res))) \\ David A. Corneth, Oct 19 2018

Formula

a(n) > 0. - David A. Corneth, Oct 19 2018

Extensions

Edited by M. F. Hasler, Oct 19 2018

A158037 A106044 sorted and duplicates removed.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78
Offset: 1

Views

Author

Keywords

Comments

All natural numbers except squares, 3^2=9, 4^2=16, 5^2=25, 6^2=36, 7^2=49, 8^2=64, ... are missing from the current sequence.

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=Prime[n];s=p^(1/2);f=Floor[s];a=(f+1)^2;d=a-p;AppendTo[lst,d],{n,7!}];Take[Union[lst],5! ]
    (Floor[Sqrt[#]]+1)^2-#&/@Prime[Range[500]]//Union (* Harvey P. Dale, Aug 02 2021 *)

A104493 Numbers n for which the cube excess of the n-th prime is prime.

Original entry on oeis.org

2, 5, 6, 8, 10, 19, 20, 23, 26, 28, 31, 48, 49, 50, 51, 52, 55, 56, 57, 59, 61, 65, 66, 99, 100, 105, 110, 112, 114, 117, 121, 125, 127, 170, 171, 173, 178, 184, 185, 186, 190, 192, 194, 196, 200, 201, 206, 208, 214, 270, 271, 272, 274, 277, 278, 279, 280, 282
Offset: 1

Views

Author

Jonathan Vos Post, Mar 19 2005

Keywords

Examples

			99 is an element of this sequence because the 99th prime is 523, 523 - 8^3 = 523-512 = 11 and 11 is prime. 100 is in this sequence because the 100th prime is 541 and 541-8^3 = 29, which is prime.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 1, p = Prime[n]}, While[k^3 < p, k++ ]; p - (k - 1)^3]; Select[ Range[ 284], PrimeQ[ f[ # ]] &] (* Robert G. Wilson v, Mar 19 2005 *)

Formula

n such that A055400(A000040(n)) is an element of A000040. n such that A104492(n) is prime.

Extensions

More terms from Robert G. Wilson v, Mar 19 2005
Showing 1-3 of 3 results.