$count = 1
do {
$count++
$i = $count
[string]$array = "$i"
$range = $i - 1
do {
if ($i % 2 -eq 0) {$i = $i / 2} else {$i = (3 \* $i) + 1}
$array = "$array" + ",$i"
if ($i - $count -gt $range) {$range = $i - $count}
if ($i -eq 2) {$i = "Break"}
} while ($i -ne "Break")
$array = "$array" + ",1"
$hits = (($array -split ",") | Measure-Object).count
Set-Content -Path "${count}_${hits}Hits_${range}MaxRange.txt" -Value "$array" -NoNewline -Force
} while ($count -lt 1000)
Does anyone know how to make this work with big numbers? At a certain point the value gets returned with something like 2.05891132094649E+44 at which point I can no longer simply add 1 to it.Edit: Found it... $count = [bigint][math]::pow(10,44) Awesome! I love code!