A216189 Numbers n whose odd Collatz steps (except for 1) are all primes.
3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 17, 19, 20, 21, 22, 24, 25, 26, 28, 29, 34, 35, 37, 38, 39, 40, 44, 45, 48, 49, 52, 53, 56, 58, 59, 67, 68, 69, 74, 76, 77, 80, 85, 87, 88, 89, 96, 99, 101, 104, 106, 112, 116, 117, 118, 119, 131, 134, 136, 141, 148, 149
Offset: 1
Keywords
Examples
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. 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.
Programs
-
Mathematica
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 *)
Comments