cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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).

This page as a plain text file.
%I A374318 #8 Jul 06 2024 14:15:07
%S A374318 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,
%T A374318 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,
%U A374318 0,1,1,2,0,1,1,2,0,1,1,2,0,1,1,2,0,1,1
%N 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).
%C A374318 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.
%C A374318 Apparently, the sequence only contains 0's, 1's and 2's.
%H A374318 Rémy Sigrist, <a href="/A374318/a374318.png">Colored representation of b_n(k) for n <= 1000</a> (where the color at (x, y) is function of b_x(y))
%H A374318 Rémy Sigrist, <a href="/A374318/a374318_1.png">Log-log scatterplot of the ordinal transform of the first 10000 terms</a>
%F A374318 Empirically, a(n) = 1 iff n belongs to A042963.
%e A374318 The first terms, alongside the corresponding sequences b_n, are:
%e A374318   n   a(n)  b_n
%e A374318   --  ----  ----------------------------------
%e A374318    0     0  [0]
%e A374318    1     1  [1, 0]
%e A374318    2     1  [1, 2, 0]
%e A374318    3     0  [0, 1, 3, 0]
%e A374318    4     2  [2, 3, 1, 4, 0]
%e A374318    5     1  [1, 2, 4, 1, 5, 0]
%e A374318    6     1  [1, 0, 2, 5, 1, 6, 0]
%e A374318    7     2  [2, 3, 5, 2, 6, 1, 7, 0]
%e A374318    8     0  [0, 1, 3, 6, 2, 7, 1, 8, 0]
%e A374318    9     1  [1, 2, 0, 3, 7, 2, 8, 1, 9, 0]
%e A374318   10     1  [1, 2, 4, 7, 3, 8, 2, 9, 1, 10, 0]
%o A374318 (PARI) a(n) = { my (b = 0); forstep (k = n, 1, -1, if (b >= k, b -= k, b += k);); return (b); }
%Y A374318 Cf. A008344, A042963, A374317.
%K A374318 nonn
%O A374318 0,5
%A A374318 _Rémy Sigrist_, Jul 04 2024