Advertisement
Guest User

Untitled

a guest
Dec 16th, 2017
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. import math
  2.  
  3. def gBB(c):
  4.   a = 1
  5.   b = c
  6.   d = math.floor(math.sqrt(c))
  7.   e = c - d**2
  8.   n = int((c + 1)/2 - d)
  9.   x = math.floor(math.sqrt(( (d+n)**2 - c))) - n
  10.   # Upside down world
  11.   f = e - (2 * d + 1)
  12.   fn = n -1
  13.   fd = int(math.sqrt(c - f))
  14.   fx = math.floor(math.sqrt(( (fd+fn)**2 - c))) - fn
  15.   # Indexes
  16.   i = d + n
  17.   j = x + n
  18.   fi = int(fd + fn)
  19.   fj = int(fx + fn)
  20.   return (e, n, d, x, a, b), (f, fn, fd, fx, a, b), (i, j), (fi, fj)
  21.  
  22. def stuff(c):
  23.   d = math.floor(math.sqrt(c))
  24.   e = c - d**2
  25.   f = e - (2 * d + 1)
  26.   print((e, d, c), (f, math.sqrt(c - f), c))
  27.   print(gBB(c))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement