Created
February 5, 2016 11:43
-
-
Save terrycojones/7c6ecfb8f54cfb4b086a to your computer and use it in GitHub Desktop.
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, pow | |
In [13]: def scale(d): | |
....: return int(floor(pow(d, 0.725))) | |
....: | |
In [14]: for i in range(30): | |
....: print('%2d %2d' % (i, scale(i))) | |
....: | |
0 0 | |
1 1 | |
2 1 | |
3 2 | |
4 2 | |
5 3 | |
6 3 | |
7 4 | |
8 4 | |
9 4 | |
10 5 | |
11 5 | |
12 6 | |
13 6 | |
14 6 | |
15 7 | |
16 7 | |
17 7 | |
18 8 | |
19 8 | |
20 8 | |
21 9 | |
22 9 | |
23 9 | |
24 10 | |
25 10 | |
26 10 | |
27 10 | |
28 11 | |
29 11 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment