%I #14 Nov 08 2016 20:49:35
%S 1,1,5,2,4,6,11,3,14,5,10,7,7,12,14,4,9,15,14,6,7,11,12,8,17,8,87,13,
%T 13,15,83,5,20,10,11,16,15,15,24,7,85,8,22,12,13,13,82,9,18,18,19,9,9,
%U 88,89,14,25,14,22,16,15,84,88,6,21,21,19,11,12,12,81
%N Number of nonprime numbers in {n, f(n), f(f(n)), ...., 1}, where f is the Collatz function defined by f(x) = x/2 if x is even; f(x) = 3x + 1 if x is odd.
%C Number of nonprime numbers in the trajectory of n under the 3x+1 map (i.e., the number of nonprime numbers until the trajectory reaches 1).
%C It seems that about 20% of the terms satisfy a(i) = a(i+1). For example, up to 10^6, 201085 terms satisfy this condition.
%H Michel Lagneau, <a href="/A267830/b267830.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n)= A008908(n) - A078350(n).
%e a(9)=14 because the trajectory of 9 is 9 -> 28 -> 14 -> 7 -> 22 -> 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 and the 14 nonprimes of this trajectory are 9, 28, 14, 22, 34, 52, 26, 40, 20, 10, 16, 8, 4, and 1.
%t A267830[n_] := Count[NestWhileList[If[EvenQ@#, #/2, 3 # + 1] &, n, # != 1 &], _?(Not@PrimeQ@# &)] (* _JungHwan Min_, Jan 24 2016 *)
%o (PARI) for(n=1, 100, s=n; t=0; while(s!=1, if(!isprime(s) , t++); if(s%2==0, s=s/2, s=(3*s+1)); if(s==1, print1(t+1, ", "); ); ))
%Y Cf. A006577, A008908, A078350, A018252.
%K nonn
%O 1,3
%A _Michel Lagneau_, Jan 21 2016