%I #10 Jun 13 2018 13:33:02
%S 1,5,5,5,5,8,6,13,5,11,9,9,7,10,14,8,6,14,12,14,10,12,10,13,8,19,11,
%T 17,15,11,9,17,7,17,15,15,13,15,15,13,11,15,13,18,11,16,14,22,9,16,20,
%U 14,12,18,18,16,16,14,12,12,10,10,18,22,8,20,18,20,16,18,16,16,14
%N Length (= size) of the orbit of n under iterations of A293975: x -> x/2 if even, x + nextprime(x) if odd; or -1 if the orbit is infinite.
%C The orbit of x under f is O(x; f) = { f^k(x); k = 0, 1, 2,... }.
%C It is conjectured that for f = A293975, the trajectory (f^k(x); k >= 0) ends in the cycle 1 -> 3 -> 8 -> 4 -> 2 -> 1 for any starting value x.
%H Harvey P. Dale, <a href="/A293982/b293982.txt">Table of n, a(n) for n = 0..1000</a>
%e a(0) = 1 = # { 0 }, since 0 -> 0 -> 0 ... under A293975.
%e a(1) = 5 = # { 1, 3, 8, 4, 2 }, since 1 -> (1 + 2 =) 3 -> (3 + 5 =) 8 -> 4 -> 2 -> 1 -> 3 etc... under A293975.
%e a(2) = 5 = # { 2, 1, 3, 8, 4 }, since 2 -> 1 -> 3 -> 8 -> 4 -> 2 -> 1 etc... under A293975.
%e a(5) = 8 = # { 5, 12, 6, 3, 8, 4, 2, 1 }, since 5 -> (5 + 7 =) 12 -> 6 -> 3 -> (3 + 5 =) 8 -> 4 -> 2 -> 1 -> 3 etc... under A293975.
%t Table[Flatten[FindTransientRepeat[NestList[If[EvenQ[#],#/2,#+ NextPrime[ #]]&,n,100],3]]//Length,{n,0,80}] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Jun 13 2018 *)
%o (PARI) A293982(n,S=[n])={while(#S<#S=setunion(S,[n=A293975(n)]),);#S}
%Y Cf. A293975, A174221 (the "PrimeLatz" map), A006370 (the "3x+1" map).
%K nonn
%O 0,2
%A _M. F. Hasler_, Nov 05 2017