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.

A122395 Primes of the form p^k - p^(k-1) - 1, with p prime and k>1.

This page as a plain text file.
%I A122395 #9 Mar 12 2023 08:49:27
%S A122395 3,5,7,17,19,31,41,53,109,127,271,293,499,811,929,2027,2161,3659,4373,
%T A122395 4421,4969,8191,9311,10099,13121,13309,16001,17029,19181,22051,32579,
%U A122395 38611,57839,72091,78607,93941,109229,128521,131071,143261,157211
%N A122395 Primes of the form p^k - p^(k-1) - 1, with p prime and k>1.
%C A122395 The paper by Stein and Williams gives a method for finding primes of this form when k>(p+1)/2.
%H A122395 Robert Israel, <a href="/A122395/b122395.txt">Table of n, a(n) for n = 1..10000</a>
%H A122395 Andreas Stein and H. C. Williams, <a href="https://doi.org/10.1090/S0025-5718-00-01212-6">Explicit primality criteria for (p-1)p^n-1</a>, Math. Comp. 69 (2000), 1721-1734.
%p A122395 N:= 10^6: # for terms <= N
%p A122395 p:= 1: R:= NULL:
%p A122395 do
%p A122395   p:= nextprime(p);
%p A122395   if p^2 - p - 1 > N then break fi;
%p A122395   for k from 2 do
%p A122395     q:= p^k - p^(k-1)-1;
%p A122395     if q > N then break fi;
%p A122395     if isprime(q) then R:= R, q fi;
%p A122395 od od:
%p A122395 sort(convert({R},list)); # _Robert Israel_, Mar 12 2023
%t A122395 nn=10^6; lst={}; n=1; While[p=Prime[n]; k=2; While[m=p^k-p^(k-1)-1; m<nn, If[PrimeQ[m], AppendTo[lst,m]]; k++ ]; k>2, n++ ]; lst=Union[lst]
%Y A122395 Cf. A122396.
%K A122395 nonn
%O A122395 1,1
%A A122395 _T. D. Noe_, Aug 31 2006