login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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). 2
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
COMMENTS
This sequence is a variant of A008344; here we add or subtract by numbers from n down to 1, there by numbers from 1 up to n.
Apparently, the sequence only contains 0's, 1's and 2's.
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))
FORMULA
Empirically, a(n) = 1 iff n belongs to A042963.
EXAMPLE
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]
PROG
(PARI) a(n) = { my (b = 0); forstep (k = n, 1, -1, if (b >= k, b -= k, b += k); ); return (b); }
CROSSREFS
Sequence in context: A025925 A372510 A240857 * A109066 A079066 A157188
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Jul 04 2024
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 17 10:16 EDT 2024. Contains 375987 sequences. (Running on oeis4.)