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.

A359221 Starting numbers which reach a new record high value when iterating the map x->A359194(x) (binary complement of 3n).

This page as a plain text file.
%I A359221 #18 Jan 05 2023 18:55:58
%S A359221 0,1,2,3,12,28,227,821,22246,26494,204953,425720
%N A359221 Starting numbers which reach a new record high value when iterating the map x->A359194(x) (binary complement of 3n).
%C A359221 It is unknown whether all starting numbers reach 0.
%C A359221 103721 is not a term of this sequence despite having a trajectory of record length, because its maximum of 2.42...*10^14081 is lower than the previous record holder.
%H A359221 Joshua Searle, <a href="https://qedscience.wordpress.com/2021/02/19/collatz-inspired-sequences/">Collatz-inspired sequences</a>
%e A359221 Let S(x) = iteration sequence of A359194 starting with x; then
%e A359221 S(0) = (0), maximum = 0;
%e A359221 S(1) = (1, 0), maximum = 1;
%e A359221 S(2) = (2, 1, 0), maximum = 2;
%e A359221 S(3) = (3, 6, 13, 24, 55, 90, 241, 300, 123, 142, 85, 0), maximum = 300;
%e A359221 Since S(3) contains a higher maximum than any lower positive starting integer, 3 is a term of this sequence.
%o A359221 (Python)
%o A359221 from itertools import count, islice
%o A359221 def f(n): return 1 if n == 0 else (m:=3*n)^((1 << m.bit_length())-1)
%o A359221 def itersmax(n):
%o A359221     i, fi, m = 0, n, n
%o A359221     while fi != 0: i, fi, m = i+1, f(fi), max(m, fi)
%o A359221     return i, m
%o A359221 def agen(): # generator of terms
%o A359221     record = -1
%o A359221     for m in count(0):
%o A359221         v, mx = itersmax(m)
%o A359221         if mx > record:
%o A359221             yield m # use mx to obtain values
%o A359221             record = mx
%o A359221 print(list(islice(agen(), 8))) # _Michael S. Branicky_, Dec 22 2022
%Y A359221 Cf. A035327, A359194, A359207, A359208, A359209, A359215, A359218, A359219, A359220, A359222, A359255.
%K A359221 nonn,base,more,hard
%O A359221 1,3
%A A359221 _Joshua Searle_, Dec 22 2022