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.

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

This page as a plain text file.
%I A230027 #15 Apr 06 2025 19:52:54
%S A230027 29,53,79,83,149,167,193,227,283,311,317,401,709,907,953,1093,1327,
%T A230027 1427,1511,1579,1613,1663,1801,1901,1987,2027,2029,2293,2341,2741,
%U A230027 2887,3083,3163,3229,3329,3511,3733,4007,4127,4153,4337,4789,5531
%N A230027 Primes p such that f(f(p)) is prime, where f(x) = x^3-x^2-x-1.
%e A230027 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.
%t A230027 f[n_] := n^3 - n^2 - n - 1; Select[ Prime@ Range[2, 740], PrimeQ@ f@ f@# &] (* _Robert G. Wilson v_, Mar 07 2014 *)
%o A230027 (Python)
%o A230027 from sympy import isprime
%o A230027 def f(x):
%o A230027   return x**3-x**2-x-1
%o A230027 {print(p) for p in range(10**4) if isprime(p) and isprime(f(f(p)))}
%Y A230027 Cf. A000040, A237528, A162295.
%K A230027 nonn
%O A230027 1,1
%A A230027 _Derek Orr_, Feb 23 2014