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.

A359222 Number of steps to reach 0 from A359221(n) (Starting numbers that reach a new record high value during iteration by the map x->A359194(x)).

This page as a plain text file.
%I A359222 #12 Jan 05 2023 18:56:43
%S A359222 0,1,2,11,80,7572,664475,3180929,120796790,556068798,1246707529,
%T A359222 87037147316
%N A359222 Number of steps to reach 0 from A359221(n) (Starting numbers that reach a new record high value during iteration by the map x->A359194(x)).
%C A359222 a(12) found by Tom Duff (26 Dec 2022).
%C A359222 It is unknown whether all starting numbers reach 0.
%H A359222 Joshua Searle, <a href="https://qedscience.wordpress.com/2021/02/19/collatz-inspired-sequences/">Collatz-inspired sequences</a>
%e A359222 a(4) is the step count from the starting number A359221(4) = 3: (3, 6, 13, 24, 55, 90, 241, 300, 123, 142, 85, 0) -- 11 steps, hence a(4) = 11.
%o A359222 (Python)
%o A359222 from itertools import count, islice
%o A359222 def f(n): return 1 if n == 0 else (m:=3*n)^((1 << m.bit_length())-1)
%o A359222 def itersmax(n):
%o A359222     i, fi, m = 0, n, n
%o A359222     while fi != 0: i, fi, m = i+1, f(fi), max(m, fi)
%o A359222     return i, m
%o A359222 def agen(): # generator of terms
%o A359222     record = -1
%o A359222     for m in count(0):
%o A359222         v, mx = itersmax(m)
%o A359222         if mx > record:
%o A359222             yield v # use m to obtain starting numbers
%o A359222             record = mx
%o A359222 print(list(islice(agen(), 8))) # _Michael S. Branicky_, Dec 29 2022
%Y A359222 Step counts of A359221.
%Y A359222 Cf. A035327, A359194, A359207, A359208, A359209, A359215, A359218, A359219, A359220, A359255.
%K A359222 nonn,base,more,hard
%O A359222 1,3
%A A359222 _Joshua Searle_, Dec 29 2022