Last active
March 24, 2020 14:25
-
-
Save WitherOrNot/47eefd213bddb2abcd4d8ed9ea2d151b to your computer and use it in GitHub Desktop.
This file contains 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 PIL import Image | |
from fractions import gcd | |
from math import sqrt | |
w = 2048 | |
img = Image.new("RGB", (w, w), color=(255,255,255)) | |
for i in range(1,w): | |
for j in range(1,w): | |
m = i*j | |
n = int(sqrt(m)) | |
p = n | |
while m%p != 0: | |
p += 1 | |
q = m/p | |
img.putpixel((p-1,w-q-1), (0,0,0)) | |
img.putpixel((q-1, w-p-1), (0,0,0)) | |
img.save("nsq.jpg") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment