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.

A323289 Total number of distinct numbers that can be obtained by starting with 1 and applying the "Choix de Bruxelles", version 2 (A323460) operation at most n times.

This page as a plain text file.
%I A323289 #38 Jan 09 2025 13:00:48
%S A323289 1,2,3,4,5,9,24,59,136,362,1365,5992,28187,135951,689058,3908456,
%T A323289 24849118,171022869,1248075797
%N A323289 Total number of distinct numbers that can be obtained by starting with 1 and applying the "Choix de Bruxelles", version 2 (A323460) operation at most n times.
%C A323289 Equally, this is the total number of distinct numbers that can be obtained by starting with 1 and applying the "Choix de Bruxelles", version 1 (A323286) operation at most n times.
%H A323289 Eric Angelini, Lars Blomberg, Charlie Neder, Remy Sigrist, and N. J. A. Sloane, <a href="http://arxiv.org/abs/1902.01444">"Choix de Bruxelles": A New Operation on Positive Integers</a>, arXiv:1902.01444 [math.NT], Feb 2019; Fib. Quart. 57:3 (2019), 195-200.
%H A323289 Eric Angelini, Lars Blomberg, Charlie Neder, Remy Sigrist, and N. J. A. Sloane,, <a href="/A307635/a307635.pdf">"Choix de Bruxelles": A New Operation on Positive Integers</a>, Local copy.
%e A323289 After applying Choix de Bruxelles (version 1) twice to 1, we have seen the numbers {1,2,4}, so a(2)=3. After 5 applications, we have seen {1,2,4,8,16,13,26,32,112}, so a(5) = 9.
%o A323289 (Python)
%o A323289 from itertools import islice
%o A323289 def cdb2(n):
%o A323289     s, out = str(n), {n}
%o A323289     for l in range(1, len(s)+1):
%o A323289         for i in range(len(s)+1-l):
%o A323289             if s[i] == '0': continue
%o A323289             t = int(s[i:i+l])
%o A323289             out.add(int(s[:i] + str(2*t) + s[i+l:]))
%o A323289             if t&1 == 0: out.add(int(s[:i] + str(t//2) + s[i+l:]))
%o A323289     return out
%o A323289 def agen():
%o A323289     reach, expand = {1}, [1]
%o A323289     while True:
%o A323289         yield len(reach)
%o A323289         newreach = {r for q in expand for r in cdb2(q) if r not in reach}
%o A323289         reach |= newreach
%o A323289         expand = list(newreach)
%o A323289 print(list(islice(agen(), 15))) # _Michael S. Branicky_, Jul 24 2022
%Y A323289 Cf. A323286, A323287, A323452 (first differences), A323453, A323460.
%K A323289 nonn,more,base
%O A323289 0,2
%A A323289 _N. J. A. Sloane_, Jan 15 2019
%E A323289 a(7)-a(16) from _Rémy Sigrist_, Jan 15 2019
%E A323289 Deleted an incorrect comment. - _N. J. A. Sloane_, Jan 24 2019
%E A323289 a(17) from _Michael S. Branicky_, Jul 24 2022
%E A323289 a(18) from _Michael S. Branicky_, Jul 26 2022