OFFSET
1,2
COMMENTS
As in A389140, the substring replaced must be even and cannot begin with a 0 digit, and there may be multiple different replacements possible and the aim is to find whether any sequence of steps can reach final value 1.
All even numbers, except multiples of 5 and the 24 even numbers that terminate at 3 (see A389305), appear in this sequence.
No odd terms > 1. - Michael S. Branicky, Sep 28 2025
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
176 is a term since it can reach 1 by trajectory 176-->138-->134-->132-->116-->58-->54-->52-->26-->16-->8-->4-->2-->1.
PROG
(Python)
from functools import cache
def children(n):
s = str(n)
return set(int(s[:i]+str(q>>1)+s[j:]) for i in range(len(s)) for j in range(i+1, len(s)+1) if (w:=s[i:j])[0]!='0' and (q:=int(w))&1==0)
@cache
def ok(n):
if n > 1 and n&1: return False # no odds other than 1
if n.bit_count() == 1: return True # powers of 2
return any(ok(c) for c in children(n))
print([k for k in range(195) if ok(k)]) # Michael S. Branicky, Sep 28 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ali Sada, Sep 27 2025
STATUS
approved
