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