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.

A359218 Let S(n) be the sequence obtained through the mapping of x->A359194(x) starting with n and stopping when 0 is reached, -1 if 0 is never reached. a(n) = m if appears in S(k), k < n, otherwise -1.

Original entry on oeis.org

0, 0, 1, 0, 3, 0, 6, 1, 7, 4, 10, 9, 10, 13, 0, 15, 16, 12, 18, 6, 3, 21, 22, 12, 24, 25, 3, 27, 21, 7, 30, 31, 31, 28, 34, 22, 19, 37, 13, 39, 40, 4, 1, 43, 123, 58, 46, 4, 187, 49, 27, 102, 52, 96, 42, 55, 87, 57, 58, 21, 30, 61, 48, 63, 64, 60, 66, 54, 51, 69
Offset: 0

Views

Author

Michael De Vlieger, Dec 21 2022

Keywords

Comments

By convention, a(0) = 0 since n = 0.
Regarding A359215(n), this is the value m that had appeared in S(k), k < n.

Examples

			a(1) = 0 since S(1) = {1, 0}, but m = 0 appeared in S(0).
a(2) = 1 since S(2) = {2, 1, ...}, but m = 1 appeared in S(1).
a(3) = 0 since S(3) = {3, 6, 13, 24, 55, 90, 241, 300, 123, 142, 85, 0}, but m = 0 appeared in S(0).
a(4) = 3 since S(4) = {4, 3, ...} but 3 appears in S(3), etc.
a(5) = 0 since S(5) = {5, 0}, but 0 appears in S(0).
a(6) = 6 since 6 appears in F(3).
a(7) = 1 since S(7) = {7, 10, 1, ...} but 1 appears in S(1).
a(8) = 7 since S(8) = {8, 7, ...} but 7 appears in S(7)
a(9) = 4 since S(9) = {9, 4, ...} but 4 appears in S(4).
a(10) = 10 since 10 appears in S(7).
a(11) = 9 since S(11) = {11, 30, 37, 16, 15, 18, 9, ...} but 9 appears in S(9).
a(12) = 10 since S(12) = {12, 27, ..., 39, 10, ...} but 10 appears in S(7), etc.
		

Crossrefs

Programs

  • Mathematica
    c[] = -1; c[0] = 0; f[n] := BitXor[3 n, 2^IntegerPart[Log2[3 n] + 1] - 1]; Table[(Map[If[c[#1] == -1, Set[c[#1], #2]] & @@ # &, Partition[#, 2, 1]]; Last@ #) &@ NestWhileList[f, n, c[#] == -1 &], {n, 0, 120}]