import matplotlib.pyplot as plt
a = [0,1]
b = [1,1]
for _ in range(22):
a.append(len(b))
if b[-1] % 2 == 0:
p = b[-1]/2
elif b[-1] % 3 == 0:
p = b[-1]/3
elif b[-1] % 5 == 0:
p = b[-1]/5
else:
p = b[-2]+1
b.append(p)
plt.bar(a, b)
plt.title("Fibonacci Numbers")
plt.xlabel("Index")
plt.ylabel("Value")
plt.show()
To embed this project on your website, copy the following code and paste it into your website's HTML: