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

A002407 Cuban primes: primes which are the difference of two consecutive cubes.

Original entry on oeis.org

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
Offset: 1

Views

Author

Keywords

Comments

Primes of the form p = (x^3 - y^3)/(x - y) where x=y+1. See A007645 for generalization. I first saw the name "cuban prime" in Cunningham (1923). Values of x are in A002504 and y are in A111251. - N. J. A. Sloane, Jan 29 2013
Prime hex numbers (cf. A003215).
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. - M. F. Hasler, Nov 28 2007
Primes p such that 4p = 1+3s^2 for some integer s (A121259). - Michael Somos, Sep 15 2005
This sequence is believed to be infinite. - N. J. A. Sloane, May 07 2020

Examples

			a(1) = 7 = 1+3k(k+1) (with k=1) is the smallest prime of this form.
a(10^5) = 1792617147127 since this is the 100000th prime of this form.
		

References

  • Allan Joseph Champneys Cunningham, On quasi-Mersennian numbers, Mess. Math., 41 (1912), 119-146.
  • Allan Joseph Champneys Cunningham, Binomial Factorisations, Vols. 1-9, Hodgson, London, 1923-1929; see Vol. 1, pp. 245-259.
  • J.-M. De Koninck & A. Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problem 241 pp. 39; 179, Ellipses Paris 2004.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Magma
    [a: n in [0..100] | IsPrime(a) where a is (3*n^2+3*n+1)]; // Vincenzo Librandi, Jan 20 2020
    
  • Mathematica
    lst={}; Do[If[PrimeQ[p=(n+1)^3-n^3], AppendTo[lst, p]], {n, 10^2}]; lst (* Vladimir Joseph Stephan Orlovsky, Aug 21 2008 *)
    Select[Table[3x^2+3x+1,{x,100}],PrimeQ] (* or *) Select[Last[#]- First[#]&/@ Partition[Range[100]^3,2,1],PrimeQ] (* Harvey P. Dale, Mar 10 2012 *)
    Select[Differences[Range[100]^3],PrimeQ] (* Harvey P. Dale, Jan 19 2020 *)
  • PARI
    {a(n)= local(m, c); if(n<1, 0, c=0; m=1; while( cMichael Somos, Sep 15 2005 */
    
  • PARI
    A002407(n,k=1)=until(isprime(3*k*k+++1) && !n--,);3*k*k--+1
    list_A2407(Nmax)=for(k=1,sqrt(Nmax/3),isprime(t=3*k*(k+1)+1) && print1(t",")) \\ M. F. Hasler, Nov 28 2007
    
  • Python
    from sympy import isprime
    def aupto(limit):
        alst, k, d = [], 1, 7
        while d <= limit:
            if isprime(d): alst.append(d)
            k += 1; d = 1+3*k*(k+1)
        return alst
    print(aupto(34000)) # Michael S. Branicky, Jul 19 2021

Formula

a(n) = 6*A000217(A111251(n)) + 1. - Christopher Hohl, Jul 01 2019
From Rémi Guillaume, Nov 07 2023: (Start)
a(n) = A003215(A111251(n)).
a(n) = (3*(2*A002504(n) - 1)^2 + 1)/4.
a(n) = (3*A121259(n)^2 + 1)/4.
a(n) = prime(A145203(n)). (End)

Extensions

More terms from James Sellers, Aug 08 2000
Entry revised by N. J. A. Sloane, Jan 29 2013

A221794 Number of primes of the form (x+1)^3 - x^3 with x <= 10^n.

Original entry on oeis.org

1, 7, 42, 263, 1965, 15282, 126826
Offset: 0

Views

Author

Vladimir Pletser, Jan 25 2013

Keywords

Comments

Cuban primes are primes that are the difference of two consecutive cubes, p = (x+1)^3 - x^3 (A002407). They are also primes of the form 3k(k+1) + 1, where values for k+1 are in A002504.

Crossrefs

Cf. A002407, A002504, A003215, A113478 (number of cuban primes < 10^n).

A221792 Number of n-digit cuban primes.

Original entry on oeis.org

1, 3, 7, 17, 36, 109, 265, 762, 2125, 5964, 17205, 49989, 145047, 424155, 1250298, 3697457, 10985390, 32768938, 98054446, 294239322, 885300000, 2669959359, 8069333311, 24435519147
Offset: 1

Views

Author

Vladimir Pletser, Jan 25 2013

Keywords

Crossrefs

Formula

a(n) = A113478(n) - A113478(n-1). - Jens Kruse Andersen, Jul 14 2014

Extensions

a(19)-a(24) added from A113478 by Andrew Howroyd, Jan 14 2020

A221846 Number of primes of the form (x+1)^5 - x^5 less than 10^n.

Original entry on oeis.org

0, 0, 1, 2, 3, 4, 6, 12, 19, 30, 40, 66, 110, 173, 285, 463, 749, 1256, 2075, 3499, 5884, 9928, 16754, 28345, 48037, 82187, 140358, 239768, 409315, 700510, 1200863, 2061093, 3544072, 6098353, 10505051
Offset: 0

Views

Author

Vladimir Pletser, Jan 26 2013

Keywords

Comments

Number of primes less than 10^n and equal to the difference of two consecutive fifth powers (x+1)^5 - x^5 = 5x(x+1)(x^2+x+1)+1 (A121616). Values of x = A121617. Sequence of number of primes less than 10^n and of the form (x+1)^5 - x^5 have similar characteristics to similar sequences for natural primes (A006880) and cuban primes (A113478).

A221977 Number of primes of the form (x+1)^7 - x^7 less than 10^n.

Original entry on oeis.org

0, 0, 1, 1, 2, 3, 6, 7, 8, 10, 14, 18, 25, 34, 46, 60, 89, 120, 165, 227, 298, 415, 590, 821, 1152, 1606, 2240, 3188, 4438, 6208, 8714, 12280, 17368, 24560, 34821, 49413, 70581, 100856, 143955, 205291, 293061, 419256, 600213, 858870, 1230523, 1764914, 2532078
Offset: 1

Views

Author

Vladimir Pletser, Feb 02 2013

Keywords

Comments

Number of primes less than 10^n and equal to the difference of two consecutive seventh powers (x+1)^7 - x^7 = 7x(x+1)(x^2+x+1)^2+1 (A121618). Values of x = A121619 - 1. Sequence of number of primes less than 10^n and of the form (x+1)^7 - x^7 have similar characteristics to similar sequences for natural primes (A006880), cuban primes (A113478) and primes of the form (x+1)^5 - x^5 (A221846).

Programs

  • Mathematica
    nn = 20; t = Table[0, {nn}]; n = 0; While[n++; p = (n + 1)^7 - n^7; p < 10^nn,If[PrimeQ[p], m = Ceiling[Log[10, p]]; t[[m]]++]]; Accumulate[t] (* T. D. Noe, Feb 04 2013 *)

A376907 a(n) is the least n-digit cuban prime.

Original entry on oeis.org

7, 19, 127, 1657, 10267, 102121, 1021417, 10052191, 100381321, 1000556719, 10000510297, 100025541019, 1000011191887, 10000028937841, 100000062634561, 1000001305386991, 10000001240507791, 100000021541868691, 1000000084213608427, 10000000012591553221, 100000000159478313337
Offset: 1

Views

Author

Stefano Spezia, Oct 08 2024

Keywords

Comments

a(n) - A011557(n-1) is a multiple of 3.

Crossrefs

Programs

  • Maple
    nextcuban:= proc(n)
      local k,y;
      for k from ceil((sqrt(12*n-3)-3)/6) do
        y:= (k+1)^3 - k^3;
        if isprime(y) then return y fi
      od
    end proc:
    seq(nextcuban(10^i), i = 0 .. 25); # Robert Israel, Nov 08 2024
  • Mathematica
    a[n_]:=Module[{k=1},While[!PrimeQ[m=3k^2+3k+1]||IntegerLength[m]
    				
  • Python
    from itertools import count
    from math import isqrt
    from sympy import isprime
    def A376907(n):
        for k in count(isqrt((((a:=10**(n-1))<<2)-1)//12)):
            m = 3*k*(k+1)+1
            if m >= a and isprime(m):
                return m # Chai Wah Wu, Oct 13 2024

Formula

Conjecture: a(n+1)/a(n) ~ 10.

A221983 Number of primes of the form (x+1)^11 - x^11 less than 10^n.

Original entry on oeis.org

1, 2, 3, 3, 4, 4, 4, 4, 5, 6, 6, 8, 9, 9, 9, 12, 15, 18, 24, 30, 35, 41, 46, 66, 83, 104, 133, 166, 195, 247, 314, 400, 475, 589, 709, 855, 1046, 1313, 1604, 1998, 2468, 3029, 3681, 4518, 5581, 6920, 8629, 10647, 13122, 16214, 19894, 24644, 30569, 37864, 46927
Offset: 9

Views

Author

Vladimir Pletser, Feb 02 2013

Keywords

Comments

Number of primes less than 10^n and equal to the difference of two consecutive eleventh powers (x+1)^11 - x^11 = 11x(x+1)(x^2+x+1)( x(x+1)(x^2+x+1)(x^2+x+3)+1) + 1 (A189055). Values of x = A211184. Sequence of number of primes less than 10^n and of the form (x+1)^11 - x^11 have similar characteristics to similar sequences for natural primes (A006880), cuban primes (A113478) and primes of the form (x+1)^p - x^p for p = 5 (A221846) and p = 7 (A221977).

Programs

  • Mathematica
    nn = 40; t = Table[0, {nn}]; n = 0; While[n++; p = (n + 1)^11 - n^11; p < 10^nn, If[PrimeQ[p], m = Ceiling[Log[10, p]]; t[[m]]++]]; Accumulate[t] (* T. D. Noe, Feb 04 2013 *)

A210520 Number of cuban primes < 10^(n/2).

Original entry on oeis.org

0, 0, 1, 2, 4, 6, 11, 17, 28, 42, 64, 105, 173, 267, 438, 726, 1200, 2015, 3325, 5524, 9289, 15659, 26494, 44946, 76483, 129930, 221530, 377856, 645685, 1105802, 1895983, 3254036, 5593440, 9625882, 16578830, 28590987, 49347768, 85253634
Offset: 0

Views

Author

Vladimir Pletser, Jan 26 2013

Keywords

Comments

A cuban prime has the form (x+1)^3 - x^3, which equals 3x*(x+1) + 1 (A002407).

Examples

			As the smallest cuban primes equal to the difference of two consecutive cubes p = (x+1)^3 - x^3, is 7 for x = 1, and as floor (10^(1/2)) = 3, a(0) = a(1) = 0 and a(2) = 1.
		

Crossrefs

Programs

  • Mathematica
    cnt = 0; nxt = 1; t = {0}; Do[p = 3*k*(k + 1) + 1; If[p > nxt, AppendTo[t, cnt]; nxt = nxt*Sqrt[10]]; If[PrimeQ[p], cnt++], {k, 100000}]; t (* T. D. Noe, Jan 29 2013 *)
  • PARI
    b(n)={my(s=0,k=0,t=1); while(t<=n, s+=isprime(t); k++; t += 6*k); s}
    a(n)={b(sqrtint(10^n))} \\ Andrew Howroyd, Jan 14 2020

Formula

a(2*n) = A113478(n). - Andrew Howroyd, Jan 14 2020

Extensions

a(31)-a(37) from Andrew Howroyd, Jan 14 2020
Showing 1-8 of 8 results.