From b3d839461419428679a6111a447079379e30c83c Mon Sep 17 00:00:00 2001 From: Flancian <0@flancia.org> Date: Tue, 28 Nov 2023 15:02:40 +0100 Subject: [PATCH] autopushed --- bin/hex.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/hex.py b/bin/hex.py index cdec91149..07f3f2c52 100755 --- a/bin/hex.py +++ b/bin/hex.py @@ -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__':