We’ve updated our Terms of Use to reflect our new entity name and address. You can review the changes here.
We’ve updated our Terms of Use. You can review the changes here.

Haul on the Jib: A Recursive C Shanty

by Futzle and The Old Mermaid Townsfolk

/
  • Streaming + Download

    Purchasable with gift card

     

about

This silly song was my entry into the Fedivison Song Contest 2023, an annual amateur competition operated on Mastodon and other federated instances.

lyrics

Now folks, gather round, I’ve some math to expound
It’s a tale from arithmetic deep and profound
From before there were words “exponential” and “power”
From before this here tavern began Happy Hour

It’s a concept that follows a broad rule of thumb
Make a sequence of integers formed by the sum
of the previous two in the series and lo!
You’ll approximate phi, the divine ratio

Now we’re able seafarers and that’s very swell
But the name “Fibonacci” is trouble to spell
Is it F-I-B-O-N-A-double-C-I?
Say we shorten it fib’ and I tell you no lie

So haul on the jib
Do you know how to fib’?
If your number is less than or equal to one
Then, haul on the jib
I don’t mean to be glib
And your answer’s the same as your own and you’re done
Else haul on the jib
As you call on the fib’
With your number less one and your number less two
Then surrender the sum to the one you called you

(One horny bunny, Two horny bunny, etc.)
(One Fibonacci, Two Fibonacci, etc.)

It’s a spiral you find in pineapples and shells
To self-similar growth there are strong parallels
It’s peculiarly linked to the square root of five
(Which is left as a challenge for you to derive.)

// Haul on the jib
int fib(int n) {
if (n <= 1)
// Haul on the jib
// TODO: link with glib

return n;
else {
// Haul on the jib
// Recursive bit
int f1 = fib(n-1);
int f2 = fib(n-2);
return f1 + f2; }
}

(One phyllotaxy, Two phyllotaxy, etc.)
(One Fibonacci, Two Fibonacci, etc.)

It’s a perfectly fine educational tool
But to use it naively you’re only a fool
Of its double recursion it needn’t be said
You’d prefer analytical functions instead

(Chorus)

credits

released June 12, 2023
Thanks to the Old Mermaid Townsfolk singers: cos, knack, koosli, Kymberly, and screenbeard!

license

all rights reserved

tags

about

Futzle Melbourne, Australia

More music at music.futzle.com.

contact / help

Contact Futzle

Streaming and
Download help

Report this track or account

If you like Haul on the Jib: A Recursive C Shanty, you may also like: