

A267830


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.


1



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, 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, 88, 89, 14, 25, 14, 22, 16, 15, 84, 88, 6, 21, 21, 19, 11, 12, 12, 81
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,3


COMMENTS

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).
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.


LINKS

Michel Lagneau, Table of n, a(n) for n = 1..10000


FORMULA

a(n)= A008908(n)  A078350(n).


EXAMPLE

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.


MATHEMATICA

A267830[n_] := Count[NestWhileList[If[EvenQ@#, #/2, 3 # + 1] &, n, # != 1 &], _?(Not@PrimeQ@# &)] (* JungHwan Min, Jan 24 2016 *)


PROG

(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, ", "); ); ))


CROSSREFS

Cf. A006577, A008908, A078350, A018252.
Sequence in context: A257700 A334206 A006666 * A163334 A029683 A063567
Adjacent sequences: A267827 A267828 A267829 * A267831 A267832 A267833


KEYWORD

nonn


AUTHOR

Michel Lagneau, Jan 21 2016


STATUS

approved



