%I #9 Apr 12 2017 23:17:25
%S 3,8,13,15,20,25,27,32,37,44,49,54,56,61,66,68,73,78,80,85,90,97,102,
%T 107,109,114,119,121,126,131,133,138,143,150,155,160,162,167,172,174,
%U 179,184,186,191,196,203,208,213,215,220,225,227,232,237,239,244,249
%N Powers of 3 that reach ...,7,8,4,2,1 under the mapping: if n is even divide by 2 else add 1.
%H G. C. Greubel, <a href="/A080706/b080706.txt">Table of n, a(n) for n = 1..1000</a>
%t okQ[n_]:=MemberQ[Partition[NestWhileList[If[EvenQ[#],#/2,#+1]&,3^n,#!=1&], 5,1], {7,8,4,2,1}]; Select[Range[250],okQ] (* _Harvey P. Dale_, Aug 22 2011 *)
%o (PARI) xnp3(n,p) = { for(x=1,n, p3 = 3^x; while(p3>1, if(p3%2==0,p3/=2,p3 = p3*p+1;); if(p3==7,print1(x" ")) ) ) }
%Y Cf. A022803.
%K easy,nonn
%O 1,1
%A _Cino Hilliard_, Mar 23 2003