A381232 Count down from k to -k for k = 0, 1, 2, ... .
0, 1, 0, -1, 2, 1, 0, -1, -2, 3, 2, 1, 0, -1, -2, -3, 4, 3, 2, 1, 0, -1, -2, -3, -4, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, -9
Offset: 0
Links
- Paolo Xausa, Table of n, a(n) for n = 0..10200 (k = 0..100)
Programs
-
Mathematica
Flatten[Table[Range[k, -k, -1], {k, 0, 10}]] (* Paolo Xausa, Mar 01 2025 *)
-
Python
from math import isqrt def A381232(n): return (t:=isqrt(n))*(t+1)-n # Chai Wah Wu, Mar 01 2025
Formula
a(n) = -A196199(n) = floor(sqrt(n))*(floor(sqrt(n))+1)-n. - Chai Wah Wu, Mar 01 2025