CINXE.COM
A002407 - OEIS
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <head> <link rel="stylesheet" href="/styles.css"> <meta name="format-detection" content="telephone=no"> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name=viewport content="width=device-width, initial-scale=1"> <meta name="keywords" content="OEIS,integer sequences,Sloane" /> <title>A002407 - OEIS</title> <link rel="search" type="application/opensearchdescription+xml" title="OEIS" href="/oeis.xml"> <script> var myURL = "\/A002407" function redir() { var host = document.location.hostname; if(host != "oeis.org" && host != "127.0.0.1" && !/^([0-9.]+)$/.test(host) && host != "localhost" && host != "localhost.localdomain") { document.location = "https"+":"+"//"+"oeis"+".org/" + myURL; } } function sf() { if(document.location.pathname == "/" && document.f) document.f.q.focus(); } </script> </head> <body bgcolor=#ffffff onload="redir();sf()"> <div class=loginbar> <div class=login> <a href="/login?redirect=%2fA002407">login</a> </div> </div> <div class=center><div class=top> <center> <div class=donors> The OEIS is supported by <a href="http://oeisf.org/#DONATE">the many generous donors to the OEIS Foundation</a>. </div> <div class=banner> <a href="/"><img class=banner border="0" width="600" src="/banner2021.jpg" alt="A002407 - OEIS"></a> </div> </center> </div></div> <div class=center><div class=pagebody> <div class=searchbarcenter> <form name=f action="/search" method="GET"> <div class=searchbargreet> <div class=searchbar> <div class=searchq> <input class=searchbox maxLength=1024 name=q value="" title="Search Query"> </div> <div class=searchsubmit> <input type=submit value="Search" name=go> </div> <div class=hints> <span class=hints><a href="/hints.html">Hints</a></span> </div> </div> <div class=searchgreet> (Greetings from <a href="/welcome">The On-Line Encyclopedia of Integer Sequences</a>!) </div> </div> </form> </div> <div class=sequence> <div class=space1></div> <div class=line></div> <div class=seqhead> <div class=seqnumname> <div class=seqnum> A002407 </div> <div class=seqname> Cuban primes: primes which are the difference of two consecutive cubes. <br><font size=-1>(Formerly M4363 N1828)</font> </div> </div> <div class=scorerefs> 34 </div> </div> <div> <div class=seqdatabox> <div class=seqdata>7, 19, 37, 61, 127, 271, 331, 397, 547, 631, 919, 1657, 1801, 1951, 2269, 2437, 2791, 3169, 3571, 4219, 4447, 5167, 5419, 6211, 7057, 7351, 8269, 9241, 10267, 11719, 12097, 13267, 13669, 16651, 19441, 19927, 22447, 23497, 24571, 25117, 26227, 27361, 33391</div> <div class=seqdatalinks> (<a href="/A002407/list">list</a>; <a href="/A002407/graph">graph</a>; <a href="/search?q=A002407+-id:A002407">refs</a>; <a href="/A002407/listen">listen</a>; <a href="/history?seq=A002407">history</a>; <a href="/search?q=id:A002407&fmt=text">text</a>; <a href="/A002407/internal">internal format</a>) </div> </div> </div> <div class=entry> <div class=section> <div class=sectname>OFFSET</div> <div class=sectbody> <div class=sectline>1,1</div> </div> </div> <div class=section> <div class=sectname>COMMENTS</div> <div class=sectbody> <div class=sectline>Primes of the form p = (x^3 - y^3)/(x - y) where x=y+1. See <a href="/A007645" title="Generalized cuban primes: primes of the form x^2 + xy + y^2; or primes of the form x^2 + 3*y^2; or primes == 0 or 1 (mod 3).">A007645</a> for generalization. I first saw the name "cuban prime" in Cunningham (1923). Values of x are in <a href="/A002504" title="Numbers x such that 1 + 3*x*(x-1) is a ("cuban") prime (cf. A002407).">A002504</a> and y are in <a href="/A111251" title="Numbers k such that 3*k^2 + 3*k + 1 is prime.">A111251</a>. - <a href="/wiki/User:N._J._A._Sloane">N. J. A. Sloane</a>, Jan 29 2013</div> <div class=sectline>Prime hex numbers (cf. <a href="/A003215" title="Hex (or centered hexagonal) numbers: 3*n*(n+1)+1 (crystal ball sequence for hexagonal lattice).">A003215</a>).</div> <div class=sectline>Equivalently, primes of the form p=1+3k(k+1) (and then k=floor(sqrt(p/3))). Also: primes p such that n^2(p+n) is a cube for some n>0. - <a href="/wiki/User:M._F._Hasler">M. F. Hasler</a>, Nov 28 2007</div> <div class=sectline>Primes p such that 4p = 1+3s^2 for some integer s (<a href="/A121259" title="Numbers k such that (3*k^2 + 1)/4 is prime.">A121259</a>). - <a href="/wiki/User:Michael_Somos">Michael Somos</a>, Sep 15 2005</div> <div class=sectline>This sequence is believed to be infinite. - <a href="/wiki/User:N._J._A._Sloane">N. J. A. Sloane</a>, May 07 2020</div> </div> </div> <div class=section> <div class=sectname>REFERENCES</div> <div class=sectbody> <div class=sectline>Allan Joseph Champneys Cunningham, On quasi-Mersennian numbers, Mess. Math., 41 (1912), 119-146.</div> <div class=sectline>Allan Joseph Champneys Cunningham, Binomial Factorisations, Vols. 1-9, Hodgson, London, 1923-1929; see Vol. 1, pp. 245-259.</div> <div class=sectline>J.-M. De Koninck & A. Mercier, 1001 Probl猫mes en Th茅orie Classique des Nombres, Problem 241 pp. 39; 179, Ellipses Paris 2004.</div> <div class=sectline>N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).</div> <div class=sectline>N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).</div> </div> </div> <div class=section> <div class=sectname>LINKS</div> <div class=sectbody> <div class=sectline>David A. Corneth, <a href="/A002407/b002407.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from T. D. Noe)</div> <div class=sectline>A. J. C. Cunningham, <a href="/A002407/a002407.pdf">On quasi-Mersennian numbers</a>, Mess. Math., 41 (1912), 119-146. [Annotated scan of page 144 only]</div> <div class=sectline>A. J. C. Cunningham, <a href="/A001912/a001912.pdf">Binomial Factorisations</a>, Vols. 1-9, Hodgson, London, 1923-1929. [Annotated scans of a few pages from Volumes 1 and 2]</div> <div class=sectline>R. K. Guy, <a href="/A005728/a005728.pdf">Letter to N. J. A. Sloane, 1987</a>.</div> <div class=sectline>G. L. Honaker, Jr., <a href="https://t5k.org/curios/page.php?curio_id=22949">Prime curio for 127</a>.</div> <div class=sectline>Michael Penn, <a href="https://www.youtube.com/watch?v=3F49x2R9Bno">Nearly cubic primes.</a>, YouTube video, 2023.</div> <div class=sectline>Project Euler, <a href="https://projecteuler.net/problem=131">Problem 131: Prime cube partnership</a>.</div> <div class=sectline>Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/CubanPrime.html">Cuban Prime</a></div> <div class=sectline>Wikipedia, <a href="http://en.wikipedia.org/wiki/Cuban_prime">Cuban prime</a>.</div> </div> </div> <div class=section> <div class=sectname>FORMULA</div> <div class=sectbody> <div class=sectline>a(n) = 6*<a href="/A000217" title="Triangular numbers: a(n) = binomial(n+1,2) = n*(n+1)/2 = 0 + 1 + 2 + ... + n.">A000217</a>(<a href="/A111251" title="Numbers k such that 3*k^2 + 3*k + 1 is prime.">A111251</a>(n)) + 1. - <a href="/wiki/User:Christopher_Hohl">Christopher Hohl</a>, Jul 01 2019</div> <div class=sectline>From <a href="/wiki/User:R茅mi_Guillaume">R茅mi Guillaume</a>, Nov 07 2023: (Start)</div> <div class=sectline>a(n) = <a href="/A003215" title="Hex (or centered hexagonal) numbers: 3*n*(n+1)+1 (crystal ball sequence for hexagonal lattice).">A003215</a>(<a href="/A111251" title="Numbers k such that 3*k^2 + 3*k + 1 is prime.">A111251</a>(n)).</div> <div class=sectline>a(n) = (3*(2*<a href="/A002504" title="Numbers x such that 1 + 3*x*(x-1) is a ("cuban") prime (cf. A002407).">A002504</a>(n) - 1)^2 + 1)/4.</div> <div class=sectline>a(n) = (3*<a href="/A121259" title="Numbers k such that (3*k^2 + 1)/4 is prime.">A121259</a>(n)^2 + 1)/4.</div> <div class=sectline>a(n) = prime(<a href="/A145203" title="a(n) = pi(A002407(n)).">A145203</a>(n)). (End)</div> </div> </div> <div class=section> <div class=sectname>EXAMPLE</div> <div class=sectbody> <div class=sectline>a(1) = 7 = 1+3k(k+1) (with k=1) is the smallest prime of this form.</div> <div class=sectline>a(10^5) = 1792617147127 since this is the 100000th prime of this form.</div> </div> </div> <div class=section> <div class=sectname>MATHEMATICA</div> <div class=sectbody> <div class=sectline>lst={}; Do[If[PrimeQ[p=(n+1)^3-n^3], AppendTo[lst, p]], {n, 10^2}]; lst (* <a href="/wiki/User:Vladimir_Joseph_Stephan_Orlovsky">Vladimir Joseph Stephan Orlovsky</a>, Aug 21 2008 *)</div> <div class=sectline>Select[Table[3x^2+3x+1, {x, 100}], PrimeQ] (* or *) Select[Last[#]- First[#]&/@ Partition[Range[100]^3, 2, 1], PrimeQ] (* <a href="/wiki/User:Harvey_P._Dale">Harvey P. Dale</a>, Mar 10 2012 *)</div> <div class=sectline>Select[Differences[Range[100]^3], PrimeQ] (* <a href="/wiki/User:Harvey_P._Dale">Harvey P. Dale</a>, Jan 19 2020 *)</div> </div> </div> <div class=section> <div class=sectname>PROG</div> <div class=sectbody> <div class=sectline>(PARI) {a(n)= local(m, c); if(n<1, 0, c=0; m=1; while( c<n, m++; if( isprime(m) && issquare((4*m-1)/3), c++)); m)} /* <a href="/wiki/User:Michael_Somos">Michael Somos</a>, Sep 15 2005 */</div> <div class=sectline>(PARI)</div> <div class=sectline><a href="/A002407" title="Cuban primes: primes which are the difference of two consecutive cubes.">A002407</a>(n, k=1)=until(isprime(3*k*k+++1) && !n--, ); 3*k*k--+1</div> <div class=sectline>list_A2407(Nmax)=for(k=1, sqrt(Nmax/3), isprime(t=3*k*(k+1)+1) && print1(t", ")) \\ <a href="/wiki/User:M._F._Hasler">M. F. Hasler</a>, Nov 28 2007</div> <div class=sectline>(Magma) [a: n in [0..100] | IsPrime(a) where a is (3*n^2+3*n+1)]; // <a href="/wiki/User:Vincenzo_Librandi">Vincenzo Librandi</a>, Jan 20 2020</div> <div class=sectline>(Python)</div> <div class=sectline>from sympy import isprime</div> <div class=sectline>def aupto(limit):</div> <div class=sectline> alst, k, d = [], 1, 7</div> <div class=sectline> while d <= limit:</div> <div class=sectline> if isprime(d): alst.append(d)</div> <div class=sectline> k += 1; d = 1+3*k*(k+1)</div> <div class=sectline> return alst</div> <div class=sectline>print(aupto(34000)) # <a href="/wiki/User:Michael_S._Branicky">Michael S. Branicky</a>, Jul 19 2021</div> </div> </div> <div class=section> <div class=sectname>CROSSREFS</div> <div class=sectbody> <div class=sectline>Cf. <a href="/A000217" title="Triangular numbers: a(n) = binomial(n+1,2) = n*(n+1)/2 = 0 + 1 + 2 + ... + n.">A000217</a>, <a href="/A002504" title="Numbers x such that 1 + 3*x*(x-1) is a ("cuban") prime (cf. A002407).">A002504</a>, <a href="/A003215" title="Hex (or centered hexagonal) numbers: 3*n*(n+1)+1 (crystal ball sequence for hexagonal lattice).">A003215</a>, <a href="/A111251" title="Numbers k such that 3*k^2 + 3*k + 1 is prime.">A111251</a>, <a href="/A113478" title="Number of cuban primes less than 10^n.">A113478</a>, <a href="/A145203" title="a(n) = pi(A002407(n)).">A145203</a>.</div> <div class=sectline>Cf. <a href="/A002648" title="A variant of the cuban primes: primes p = (x^3 - y^3)/(x - y) where x = y + 2.">A002648</a> (with x=y+2), <a href="/A003627" title="Primes of the form 3n-1.">A003627</a>, <a href="/A007645" title="Generalized cuban primes: primes of the form x^2 + xy + y^2; or primes of the form x^2 + 3*y^2; or primes == 0 or 1 (mod 3).">A007645</a>, <a href="/A201477" title="Primes of the form 3n^2 + 4.">A201477</a>, <a href="/A334520" title="Primes that are the sum of two cubes.">A334520</a>.</div> <div class=sectline>Sequence in context: <a href="/A003215" title="Hex (or centered hexagonal) numbers: 3*n*(n+1)+1 (crystal ball sequence for hexagonal lattice).">A003215</a> <a href="/A308685" title="The number of triangular lattice points whose Euclidean distance from the origin is less than or equal to n.">A308685</a> <a href="/A133323" title="Hex (or centered hexagonal) numbers that are prime powers of the form (6n+1)^k.">A133323</a> * <a href="/A098484" title="Expansion of 1/sqrt((1-x)^2-12x^4).">A098484</a> <a href="/A155443" title="Number of ways to place zero or more nonadjacent 2,1 3,0 3,1 4,2 4,3 4,4 5,2 6,2 polyhexes in any orientation on a planar nX...">A155443</a> <a href="/A155405" title="Number of ways to place zero or more nonadjacent 1,1 2,0 2,1 3,2 3,3 4,1 4,2 5,3 polyhexes in any orientation on a planar nX...">A155405</a></div> <div class=sectline>Adjacent sequences: <a href="/A002404" title="Coefficients for step-by-step integration.">A002404</a> <a href="/A002405" title="Coefficients for step-by-step integration.">A002405</a> <a href="/A002406" title="Coefficients for step-by-step integration.">A002406</a> * <a href="/A002408" title="Expansion of 8-dimensional cusp form.">A002408</a> <a href="/A002409" title="a(n) = 2^n*C(n+6,6). Number of 6D hypercubes in an (n+6)-dimensional hypercube.">A002409</a> <a href="/A002410" title="Nearest integer to imaginary part of n-th zero of Riemann zeta function.">A002410</a></div> </div> </div> <div class=section> <div class=sectname>KEYWORD</div> <div class=sectbody> <div class=sectline><span title="a sequence of nonnegative numbers">nonn</span>,<span title="it is very easy to produce terms of sequence">easy</span>,<span title="an exceptionally nice sequence">nice</span></div> </div> </div> <div class=section> <div class=sectname>AUTHOR</div> <div class=sectbody> <div class=sectline><a href="/wiki/User:N._J._A._Sloane">N. J. A. Sloane</a></div> </div> </div> <div class=section> <div class=sectname>EXTENSIONS</div> <div class=sectbody> <div class=sectline>More terms from <a href="/wiki/User:James_A._Sellers">James A. Sellers</a>, Aug 08 2000</div> <div class=sectline>Entry revised by <a href="/wiki/User:N._J._A._Sloane">N. J. A. Sloane</a>, Jan 29 2013</div> </div> </div> <div class=section> <div class=sectname>STATUS</div> <div class=sectbody> <div class=sectline>approved</div> </div> </div> </div> <div class=space10></div> </div> </div></div> <p> <div class=footerpad></div> <div class=footer> <center> <div class=bottom> <div class=linksbar> <a href="/">Lookup</a> <a href="/wiki/Welcome"><font color="red">Welcome</font></a> <a href="/wiki/Main_Page"><font color="red">Wiki</font></a> <a href="/wiki/Special:RequestAccount">Register</a> <a href="/play.html">Music</a> <a href="/plot2.html">Plot 2</a> <a href="/demo1.html">Demos</a> <a href="/wiki/Index_to_OEIS">Index</a> <a href="/webcam">WebCam</a> <a href="/Submit.html">Contribute</a> <a href="/eishelp2.html">Format</a> <a href="/wiki/Style_Sheet">Style Sheet</a> <a href="/transforms.html">Transforms</a> <a href="/ol.html">Superseeker</a> <a href="/recent">Recents</a> </div> <div class=linksbar> <a href="/community.html">The OEIS Community</a> </div> <div class=linksbar> Maintained by <a href="http://oeisf.org">The OEIS Foundation Inc.</a> </div> <div class=dbinfo>Last modified November 24 21:01 EST 2024. Contains 378084 sequences.</div> <div class=legal> <a href="/wiki/Legal_Documents">License Agreements, Terms of Use, Privacy Policy</a> </div> </div> </center> </div> </body> </html>