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.

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