[Gambas-user] I asked chat gpt to write a gambas script, here is what it did
BB
adamnt42 at gmail.com
Tue Feb 14 10:21:18 CET 2023
On 14/2/23 6:14 pm, Brian G wrote:
> Sure, to account for the difference between successive primes as the
> count approaches infinity, we can use the Prime Number Theorem, which
> states that the number of primes less than or equal to x is
> approximately x/ln(x) as x approaches infinity. Therefore, the
> expected difference between successive primes is approximately ln(x).
Spurious and there is a large leap of faith required between "as x
approaches infinity." and "Therefore".
I tried it, converting everything to Longs and running the limit up to
2^30-1. Then went and mowed the lawn(it was still running), trimmed the
edges(still running), washed and polished the car(still running),
repainted the eaves(still running) and untangled the Gordian Knot(still
running). It finally just ungraciously failed.
YAY! Wetware wins again.
b
p.s. Never show code to an old software tester.
p.p.s. The x/ln(x) idea has been disputed and refuted since the 1890's.
My own experiments with "larger" limit's shows that x/(ln(x) increases
almost linearly over the first 1900 primes. *Therefore* (heehee) it most
certainly can be assumed to increase f'ever towards infinity. (maybe
asymptotically, I don't care. 😁)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230214/a4967cbb/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ocaahbjkiabgghol.png
Type: image/png
Size: 28979 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230214/a4967cbb/attachment-0001.png>
More information about the User
mailing list