%I #4 Oct 01 2013 17:57:36
%S 5,7,13,19,47,89,107,139,149,167,181,191,199,223,241,251,271,281,317,
%T 353,383,397,401,421,431,499,503,509,541,571,593,601,607,631,643,709,
%U 797,809,811,839,859,887,941,947,997
%N Primes that terminate at 20,10,5 in the 3x-1 problem: Repeat, if x is even divide by 2 else multiply by 3 and subtract 1, until 5 is reached.
%o (PARI) px3nm1(n,p) = { forprime(x=2,n, p1 = x; while(p1>1, if(p1%2==0,p1/=2,p1 = p1*p-1;); if(p1 == 5 || p1==17,break); ); if(p1 == 5,print1(x" ")) ) }
%K easy,nonn
%O 1,1
%A _Cino Hilliard_, Mar 27 2003