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.

Showing 1-6 of 6 results.

A323452 First differences of A323289.

Original entry on oeis.org

1, 1, 1, 1, 4, 15, 35, 77, 226, 1003, 4627, 22195, 107764, 553107, 3219398, 20940662, 146173751, 1077052928
Offset: 1

Views

Author

N. J. A. Sloane, Jan 15 2019

Keywords

Crossrefs

Extensions

a(7)-a(16) from Rémy Sigrist, Jan 15 2019
a(17) from Michael S. Branicky, Jul 24 2022
a(18) from Michael S. Branicky, Jul 26 2022

A323286 Choix de Bruxelles (version 1): irregular table read by rows in which row n lists all the legal numbers that can be reached by halving or doubling some substring of the decimal expansion of n.

Original entry on oeis.org

2, 1, 4, 6, 2, 8, 10, 3, 12, 14, 4, 16, 18, 5, 20, 12, 21, 22, 6, 11, 14, 22, 24, 16, 23, 26, 7, 12, 18, 24, 28, 25, 30, 110, 8, 13, 26, 32, 112, 27, 34, 114, 9, 14, 28, 36, 116, 29, 38, 118, 10, 40, 11, 22, 41, 42, 11, 12, 21, 24, 42, 44, 13, 26, 43, 46, 12
Offset: 1

Views

Author

N. J. A. Sloane, Jan 14 2019

Keywords

Comments

Take the decimal expansion of n, say n = d_1 d_2 ... d_k. We can choose to map it to any number that can be obtained by the following process. Take any substring d_i, d_{i+1}..., d_j that does not begin with 0. If the number represented by this substring is odd, replace it with twice the number. If it is even either halve it or double it.
The substring may increase or decrease in length. We do not pad it with zeros if it decreases in length.
For example, if n = 20129, then by acting on single-digit substrings we get 10129, 40129, 20229, 20119, 20149, 201218. Acting on 2-digit substrings we get in addition 2069 (halve the 12!), 20249, 20158. From 3-digit substrings we also get 40229, 20258; from 4-digit substrings we get 40249; and from 5-digit substrings we get 40258.
Eric Angelini asks what is the smallest number of steps needed to reach n if we start at 1 and repeatedly apply this process? We can reach 2 in 1 step, 4 in 2 steps, 13 in five steps, and so on.
Lars Blomberg has shown, by considering just the final digit of the numbers in the trajectory, that no number ending in 0 or 5 can be reached from 1. All other numbers can be reached (cf. A323454) - see proof below.
Update, Jan 15 2019: Lorenzo Angelini has found that 3 can be reached from 1 in 11 steps: 1, 2, 4, 8, 16, 112, 56, 28, 14, 12, 6, 3. No shorter path is possible.
From N. J. A. Sloane, Jan 16 2019: (Start)
Theorem: If k > 1 does not end in 0 or 5 then it can be reached from 1.
Proof: Suppose not, and let k be the smallest such number. Note that the allowed operations are invertible: if a -> b then also b -> a. So that means that
*** all the descendants of k must be bigger than k ***
(if there was a descendant < k, then it would also be unreachable from 1, which is a contradiction to k being the smallest).
All digits of k must be odd (if there were an even digit > 0, halve it and get a smaller number; if there is a zero digit, say we see a0, then we halve a0 and get a smaller number).
If all the digits of k are 1, do 111...1 -> 111...2 -> 55..56, a smaller number.
If there is a digit 3, 7, or 9, we know we can get that single digit down to 1 (see A323454), again a contradiction.
But all the digits can't be 5. QED (End)

Examples

			The triangle begins:
   2;
   1,   4;
   6;
   2,   8;
  10;
   3,  12;
  14;
   4,  16;
  18;
   5,  20;
  12,  21,  22;
   6,  11,  14,  22,  24;
  16,  23,  26;
   7,  12,  18,  24,  28;
  25,  30, 110;
   8,  13,  26,  32, 112;
  27,  34, 114;
   9,  14,  28,  36, 116;
  29,  38, 118;
  10,  40;
  11,  22,  41,  42;
  11,  12,  21,  24,  42,  44;
  ...
		

References

  • Eric Angelini, Email to N. J. A. Sloane, Jan 14 2019.

Crossrefs

The number of terms in row n is given by A323287.
See A323460 for the (preferred) version 2 where n can also be mapped to itself.
See also A323288 (row maxima), A323289, A323452, A323453, A323454, A323455 (a binary analog).
For variants of the Choix de Bruxelles operation, see A337321 and A337357.

Programs

  • PARI
    See Sigrist link.
    
  • Python
    def cdb(n):
        s, out = str(n), set()
        for l in range(1, len(s)+1):
            for i in range(len(s)+1-l):
                if s[i] == '0': continue
                t = int(s[i:i+l])
                out.add(int(s[:i] + str(2*t) + s[i+l:]))
                if t&1 == 0: out.add(int(s[:i] + str(t//2) + s[i+l:]))
        return sorted(out)
    print([c for n in range(1, 25) for c in cdb(n)]) # Michael S. Branicky, Jul 24 2022

Extensions

Data corrected by Rémy Sigrist, Jan 15 2019

A323454 Minimal number of steps to reach n from 1 using "Choix de Bruxelles", version 2 (cf. A323460), or -1 if n cannot be reached.

Original entry on oeis.org

0, 1, 11, 2, -1, 10, 9, 3, 9, -1, 10, 9, 5, 8, -1, 4, 7, 8, 8, -1, 10, 9, 6, 8, -1, 5, 8, 7, 9, -1, 6, 5, 10, 6, -1, 9, 9, 7, 9, -1, 11, 10, 7, 9, -1, 6, 9, 8, 10, -1, 7, 6, 7, 7, -1, 6, 7, 8, 8, -1, 7, 6, 11, 6, -1, 10, 10, 7, 10, -1, 8, 8, 9, 8, -1, 8, 11, 8
Offset: 1

Views

Author

N. J. A. Sloane, Jan 15 2019

Keywords

Comments

This is equally the minimal number of steps to reach n from 1 using "Choix de Bruxelles", version 1 (cf. A323286), or -1 if n cannot be reached.
n cannot be reached if its final digit is 0 or 5, but all other numbers can be reached (see comments in A323286).

Examples

			Examples of optimal ways to reach 1,2,3,...:
1
1, 2
1, 2, 4, 8, 16, 112, 56, 28, 14, 12, 6, 3
1, 2, 4
5 cannot be reached, ends in 0 or 5
1, 2, 4, 8, 16, 112, 56, 28, 14, 12, 6
1, 2, 4, 8, 16, 112, 56, 28, 14, 7
1, 2, 4, 8,
1, 2, 4, 8, 16, 112, 56, 28, 18, 9.
10 cannot be reached, ends in 0 or 5
1, 2, 4, 8, 16, 112, 56, 28, 24, 22, 11
1, 2, 4, 8, 16, 112, 56, 28, 14, 12
1, 2, 4, 8, 16, 13
1, 2, 4, 8, 16, 112, 56, 28, 14
15 cannot be reached, ends in 0 or 5
1, 2, 4, 8, 16
1, 2, 4, 8, 16, 32, 34, 17
1, 2, 4, 8, 16, 112, 56, 28, 18
1, 2, 4, 8, 16, 32, 34, 38, 19
20 cannot be reached, ends in 0 or 5
...
		

Crossrefs

For variants of the Choix de Bruxelles operation, see A337321 and A337357.

Extensions

More terms from Rémy Sigrist, Jan 15 2019

A323453 Largest number that can be obtained by starting with 1 and applying "Choix de Bruxelles (version 2)" (see A323460) n times.

Original entry on oeis.org

1, 2, 4, 8, 16, 112, 224, 512, 4416, 44112, 88224, 816448, 8164416, 81644112, 811288224, 8112816448, 81128164416, 811281644112, 8112811288224, 81128112816448, 811281128164416, 8112811281644112, 81128112811288224, 811281128112816448, 8118112281128164416, 81181122811281644112
Offset: 0

Views

Author

N. J. A. Sloane, Jan 15 2019

Keywords

Comments

Also, largest number that can be obtained by starting with 1 and applying the original "Choix de Bruxelles" version 1 operation (as defined in A323286) at most n times.
a(n) is the largest number that can be obtained by applying Choix de Bruxelles (version 2) to all the numbers that can be reached from 1 by applying it n-1 times.
a(n+1) >= A323460(a(n)) (but equality does not always hold). See A307635. - Rémy Sigrist, Jan 15 2019

Examples

			After applying Choix de Bruxelles (version 2) 4 times to 1, we have the numbers {1,2,4,8,16}. Applying it a fifth time we get the additional numbers {13,26,32,112}, so a(5) = 112.
		

Crossrefs

Formula

a(n+4) = decimal concatenation of 8112 and a(n) for n >= 10.

Extensions

a(9)-a(16) from Rémy Sigrist, Jan 15 2019. Further terms from N. J. A. Sloane, May 01 2019

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

Original entry on oeis.org

1, 2, 3, 4, 5, 9, 19, 45, 107, 275, 778, 2581, 10170, 45237, 222859, 1191214, 6887258, 42894933, 287397837
Offset: 0

Views

Author

J. Conrad, Aug 09 2022

Keywords

Examples

			For n=4, the a(4) = 5 numbers obtained are (in base 12): 1, 2, 4, 8, 14.
For n=5, they expand to a(5) = 9 numbers (in base 12): 1, 2, 4, 8, 12, 14, 18, 24, 28.
		

Crossrefs

Cf. A323289 (decimal).

Programs

  • Python
    # See Conrad link.
    
  • Python
    from itertools import islice
    from sympy.ntheory import digits
    def fd12(d): return sum(12**i*di for i, di in enumerate(d[::-1]))
    def cdb2(n):
        d, out = digits(n, 12)[1:], {n}
        for l in range(1, len(d)+1):
            for i in range(len(d)+1-l):
                if d[i] == 0: continue
                t = fd12(d[i:i+l])
                out.add(fd12(d[:i] + digits(2*t, 12)[1:] + d[i+l:]))
                if t&1 == 0:
                    out.add(fd12(d[:i] + digits(t//2, 12)[1:] + d[i+l:]))
        return out
    def agen():
        reach, expand = {1}, [1]
        while True:
            yield len(reach)
            newreach = {r for q in expand for r in cdb2(q) if r not in reach}
            reach |= newreach
            expand = list(newreach)
    print(list(islice(agen(), 14))) # Michael S. Branicky, Aug 17 2022

Extensions

a(16)-a(18) from Michael S. Branicky, Aug 17 2022

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

Original entry on oeis.org

1, 2, 3, 6, 11, 26, 68, 177, 492, 1403, 4113, 12149, 36225, 108268, 324529, 973163, 2920533, 8764041, 26303715, 78935398, 236878491, 710783343
Offset: 0

Views

Author

J. Conrad, Aug 24 2022

Keywords

Examples

			For n = 2, a(2) = 3 since the numbers obtained are (in base 3): 1, 2, 11.
For n = 4, they expand to a(5) = 11 numbers (in base 3): 1, 2, 11, 12, 21, 22, 101, 111, 112, 121, 211.
		

Crossrefs

Cf. A323289 (decimal), A356511 (base 12)

Programs

  • Python
    # See Conrad link.
    
  • Python
    from itertools import islice
    from sympy.ntheory import digits
    def fd(d, b): return sum(b**i*di for i, di in enumerate(d[::-1]))
    def cdb2(n, base=3):
        d, out = digits(n, base)[1:], {n}
        for l in range(1, len(d)+1):
            for i in range(len(d)+1-l):
                if d[i] == 0: continue
                t = fd(d[i:i+l], base)
                out.add(fd(d[:i] + digits(2*t, base)[1:] + d[i+l:], base))
                if t&1 == 0:
                    out.add(fd(d[:i] + digits(t//2, base)[1:] + d[i+l:], base))
        return out
    def agen():
        reach, expand = {1}, [1]
        while True:
            yield len(reach) #; print(reach); print([digits(t, 3)[1:] for t in sorted(reach)])
            newreach = {r for q in expand for r in cdb2(q) if r not in reach}
            reach |= newreach
            expand = list(newreach)
    print(list(islice(agen(), 10))) # Michael S. Branicky, Aug 24 2022

Extensions

a(15)-a(19) from Michael S. Branicky, Aug 24 2022
a(20)-a(21) from Michael S. Branicky, Aug 30 2022
Showing 1-6 of 6 results.