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.

A266548 Least prime p such that n + p^3 = x^2 + y^3 for some positive integers x and y, or 0 if no such prime p exists.

Original entry on oeis.org

71, 2, 2, 5, 2, 3767, 3, 7, 7, 2, 3, 23, 53, 13, 17, 13, 2, 3, 2, 7, 2, 23, 11, 2, 17, 2, 7, 5, 2, 2, 3, 19, 257, 8039, 13, 2, 2, 59, 3, 5, 17, 3, 2, 61, 2, 3, 3, 37, 313, 2, 631, 17, 5, 3, 17, 2, 17, 2, 7, 97, 2, 47, 3, 29, 2, 2, 31, 47, 2, 7, 19
Offset: 0

Views

Author

Zhi-Wei Sun, Dec 31 2015

Keywords

Comments

Conjecture: (i) Any integer can be written as x^2 + y^3 - p^3, where x and y are positive integers, and p is a prime.
(ii) Each integer can be written as x^2 - y^3 + p^3, where x and y are positive integers, and p is a prime.
See also A266230 and A266277 for related conjectures.
Is every prime in this sequence? - David A. Corneth, Dec 30 2017

Examples

			a(0) = 71 since 0 + 71^3 = 588^2 + 23^3 with 71 prime.
a(3) = 5 since 3 + 5^3 = 8^2 + 4^3 with 5 prime.
a(5) = 3767 since 5 + 3767^3 = 214886^2 + 1938^3 with 3767 prime.
a(2966) = 68371 since 2966 + 68371^3 = 17867983^2 + 6992^3 with 68371 prime.
a(7880) = 51137 since 7880 + 51137^3 = 10176509^2 + 31128^3 with 51137 prime.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=p[n]=Prime[n]
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]
    Do[x=1;Label[bb];Do[If[SQ[n+p[x]^3-y^3],Print[n," ",p[x]];Goto[aa]],{y,1,(n+p[x]^3-1)^(1/3)}];x=x+1;Goto[bb];Label[aa];Continue,{n,0,70}]
  • PARI
    isokp(p, n) = {my(s = n+p^3); for (k=1, sqrtnint(s, 3), if ((q=s-k^3) && issquare(q), return (1)););}
    a(n) = {p = 2; while(!isokp(p, n), p = nextprime(p+1)); p;} \\ Michel Marcus, Jan 04 2016
    
  • PARI
    a(n, {plim = 2}) = forprime(p = plim, oo, c = n + p^3; for(i = 1, sqrtnint(c, 3), if(issquare(c - i^3) && c - i^3 > 0, return(p))))
    first(n, {plim = 100}) = {my(res = vector(n), l = List(), s, i, c);
    for(u=1, sqrtint((n+plim^3)\1-1), for(v=1, sqrtnint((n+plim^3)\1-u^2, 3), listput(l, u^2+v^3))); l = Set(l); forprime(p = 2, plim, s = 1; while(l[s] < p^3 + 1, s++); for(i = s, #l, c = l[i] - p^3; if(c <= n, if(res[c] == 0, res[c] = p)
    , next(2)))); for(i = 1, n, if(res[i] == 0, res[i] = a(i, plim + 1))); concat([71], res)} \\ David A. Corneth, Dec 30 2017