by ineptech · 9y ago · 0 comments
Upon a stack of bits, about so tall, // Boolean[] isprime = new Boolean[n];
just think, O traveller, what we could do // Arrays.fill(isprime, true);
if every other bit was set to false // for (int i = 4; i < n; i+=2)
beginning with (but not including) two? // isprime[i] = false;
Now take two lowly numbers, A and B // for (int a = 3; a < n; a += 2)
that equal three and two. What would happen // {
if they, by twos and ones respectively, // for (int b = 2; a*b < n; b++)
were incremented in a nested fashion, // {
And if we falsified, at every turn, // isprime[a*b] = false;
the value offset by A groups of Bs? // }
Then to the aether let those bits return, // }
to fly back home to Eratosthenes! // return isprime;
(You may have figured out that I put a lot more time in to the silly programmer jokes in the fake site than in to the app. Wonder why it never took off...)The fact that you made it a poem, reminds me of some extempore poems that I made up as a kid - inspired by reading a book that my uncle bought me as a gift - The Golden Book of Fun and Nonsense [2]. It had a lot of funny poems, limericks, etc. in it.
Here are two I made up at the time:
Poem 1:
Mr. Jolly had a brolly [1]
Its handle was made of silver, and its body was made of gold.
And Mr. Jolly used the brolly when it was very cold.
[1] Brolly is a Brit term for umbrella.
Poem 2:
I climbed up a mountain.
There I saw a fountain.
One, two, three, four, five!
In it I'd like to dive.
Go ahead, laugh. It's meant to be funny and silly.
I'll also mention a few good ones I read in that book:
Into the drinking well
Which the plumber built her.
Aunt Eliza fell.
We must buy a filter.
Old Father William:
https://en.wikipedia.org/wiki/You_Are_Old,_Father_William
[2] The book is suitable for kids of all ages:
https://www.google.com/searchq=the+golden+book+of+fun+and+no...
Sorry, typo in that URL. There should be a "?" between the "search" and the "q":
https://www.google.com/search?q=the+golden+book+of+fun+and+n...
That made me laugh so hard. Man. Great site.