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.

A371966 Largest number reachable starting from 1 and taking n steps either doubling or doubling+reversing.

This page as a plain text file.
%I A371966 #16 Apr 16 2024 14:02:34
%S A371966 1,2,4,8,61,221,442,884,8671,24371,60721,244121,881371,2898371,
%T A371966 8692591,48826601,97653202,484336211,968672422,6847550561,24334620331,
%U A371966 68473110671,247696944631,884738088671,2892570042961,8872433043671,44817108207511,89634216415022,486415512459511
%N A371966 Largest number reachable starting from 1 and taking n steps either doubling or doubling+reversing.
%C A371966 At each step you are allowed to either double x -> 2*x or double and reverse x -> R(2*x), where R(x) = A004086(x) is decimal digit reversal.
%H A371966 Michael S. Branicky, <a href="/A371966/b371966.txt">Table of n, a(n) for n = 0..34</a>
%F A371966 a(n) <= 20^n and a(n+1) <= 20*a(n).
%e A371966 a(4) = 61 by the path 1, 2, 4, 8, 61.
%o A371966 (Python)
%o A371966 from itertools import islice
%o A371966 def reverse(n): return int(str(n)[::-1])
%o A371966 def agen(): # generator of terms
%o A371966     reach = {1}
%o A371966     while True:
%o A371966         yield max(reach)
%o A371966         newreach = set()
%o A371966         for q in reach: newreach.update([2*q, reverse(2*q)])
%o A371966         reach = newreach
%o A371966 print(list(islice(agen(), 28))) # _Michael S. Branicky_, Apr 14 2024
%Y A371966 Cf. A004086, A371880.
%K A371966 nonn,base
%O A371966 0,2
%A A371966 _Bryle Morga_ and _Michael S. Branicky_, Apr 14 2024