A374318 For any n > 0, let b_n(n+1) = 0, and for k = 1..n, if b_n(k+1) >= k then b_n(k) = b_n(k+1) - k otherwise b_n(k) = b_n(k+1) + k; a(n) = b_n(1).
0, 1, 1, 0, 2, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 2, 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 0, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1
Offset: 0
Keywords
Examples
The first terms, alongside the corresponding sequences b_n, are: n a(n) b_n -- ---- ---------------------------------- 0 0 [0] 1 1 [1, 0] 2 1 [1, 2, 0] 3 0 [0, 1, 3, 0] 4 2 [2, 3, 1, 4, 0] 5 1 [1, 2, 4, 1, 5, 0] 6 1 [1, 0, 2, 5, 1, 6, 0] 7 2 [2, 3, 5, 2, 6, 1, 7, 0] 8 0 [0, 1, 3, 6, 2, 7, 1, 8, 0] 9 1 [1, 2, 0, 3, 7, 2, 8, 1, 9, 0] 10 1 [1, 2, 4, 7, 3, 8, 2, 9, 1, 10, 0]
Links
- Rémy Sigrist, Colored representation of b_n(k) for n <= 1000 (where the color at (x, y) is function of b_x(y))
- Rémy Sigrist, Log-log scatterplot of the ordinal transform of the first 10000 terms
Programs
-
PARI
a(n) = { my (b = 0); forstep (k = n, 1, -1, if (b >= k, b -= k, b += k);); return (b); }
Formula
Empirically, a(n) = 1 iff n belongs to A042963.
Comments