A158038 Difference between n-th prime and next cube.
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
Keywords
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)
Links
- M. F. Hasler, Table of n, a(n) for n = 1..1000
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
Comments