login
A386551
Numbers that can terminate in 1 by successively dividing a contiguous substring of digits by 2.
2
1, 2, 4, 8, 16, 26, 32, 34, 38, 46, 52, 54, 58, 62, 64, 68, 76, 86, 92, 94, 98, 102, 104, 108, 112, 114, 116, 118, 122, 124, 126, 128, 132, 134, 136, 138, 142, 144, 146, 148, 152, 154, 156, 158, 162, 164, 166, 168, 172, 174, 176, 178, 182, 184, 186, 188, 192, 194
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
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
Supersequence of A000079.
Sequence in context: A070789 A302588 A382381 * A348656 A354146 A354255
KEYWORD
nonn,base
AUTHOR
Ali Sada, Sep 27 2025
STATUS
approved