A177000 The Collatz iteration of these primes produces only even numbers, primes and 1.
2, 3, 5, 7, 11, 13, 17, 19, 29, 37, 53, 59, 67, 89, 101, 131, 149, 157, 179, 181, 197, 241, 269, 277, 349, 397, 739, 853, 1109, 1237, 1429, 1621, 1861, 1877, 2161, 2389, 2531, 2957, 3413, 3797, 4549, 5717, 7621, 10069, 13397, 17749, 20021, 31541, 40277
Offset: 1
Examples
The Collatz iteration of 7 produces 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, and 1, which are either even, prime, or 1.
Links
- Donovan Johnson and T. D. Noe, Table of n, a(n) for n = 1..10000 (Donovan Johnson to 203 terms)
- Eric Weisstein's World of Mathematics, Collatz Problem
- Wikipedia, Collatz conjecture
- Index entries for sequences related to 3x+1 (or Collatz) problem
Programs
-
Haskell
a177000 n = a177000_list !! (n-1) a177000_list = filter (all (\x -> even x || a010051' x == 1) . (init . a070165_row)) a000040_list -- Reinhard Zumkeller, Apr 03 2012
-
Mathematica
Collatz[n_] := NestWhileList[If[EvenQ[ # ], #/2, 3#+1] &, n, #>1 &]; Reap[Do[p=Prime[n]; s=Most[Select[Collatz[p],OddQ]]; If[And@@PrimeQ[s], Sow[p]], {n,PrimePi[10^4]}]][[2,1]] oenQ[n_]:=AllTrue[DeleteCases[Most[NestWhileList[If[EvenQ[#],#/2, 3#+1]&,n, #>1&]], ?PrimeQ],EvenQ]; Select[Prime[Range[5000]], oenQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale, Dec 28 2014 *)
-
PARI
is(n)=isprime(n) && (n<23 || is((3*n+1)>>valuation(3*n+1,2))) \\ Charles R Greathouse IV, Jun 20 2013
Comments