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.

A162294 Numbers k such that k^3-k^2-k-1 is prime.

Original entry on oeis.org

4, 6, 8, 12, 16, 22, 28, 34, 44, 50, 54, 56, 58, 76, 78, 88, 110, 112, 118, 134, 138, 156, 162, 166, 168, 170, 188, 190, 200, 204, 208, 210, 226, 230, 236, 244, 250, 268, 274, 302, 310, 314, 322, 324, 340, 344, 356, 364, 368, 378, 382, 390, 398, 400, 420, 424
Offset: 1

Views

Author

Keywords

Examples

			k=4 is in the sequence because 4^3-4^2-4-1=43 is prime.
k=6 is in the sequence because 6^3-6^2-6-1=173 is prime.
		

Crossrefs

Cf. A087908, A111501, A162291, A162293, A162295 (corresponding primes).

Programs

  • Mathematica
    lst={};Do[p=n^3-n^2-n-1;If[PrimeQ[p],AppendTo[lst,n]],{n,2,6!}];lst

Formula

k^3-k^2-k-1 = A162295(n), where k=a(n).
Sum_{i=1..n} a(i) = Sum_{i=1..n} i * ( pi(i^3 - i^2 - i - 1) - pi(i^3 - i^2 - i - 2) ). - Wesley Ivan Hurt, May 24 2013

Extensions

Edited by R. J. Mathar, Jul 02 2009

A237528 Numbers n of the form p^3-p^2-p-1 (for prime p) such that n^3-n^2-n-1 is prime.

Original entry on oeis.org

23518, 146014, 486718, 564814, 3285598, 4629406, 7151614, 11645326, 22584814, 29983198, 31754206, 64319998, 355897438, 745319086, 864614014, 1304555614, 2334990526, 2903803726, 3447511198, 3934332718, 4194050014, 4596374014, 5838479998, 6866219998
Offset: 1

Views

Author

Derek Orr, Feb 09 2014

Keywords

Comments

All numbers are congruent to 4 mod 10, 6 mod 10, or 8 mod 10.

Examples

			23518 = 29^3-29^2-29-1 (29 is prime) and 23518^3-23518^2-23518-1 = 13007166227989 is prime. Thus, 23518 is a member of this sequence.
		

Crossrefs

Cf. A162295.

Programs

  • Mathematica
    f[n_] := n^3 - n^2 - n - 1; f[ Select[ Prime@ Range[2,740],PrimeQ@ f@ f@#&]] (* Robert G. Wilson v, Mar 07 2014 *)
  • PARI
    s=[]; forprime(p=2, 40000, n=p^3-p^2-p-1; if(isprime(n^3-n^2-n-1), s=concat(s, n))); s \\ Colin Barker, Feb 10 2014
  • Python
    import sympy
    from sympy import isprime
    {print(n**3-n**2-n-1) for n in range(10**4) if isprime(n) and isprime((n**3-n**2-n-1)**3-(n**3-n**2-n-1)**2-(n**3-n**2-n-1)-1)}
    

A230027 Primes p such that f(f(p)) is prime, where f(x) = x^3-x^2-x-1.

Original entry on oeis.org

29, 53, 79, 83, 149, 167, 193, 227, 283, 311, 317, 401, 709, 907, 953, 1093, 1327, 1427, 1511, 1579, 1613, 1663, 1801, 1901, 1987, 2027, 2029, 2293, 2341, 2741, 2887, 3083, 3163, 3229, 3329, 3511, 3733, 4007, 4127, 4153, 4337, 4789, 5531
Offset: 1

Views

Author

Derek Orr, Feb 23 2014

Keywords

Examples

			29 is prime and (29^3-29^2-29-1)^3 - (29^3-29^2-29-1)^2 - (29^3-29^2-29-1) - 1 = 13007166227989 is prime. Thus, 29 is a member of this sequence.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := n^3 - n^2 - n - 1; Select[ Prime@ Range[2, 740], PrimeQ@ f@ f@# &] (* Robert G. Wilson v, Mar 07 2014 *)
  • Python
    from sympy import isprime
    def f(x):
      return x**3-x**2-x-1
    {print(p) for p in range(10**4) if isprime(p) and isprime(f(f(p)))}
Showing 1-3 of 3 results.