A179753 Integers (2k)-1..0 followed by integers (2k)+1..0 and so on.
1, 0, 3, 2, 1, 0, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
Offset: 1
Keywords
Programs
-
Mathematica
Flatten[Table[Range[2n-1,0,-1],{n,10}]] (* Harvey P. Dale, Oct 08 2012 *)
-
Python
from math import isqrt def A179753(n): return (k:=(m:=isqrt(n))+(n>m*(m+1)))*(1+k)-n # Chai Wah Wu, Jun 06 2025