A165802 Primes p with f(p), f(f(p)), ... all prime, where f(n) = (n-1)/2. Stop when f(...f(p)...) is less than 4.
2, 3, 5, 7, 11, 23, 47
Offset: 1
Examples
(47-1)/2=23(prime);(23-1)/2=11(prime); (11-1)/2=5(prime); (5-1)/2=2.
Crossrefs
Subsequence of A165801.
Programs
-
Mathematica
f[n_]:=Module[{k=n},While[k>3,k=(k-1)/2;If[ !PrimeQ[k],Break[]]];PrimeQ[k]]; lst={};Do[p=Prime[n];If[f[p],AppendTo[lst,p]],{n,5!}];lst
Extensions
Edited by Charles R Greathouse IV, Oct 05 2009