Created
February 11, 2012 22:40
-
-
Save RSully/1804815 to your computer and use it in GitHub Desktop.
6n ± 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import floor | |
def pp(n): | |
return (6*(floor(n/2)+1)) + (-1 if n % 2 == 0 else 1) | |
for i in xrange(0, 50): | |
print "%d\t\t%d" % (i, pp(i)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment