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

A237640 Numbers n of the form p^5 - Phi_5(p) (for prime p) such that n^5 - Phi_5(n) is also prime.

Original entry on oeis.org

122, 340352, 830519696, 11479086422, 266390469692, 310503441398, 2718130415306, 14837993872846, 59538248604388, 889257663626476, 2496623039993996, 6427431330617746, 7120028814392596, 10777302002014868, 12942591289426088, 24039736320940828
Offset: 1

Views

Author

Derek Orr, Feb 10 2014

Keywords

Comments

All numbers are congruent to 2 mod 10, 6 mod 10, or 8 mod 10.
x^5 - Phi_5(x) = x^5-x^4-x^3-x^2-x-1.

Examples

			122 = 3^5-3^4-3^3-3^2-3^1-1 (3 is prime) and 122^5-122^4-122^3-122^2-122^1-1 = 26803717321 is prime. Thus, 122 is a member of this sequence.
		

Crossrefs

Programs

  • Python
    import sympy
    from sympy import isprime
    def poly5(x):
      if isprime(x):
        f = x**5-x**4-x**3-x**2-x-1
        if isprime(f**5-f**4-f**3-f**2-f-1):
          return True
      return False
    x = 1
    while x < 10**5:
      if poly5(x):
        print(x**5-x**4-x**3-x**2-x-1)
      x += 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-2 of 2 results.