def test_neighbors():
    n = lambda i: set(neighbors(i, 5, 5, 5))
assert n(0) == set([1, 5, 6, 25, 30])
assert n(2) == set([1, 3, 7, 8, 26, 27, 32])
assert n(4) == set([3, 9, 28, 29, 34])
assert n(5) == set([0, 6, 10, 30])
assert n(9) == set([3, 4, 8, 13, 14, 33, 34, 38])
assert n(20) == set([15, 16, 21, 45])
assert n(21) == set([16, 17, 20, 22, 45, 46])
assert n(24) == set([19, 23, 48, 49])
assert n(25) == set([0, 1, 26, 30, 31, 50, 51])
assert n(34) == set([4, 9, 28, 29, 33, 38, 39, 54, 59])
assert n(36) == set([7, 11, 12, 31, 32, 35, 37, 41, 42, 57, 61, 62])
assert n(49) == set([24, 44, 48, 74])
Creating a sphere packing nearest neighbor list from integers