Collatz Sequences for
♯(n)

Paul Abbott
paul.c.abbott@uwa.edu.au

Collatz

The Collatz sequence for
n
can be computed as a fixed-point list of the “shortcut” Collatz map:
In[]:=
Collatz[n_]:=Collatz[n]=FixedPointListxIfOddQ[x],
3x+1
2
,
x
2
,n,SameTest(mm2)

Primorial

The primorial
♯(n)
is defined as the product of first
n
prime numbers:
In[]:=
♯(n_):=
n
∏
k=1
p
k
Compute
♯(n)
for
1≤n≤10
:
In[]:=
♯/@Range[10]
Out[]=
{2,6,30,210,2310,30030,510510,9699690,223092870,6469693230}
By construction, each primorial is divisible by only one power
2
.

Visualization

Compute the sequence length for
♯(n)
versus
log(♯(n))
for
1≤n≤1000
:
In[]:=
data=(n{Log[♯[n]],Length@Collatz[♯[n]]})/@Range[1000];
Display the data:
In[]:=
lp=ListPlot[data]
Out[]=
A linear fit works well:
In[]:=
fit=Fit[data,x,x]
Out[]=
6.95456x
In[]:=
Show[lp,Plot[fit,{x,0,
4
10
},PlotStyle->Red]]
Out[]=