3 ms·
Late to the party but here's a solution I worked out using roots of unity and cosines: from math import cos, pi for n in range(1, 101): print([n, 'Fi
by susam 11mo ago
Late to the party but here's a solution I worked out using roots of unity and cosines:
from math import cos, pi
for n in range(1, 101):
print([n, 'Fizz', 'Buzz', 'FizzBuzz'][round((1 + 2 * cos(2 * pi * n / 3)) / 3 + 2 * (1 + 2 * cos(2 * pi * n / 5) + 2 * cos(4 * pi * n / 5)) / 5)])
- nik9000 11mo agoAs it should be.