FxChiP ([info]fxchip) wrote,
@ 2009-07-07 00:59:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
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.


Advertisement


(No comments)

Post a comment in response:

From:
Help
Identity URL: 
Username:
Password:
Don't have an account? Create one now.
Subject:
No HTML allowed in subject
   Help
Message:
 
Notice! This user has turned on the option that logs your IP address when posting. Help
Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…