# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a022803 Showing 1-1 of 1 %I A022803 #16 Oct 10 2017 16:41:41 %S A022803 13,14,25,26,27,28,49,50,51,52,53,54,55,56,97,98,99,100,101,102,103, %T A022803 104,105,106,107,108,109,110,111,112,193,194,195,196,197,198,199,200, %U A022803 201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218 %N A022803 Numbers that reach ...,7,8,4,2,1 under the mapping: if n is even divide by 2 else add 1. %C A022803 7 itself does not qualify, by decree. - _N. J. A. Sloane_, Sep 02 2017 %H A022803 Harvey P. Dale, Table of n, a(n) for n = 1..1000 %t A022803 nr7Q[n_]:=Module[{trms=NestWhileList[If[EvenQ[#],#/2,#+1]&,n,#!=1&]}, Length[ trms]>4 && trms[[-5]]==7]; Select[Range[8,220],nr7Q] (* _Harvey P. Dale_, Oct 10 2017 *) %o A022803 (PARI) xnp1(n,p) = { for(x=1,n, p1 = x; while(p1>1, if(p1%2==0,p1/=2,p1 = p1*p+1;); if(p1==7,print1(x" ")) ) ) } %K A022803 easy,nonn %O A022803 1,1 %A A022803 _Cino Hilliard_, Mar 23 2003 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE