Skip to content

Instantly share code, notes, and snippets.

@WitherOrNot
Last active March 24, 2020 14:25
Show Gist options
  • Save WitherOrNot/47eefd213bddb2abcd4d8ed9ea2d151b to your computer and use it in GitHub Desktop.
Save WitherOrNot/47eefd213bddb2abcd4d8ed9ea2d151b to your computer and use it in GitHub Desktop.
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