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.

A237641 Primes p of the form n^2-n-1 (for prime n) such that p^2-p-1 is also prime.

Original entry on oeis.org

5, 236681, 380071, 457651, 563249, 1441199, 1660231, 2491661, 3050261, 4106701, 5137021, 5146091, 5329171, 10617821, 15574861, 19860391, 20852921, 21349019, 21497131, 23025601, 24507449, 32495699, 36342811, 48867089, 51129649, 59082281
Offset: 1

Views

Author

Derek Orr, Feb 10 2014

Keywords

Comments

Except a(1), all numbers are congruent to 1 mod 10 or 9 mod 10.
These are the primes in the sequence A237527.

Examples

			5 = 3^2-3^1-1 (3 is prime) and 5^2-5-1 = 19 is prime. Since 5 is prime too, 5 is a member of this sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Table[n^2-n-1,{n,Prime[Range[1000]]}],AllTrue[{#,#^2-#-1},PrimeQ]&] (* Harvey P. Dale, Aug 14 2024 *)
  • PARI
    s=[]; forprime(n=2, 40000, p=n^2-n-1; if(isprime(p) && isprime(p^2-p-1), s=concat(s, p))); s \\ Colin Barker, Feb 11 2014
  • Python
    import sympy
    from sympy import isprime
    def poly2(x):
      if isprime(x):
        f = x**2-x-1
        if isprime(f**2-f-1):
          return True
      return False
    x = 1
    while x < 10**5:
      if poly2(x):
        if isprime(x**2-x-1):
          print(x**2-x-1)
      x += 1
    

A230026 Primes p such that f(f(p)) is prime, where f(n) = n^2-n-1 = A165900(n).

Original entry on oeis.org

3, 13, 23, 53, 59, 83, 107, 167, 173, 179, 211, 223, 229, 257, 317, 349, 367, 431, 443, 487, 503, 509, 541, 571, 613, 617, 673, 677, 683, 751, 823, 1021, 1031, 1093, 1103, 1109, 1123, 1201, 1231, 1289, 1301, 1319, 1361, 1373, 1427, 1451
Offset: 1

Views

Author

Derek Orr, Feb 23 2014

Keywords

Comments

Note that f(f(f(n))) = (-1 + 4*n - 3*n^3 + n^4)*(1 + n - 3*n^2 - n^3 + n^4) is always composite. - Zak Seidov, Nov 10 2014

Examples

			3 is prime and (3^2-3-1)^2-(3^2-3-1)-1 = 19 is also prime. So, 3 is a member of this sequence.
		

Crossrefs

Programs

  • Python
    import sympy
    from sympy import isprime
    def f(x):
        return x**2-x-1
    {p for p in range(10**4) if isprime(p) and isprime(f(f(p)))}
    
  • Sage
    f = lambda x: x^2-x-1
    [p for p in primes(1452) if is_prime(f(f(p)))] # Peter Luschny, Mar 02 2014

Formula

A237527(n) = A165900(a(n)). - M. F. Hasler, Mar 01 2014

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