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

A057683 Numbers k such that k^2 + k + 1, k^3 + k + 1 and k^4 + k + 1 are all prime.

Original entry on oeis.org

1, 2, 5, 6, 12, 69, 77, 131, 162, 426, 701, 792, 1221, 1494, 1644, 1665, 2129, 2429, 2696, 3459, 3557, 3771, 4350, 4367, 5250, 5670, 6627, 7059, 7514, 7929, 8064, 9177, 9689, 10307, 10431, 11424, 13296, 13299, 13545, 14154, 14286, 14306, 15137
Offset: 1

Views

Author

Harvey P. Dale, Oct 20 2000

Keywords

Comments

After a(0) = 1, k^5 + k + 1 is never prime. Proof: k^5 + k + 1 = (k^2 + k + 1)*(k^3 - k^2 + 1). - Jonathan Vos Post, Oct 17 2007, edited by Robert Israel, Aug 01 2016
For n > 1, no terms == 1 (mod 3) or == 3 (mod 5). - Robert Israel, Jul 31 2016

Examples

			5 is included because 5^2 + 5 + 1 = 31, 5^3 + 5 + 1 = 131 and 5^4 + 5 + 1 = 631 are all prime.
		

Crossrefs

Cf. A049407.
Cf. Subsequence of A219117; A010051.

Programs

  • Haskell
    a057683 n = a057683_list !! (n-1)
    a057683_list = filter (all (== 1) . p) [1..] where
       p x = map (a010051 . (+ (x + 1)) . (x ^)) [2..4]
    -- Reinhard Zumkeller, Nov 12 2012
    
  • Magma
    [n: n in [0..20000]|IsPrime(n^2+n+1) and IsPrime(n^3+n+1) and IsPrime(n^4+n+1)] // Vincenzo Librandi, Dec 20 2010
    
  • Maple
    select(n -> isprime(n^4+n+1) and isprime(n^3+n+1) and isprime(n^2+n+1), [$1..50000]); # Robert Israel, Jul 31 2016
  • Mathematica
    Select[Range[16000],And@@PrimeQ/@(Table[n^i+n+1,{i,2,4}]/.n->#)&]  (* Harvey P. Dale, Mar 28 2011 *)
  • Python
    from sympy import isprime
    A057683_list = [n for n in range(10**5) if isprime(n**2+n+1) and isprime(n**3+n+1) and isprime(n**4+n+1)] # Chai Wah Wu, Apr 02 2021

A219183 Numbers n such that n^1+n+1, n^2+n+1, n^3+n+1 and n^4+n+1 are all semiprime.

Original entry on oeis.org

84, 92, 129, 132, 182, 185, 195, 201, 234, 255, 264, 327, 333, 356, 407, 444, 449, 528, 705, 732, 794, 795, 881, 980, 1079, 1095, 1115, 1126, 1241, 1253, 1302, 1431, 1479, 1496, 1574, 1772, 1781, 1799, 1805, 1874, 1922, 2052, 2067, 2316, 2352, 2381, 2420
Offset: 1

Views

Author

Jonathan Vos Post, Nov 13 2012

Keywords

Comments

This is to semiprimes A001358 what A219117 is to primes A000040. - Franklin T. Adams-Watters
From Robert Gerbicz: there is no n for which n^k+n+1 is semiprime for k=1,2,3,4,5. Proof: n^5+n+1 = (n^2+n+1)*(n^3-n^2+1), here n^2+n+1 is semiprime, so for n > 1, n^5+n+1 has at least 3 factors, hence not a semiprime.

Examples

			a(1) = 84 because 84^4 + 84 + 1 = 49787221 = 11 * 4526111; 84^3 + 84 + 1 = 592789 = 29 * 20441; 84^2 + 84 + 1 = 7141 = 37 * 193; 84^1 + 84 + 1 = 169 = 13^2.
3^4+3+1 = 85 = 5*17 is semiprime, but 3^3+3+1 = 321 is prime, so 3 is not in this sequence.
8^4+8+1 = 4105 = 5 * 821 is semiprime, but 8^3+8+1 = 521 is prime, so 8 is not in this sequence.
20^4+20+1 = 160021 = 17 * 9413 is semiprime, and 20^3+20+1 = 8021 = 13 * 617 is semiprime, but 20^2+20+1 = 421 is prime, so 20 is not in this sequence.
		

Crossrefs

Programs

  • Magma
    s:=func; [k : k in [2..2500]| forall{i:i in [1,2,3,4]| s(k^i+k+1)}]; // Marius A. Burtea, Feb 11 2020
  • PARI
    is(n)=vector(4,i,bigomega(n^i+n+1))==[2,2,2,2] \\ Charles R Greathouse IV, Nov 13 2012
    

A236045 Primes p such that p^1+p+1, p^2+p+1, p^3+p+1, and p^4+p+1 are all prime.

Original entry on oeis.org

2, 5, 131, 2129, 9689, 27809, 36821, 46619, 611729, 746171, 987491, 1121189, 1486451, 2215529, 2701931, 4202171, 4481069, 4846469, 5162141, 5605949, 6931559, 7181039, 8608571, 9276821, 9762611, 11427491, 11447759, 12208019
Offset: 1

Views

Author

Derek Orr, Jan 18 2014

Keywords

Crossrefs

Cf. A219117.

Programs

  • Mathematica
    Select[Prime[Range[810000]],And@@PrimeQ[Table[#^n+#+1,{n,4}]]&] (* Harvey P. Dale, Apr 07 2014 *)
  • PARI
    list(maxx)={n=2; cnt=0; while(nBill McEachen, Feb 05 2014
  • Python
    import sympy
    from sympy import isprime
    {print(p) for p in range(10**8) if isprime(p) and isprime(p**1+p+1) and isprime(p**2+p+1) and isprime(p**3+p+1) and isprime(p**4+p+1)}
    
Showing 1-3 of 3 results.