Output:
% python /tmp/collatz.py
Number of vCPUs available: 12
Checked Collatz conjecture for numbers 1 to 1000000
Number with longest sequence: 837799
Length of longest sequence: 525
Time taken: 2.08 seconds
python /tmp/collatz.py 19.47s user 0.41s system 728% cpu 2.731 totalI'll have to check the actual results, of course, but that's much cleaner than what all the other LLMs output
N = 1000000 # Total numbers to check
chunk_size = N // num_vcpus
tasks = [(i * chunk_size + 1, (i + 1) * chunk_size) for i in range(num_vcpus)]
When num_vcpus = 12, chunksize = 83333, and 12*chunk_size = 999996, therefore we don't check the last four numbers.
Take small companies with eveyrone being business people besides the nerds in the IT department. If you don't have one security aware person, this IT department will write unsecure code without anyone in the company every questiong this every.
You know like 'hidden' api keys in an mobile app everyone can extract, still using plaintext for passwords or md5, having ports open, old operating systems etc. etc.
It doesn't even need to do the timestamping/benchmarking that my singlethreaded does, but i couldn't make 4o nor any local LLM give code that gave correct output when run. This is by far the most trivial and easily checked thing i can personally verify.