Home

July 7th, 2009

Fucking A Apple!

rd = i^((i%8/2)%7)^ (3+(((i%8/4)*4)%7))^((i/8)*5)

Where "rd" is the transformed number of a given i and ends up being the "right digit" ("ones place") of the final value. Incidentally, this will generate palindromes if you run it over a range of i to i+7 where i % 8 == 0; in other words, any number divisible by 8 (including 0) up to that number +7, if you run it over that range, the first four numbers will *mirror* the last four numbers:

>> for i in range (256,256+8):
... print rsider_hells(i)
...
419
418
416
417
417
416
418
419


(Note, however, that that last bit probably does not generate a proper "rd" for 256 to 264, this just shows off the palindroming bit!)

If anyone can find an easier/simpler way to do all that (the generation, not the palindroming)... me love you long time.

ETA: fixed paste mistake in the example; also, the "rsider_hells" function is just a shorthand I made so that I wouldn't have to write out the equation but could test it using an arbitrary value for i.

September 2009

S M T W T F S
  12345
6789101112
13141516171819
20212223242526
27282930   

Advertisement

Powered by LiveJournal.com