login
Numbers n whose odd Collatz steps (except for 1) are all primes.
0

%I #51 Dec 14 2018 20:38:20

%S 3,5,6,7,9,10,11,12,13,14,17,19,20,21,22,24,25,26,28,29,34,35,37,38,

%T 39,40,44,45,48,49,52,53,56,58,59,67,68,69,74,76,77,80,85,87,88,89,96,

%U 99,101,104,106,112,116,117,118,119,131,134,136,141,148,149

%N Numbers n whose odd Collatz steps (except for 1) are all primes.

%C Powers of 2 are not included as they don't have odd Collatz steps. The number n itself (if odd) is not counted as an odd step. [Corrected by _Jianing Song_, Dec 09 2018]

%H <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>

%e 7 is in this sequence because 7*3+1 = 22; 22/2 = [11]; 11*3+1 = 34; 34/2 = [17]; 17*3+1 = 52; 52/2 = 26; 26/2 = [13]; 13*3+1 = 40; 40/2 = 20; 20/2 = 10; 10/2 = [5]; 5*3+1 = 16; 16/2 = 8; 8/2 = 4; 4/2 = 2; 2/2 = 1. 11, 17, 13 and 5 are all primes.

%e 15 is not in this sequence because 15*3+1 = 46; 46/2 = [23]; 23*3+1 = 70; 70/2 = 35, which isn't a prime number.

%t Select[Range[3, 150], And[AllTrue[Select[Rest@ #2, OddQ], PrimeQ], !IntegerQ@ Log2@ #1] & @@ {#, NestWhileList[If[EvenQ@ #, #/2, 3 # + 1] &, #, # > 2 &, 1, Infinity, -1]} &] (* _Michael De Vlieger_, Nov 07 2018 *)

%Y Cf. A006577, A177000.

%K nonn

%O 1,1

%A _Alessandro Polcini_, Oct 10 2018