技術メモ

役に立てる技術的な何か、時々自分用の覚書。幅広く色々なことに興味があります。

2023-04-19から1日間の記事一覧

Implement Prime spiral & Ulam spiral

Prime spiral from matplotlib import pyplot as plt import numpy as np from sympy import isprime upper_limit = pow(2, 17) theta = [] r = [] ptheta = [] pr = [] def f(x): return (np.sqrt(x),x) for i in range(1, upper_limit): res = f(i) r.appe…