Juggler Numbers

2009 June 2

Juggler numbers are defined by the following iterative rule

NumberedEquation1

(sorry mathworld for stealing your graphics)

if you look at this rule you might think that some of the sequences would perhaps grow indefinitely, or possibly oscillate around a limit, in fact every number gives birth to a sequence that always reaches one.

Using the following code I generated some path lengths for juggler numbers, with starting number n, and saved them from the interpreter into a text file, which I then imported to a Google spreadsheet, and made a nice plot…

# juggler numbers
# n-> floor(n^1/2) if n even
# n-> floor(n^3/2) if n odd
# discovered by Pickover

from math import floor
for a in range(1,2000):
    x=a
    path=0
    while x!=1:
        if x%2==0:
            x**=0.5
            x=floor(x)
        else:
            x**=1.5
            x=floor(x)
        path+=1

    print (path)

 

juggler_numbers

Goog's spreadsheet is cool, but it doesn't seem to let you make really big plots, like a 10000 x 10000 pixel image, for that kind of thing I would use Processing.

No comments yet

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS