autopushed

This commit is contained in:
2023-11-28 15:02:40 +01:00
parent af52d6d909
commit b3d8394614
+2 -2
View File
@@ -61,10 +61,10 @@ def hexnum(n, centered=True):
# -> https://en.wikipedia.org/wiki/Centered_hexagonal_number
# It is a cubic polynomial and Wikipedia shows how to convince yourself that it works.
# Beautiful :)
hexnums = [3*n*(n+1)+1 for n in range(0,n+1)]
hexnums = [3*n*(n+1)+1 for n in range(0,n)]
for nth, hexnum in enumerate(hexnums):
click.echo(f"hex({nth}) is {hexnum}.")
click.echo(f"hex({nth+1}) is {hexnum}.")
if __name__ == '__main__':