OFFSET
1,1
COMMENTS
LINKS
Eric Weisstein's World of Mathematics, Collatz Problem
Wikipedia, Collatz conjecture
EXAMPLE
MATHEMATICA
Select[Prime@ Range[10^5], IntegerQ[Divide @@ Map[Total, TakeDrop[#, LengthWhile[#, EvenQ]]]] &@ SortBy[#, OddQ] &@ NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, # - 1, # > 1 &] &] (* Michael De Vlieger, Oct 15 2018 *)
PROG
(Magma) [n+1: n in [A274796(m)] | IsPrime(n+1)]
(Magma) e:= [&+[not IsOdd(h) select h else 0: h in [k eq 1 select n else IsOdd(Self(k-1)) and not IsOne(Self(k-1)) select 3*Self(k-1)+1 else Self(k-1) div 2: k in [1..5*n]]]: n in [1..1000]]; o:= [&+[IsOdd(h) select h else 0: h in [k eq 1 select n else IsOdd(Self(k-1)) and not IsOne(Self(k-1)) select 3*Self(k-1)+1 else Self(k-1) div 2: k in [1..5*n]]]: n in [1..1000]]; [n+1: n in [1..1000] | IsPrime(n+1) and e[n] mod o[n] eq 0]
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Jaroslav Krizek, Aug 04 2016
EXTENSIONS
More terms from Michael De Vlieger, Oct 15 2018.
STATUS
approved