Skip to main content
added 387 characters in body
Source Link
naffetS
  • 12.8k
  • 2
  • 20
  • 53

Python, 7767 bytes

n=0
while n:=n+1:[print(k*k+k-n*min(2*k-n,1))for k in range(1,n+1)]

Attempt This Online!

Port of Haskell. Outputs infinitely.

Old answer:

Python, 77 bytes

n=0
while n:=n+1:[print(n<2*k-1and-~k*k-n or(n-k)**2+k)for k in range(1,n+1)]

Attempt This Online!

Outputs infinitely.

Python, 77 bytes

n=0
while n:=n+1:[print(n<2*k-1and-~k*k-n or(n-k)**2+k)for k in range(1,n+1)]

Attempt This Online!

Outputs infinitely.

Python, 67 bytes

n=0
while n:=n+1:[print(k*k+k-n*min(2*k-n,1))for k in range(1,n+1)]

Attempt This Online!

Port of Haskell. Outputs infinitely.

Old answer:

Python, 77 bytes

n=0
while n:=n+1:[print(n<2*k-1and-~k*k-n or(n-k)**2+k)for k in range(1,n+1)]

Attempt This Online!

Source Link
naffetS
  • 12.8k
  • 2
  • 20
  • 53

Python, 77 bytes

n=0
while n:=n+1:[print(n<2*k-1and-~k*k-n or(n-k)**2+k)for k in range(1,n+1)]

Attempt This Online!

Outputs infinitely.