import math
import matplotlib.pyplot as plt

a = 3
b = a + 2
x = [i * (10 ** -a) for i in range(1, (10 ** b))]
y = [(1 + 1/i)**i for i in x]

plt.plot(x, y)
plt.title("y = (1 + 1/x)^x → e")
plt.xlabel("x")
plt.ylabel("y")
plt.grid(True, linestyle='--', color='gray', alpha=0.5)  # ←見やすく調整
plt.axhline(math.e, color='red', linestyle=':', label='y = e')
plt.legend()
plt.show()


Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: