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

A002504 Numbers x such that 1 + 3*x*(x-1) is a ("cuban") prime (cf. A002407).

Original entry on oeis.org

2, 3, 4, 5, 7, 10, 11, 12, 14, 15, 18, 24, 25, 26, 28, 29, 31, 33, 35, 38, 39, 42, 43, 46, 49, 50, 53, 56, 59, 63, 64, 67, 68, 75, 81, 82, 87, 89, 91, 92, 94, 96, 106, 109, 120, 124, 126, 129, 130, 137, 141, 143, 148, 154, 157, 158, 159, 165, 166, 171, 172
Offset: 1

Views

Author

Keywords

Comments

Equivalently, positive integers x such that x^3 - (x-1)^3 is prime. - Rémi Guillaume, Oct 24 2023

Examples

			From _Rémi Guillaume_, Dec 07 2023: (Start)
1 + 3*7*6 = 127 = A002407(5) is the 5th prime of this form, so a(5) = 7.
1 + 3*10*9 = 271 = A002407(6) is the 6th prime of this form, so a(6) = 10.
(End)
		

References

  • A. J. C. Cunningham, On quasi-Mersennian numbers, Mess. Math., 41 (1912), 119-146.
  • 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

Cf. A002407 (resulting primes), A111251, A121259.

Programs

  • Mathematica
    Select[Range[500], PrimeQ[1 + 3 # (# - 1)] &] (* T. D. Noe, Jan 30 2013 *)
  • PARI
    for(k=1,999,isprime(3*k*(k-1)+1)&print1(k",")) \\ M. F. Hasler, Nov 28 2007

Formula

From Rémi Guillaume, Dec 07 2023: (Start)
a(n) = ceiling(sqrt(A002407(n)/3)).
a(n) = A111251(n) + 1.
a(n) = (A121259(n) + 1)/2. (End)

Extensions

Edited, updated (1 is no longer regarded as a prime) and extended by M. F. Hasler, Nov 28 2007

A121259 Numbers k such that (3*k^2 + 1)/4 is prime.

Original entry on oeis.org

3, 5, 7, 9, 13, 19, 21, 23, 27, 29, 35, 47, 49, 51, 55, 57, 61, 65, 69, 75, 77, 83, 85, 91, 97, 99, 105, 111, 117, 125, 127, 133, 135, 149, 161, 163, 173, 177, 181, 183, 187, 191, 211, 217, 239, 247, 251, 257, 259, 273, 281, 285, 295, 307, 313, 315, 317, 329, 331, 341
Offset: 1

Views

Author

Zak Seidov, Aug 23 2006

Keywords

Examples

			(3*5^2 + 1)/4 = 19 is the 2nd prime of this form, so a(2) = 5.
(3*13^2 + 1)/4 = 127 is the 5th prime of this form, so a(5) = 13.
(3*19^2 + 1)/4 = 271 is the 6th prime of this form, so a(6) = 19.
		

Crossrefs

Cf. comment by Michael Somos in A002407.
Cf. A002504, A111251, A111051 (simpler variant).

Programs

Formula

a(n) = sqrt((4*A002407(n) - 1)/3). [corrected by Rémi Guillaume, Dec 07 2023]
a(n) = 2*A002504(n) - 1. - Hugo Pfoertner, Oct 07 2023
a(n) = 2*A111251(n) + 1. - Rémi Guillaume, Dec 06 2023

A350090 a(n) is the number of indices i in the range 0 <= i <= n-1 such that A003215(n) - A003215(i) is an oblong number (A002378), where A003215 are the hex numbers.

Original entry on oeis.org

0, 1, 1, 1, 1, 3, 1, 2, 3, 1, 1, 1, 3, 1, 1, 3, 3, 1, 3, 3, 3, 3, 5, 1, 1, 1, 5, 1, 1, 3, 1, 3, 1, 7, 1, 3, 3, 1, 1, 3, 7, 1, 1, 3, 3, 1, 3, 3, 1, 1, 3, 3, 1, 3, 7, 1, 3, 7, 1, 7, 3, 3, 1, 1, 3, 3, 1, 1, 3, 3, 7, 5, 3, 3, 1, 5, 3, 3, 7, 3, 1, 1, 3, 3, 3, 7, 1, 3, 1, 3, 1
Offset: 0

Views

Author

Klaus Purath and Michel Marcus, Dec 14 2021

Keywords

Comments

There are very few even terms in the data (3 up to 10000). They are obtained for indices coming from A001921. For odd terms see A350120.
a(n) = 1 for n in A111251.

Examples

			For n=5, the 5 numbers hex(5)-hex(i), for i=0 to 4, are (90, 84, 72, 54, 30) out of which 90, 72 and 30 are oblong, so a(5) = 3.
		

Crossrefs

Programs

  • Mathematica
    obQ[n_] := IntegerQ @ Sqrt[4*n + 1]; hex[n_] := 3*n*(n + 1) + 1; a[n_] := Module[{h = hex[n]}, Count[Range[0, n - 1], ?(obQ[h - hex[#]] &)]]; Array[a, 100, 0] (* _Amiram Eldar, Dec 14 2021 *)
  • PARI
    hex(n) = 3*n*(n+1)+1; \\ A003215
    isob(n) = my(m=sqrtint(n)); m*(m+1)==n; \\ A002378
    a(n) = my(h=hex(n)); sum(k=0, n-1, isob(h - hex(k)));
    
  • PARI
    a(n) = numdiv(3*n*n + 3*n + 1) - 1; \\ Jinyuan Wang, Dec 19 2021

Formula

a(n) = A000005(A003215(n)) - 1. - Jinyuan Wang, Dec 19 2021

Extensions

Edited by N. J. A. Sloane, Dec 25 2021

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.

A257772 Numbers n>=0 such that (n+1)^3 - n^3 = 3*n^2+3*n+1 is not prime.

Original entry on oeis.org

0, 5, 7, 8, 12, 15, 16, 18, 19, 20, 21, 22, 26, 29, 31, 33, 35, 36, 39, 40, 43, 44, 46, 47, 50, 51, 53, 54, 56, 57, 59, 60, 61, 64, 65, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79, 82, 83, 84, 85, 87, 89, 92, 94, 96, 97, 98, 99, 100, 101, 102, 103, 104, 106
Offset: 1

Views

Author

Keywords

Comments

Complement of A111251.
Includes all members of A047383 except 1. - Robert Israel, May 12 2015

Examples

			5 is a term since (5+1)^3 - 5^3 = 91 = 13*7 is not prime.
		

Crossrefs

Programs

  • Magma
    [n: n in [0..120] | not IsPrime(3*n^2+3*n+1)]; // Vincenzo Librandi, May 13 2015
    
  • Maple
    remove(t -> isprime((t+1)^3-t^3), [$0..300]); # Robert Israel, May 12 2015
  • Mathematica
    Select[Range[0, 200], ! PrimeQ[(#+1)^3 - #^3] &] (* Giovanni Resta, May 08 2015 *)
  • PARI
    for(n=0,100,if(!isprime(3*n^2+3*n+1),print1(n,", "))) \\ Derek Orr, May 19 2015
  • UBASIC
    10 print 0
    20 for n=1 to 200
    30   s = (n+1)^3 - n^3
    40   if prmdiv(s)<>s then print n
    50 next n
    

Formula

a(n) ~ n. - Charles R Greathouse IV, May 22 2015

A338610 Integers m such that there exist one prime p and one positive integer k, for which the expression k^3 + k^2*p is a perfect cube m^3.

Original entry on oeis.org

2, 12, 36, 80, 252, 810, 1100, 1452, 2366, 2940, 5202, 12696, 14400, 16250, 20412, 22736, 27900, 33792, 40460, 52022, 56316, 70602, 75852, 93150, 112896, 120050, 143312, 169400, 198476, 242172, 254016, 291852, 305252, 410700, 518400, 538002, 643452, 689216, 737100
Offset: 1

Views

Author

Bernard Schott, Nov 03 2020

Keywords

Comments

This concerns Problem 131 of Project Euler (see link).
For each such term m with this property, the values of k and of p are unique.
The solution to the Diophantine equation is: (q^3)^3 + (q^3)^2 * ((q+1)^3 - q^3) = ((q+1) * q^2)^3, where
- the prime p is the cuban prime (q+1)^3 - q^3 = A002407(n),
- corresponding to q = A111251(n),
- the positive integer k = q^3, and,
- the resulting m = (q+1)*q^2 = (A111251(n)+1)*(A111251(n))^2.

Examples

			For n=1, q=A111251(1)=1 and 1^3 + 1^2*(2^3 - 1^3) = 1+1*7 = 2^3, hence, k=1^3, cuban prime=7, and a(1)=m=2.
For n=3, q=A111251(3)=3 and (3^3)^3 + (3^3)^2*(4^3 - 3^3) = 27^3 + 27^2*37 = 46656 = 36^3, hence, k=3^3, cuban prime=37, and a(3)=m=36.
		

Crossrefs

Subsequence of A011379.

Programs

  • Maple
    for q from 1 to 90 do
    p:=3*q^2+3*q+1;
    if isprime(p) then print((q+1)*q^2); else fi; od:
  • Mathematica
    f[n_] := n^2*(n+1); f /@ Select[Range[100], PrimeQ[3*#^2 + 3*# + 1] &] (* Amiram Eldar, Nov 05 2020 *)
  • PARI
    lista(nn) =  apply(x->x^2*(x+1), select(x->isprime(3*x^2 + 3*x + 1), [1..nn])); \\ Michel Marcus, Nov 05 2020

Formula

a(n) = (A111251(n) + 1)*(A111251(n))^2.
a(n) = A011379(A111251(n)).

A111292 Numbers n such that 6*n^2 + 6*n + 1 is prime.

Original entry on oeis.org

1, 2, 3, 5, 7, 8, 9, 10, 12, 13, 18, 19, 20, 22, 23, 30, 31, 32, 33, 35, 36, 38, 41, 42, 43, 45, 46, 47, 51, 55, 58, 60, 65, 67, 73, 74, 77, 78, 84, 86, 88, 93, 95, 97, 100, 101, 104, 106, 107, 109, 112, 117, 120, 123, 124, 126, 129, 130, 132, 134, 135, 137, 143, 148, 151
Offset: 1

Views

Author

Parthasarathy Nambi, Nov 01 2005

Keywords

Examples

			If n=43 then 6*n^2 + 6*n + 1 = 11353 (prime).
		

Crossrefs

Programs

Showing 1-8 of 8 results.