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.

A160858 Primes p such that p^3-p^2-1 and p^3-p^2+1 are prime.

This page as a plain text file.
%I A160858 #7 Jul 22 2025 06:25:38
%S A160858 2,3,13,541,859,1279,1459,1951,2239,2971,3181,4003,4129,6343,7393,
%T A160858 8053,9043,9463,10501,10831,12433,14083,14731,15073,15991,16603,17443,
%U A160858 17491,17761,18493,19861,20173,20323,20929,21391,22963,23071
%N A160858 Primes p such that p^3-p^2-1 and p^3-p^2+1 are prime.
%H A160858 Harvey P. Dale, <a href="/A160858/b160858.txt">Table of n, a(n) for n = 1..1000</a>
%e A160858 3^3-3^2=27-9=18-+1=primes
%t A160858 lst={};Do[p=Prime[n];a=p^2;b=p^3;c=b-a;If[PrimeQ[c-1]&&PrimeQ[c+1],AppendTo[lst,p]],{n,2*7!}];lst
%t A160858 Select[Prime[Range[3000]],AllTrue[#^3-#^2+{1,-1},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, May 20 2018 *)
%o A160858 (PARI) forprime(p=2,1e6,if(isprime(p^3-p^2-1)&&isprime(p^3-p^2+1),print1(p",")))
%Y A160858 Subset of A045331.
%K A160858 nonn
%O A160858 1,1
%A A160858 _Vladimir Joseph Stephan Orlovsky_, May 29 2009
%E A160858 Program, cross-reference, and editing by _Charles R Greathouse IV_, Nov 02 2009