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-9 of 9 results.

A323463 Values of n at which A323454 reaches a new record.

Original entry on oeis.org

1, 2, 3, 99, 369, 999, 1999, 9879, 19979
Offset: 1

Views

Author

N. J. A. Sloane, Jan 23 2019

Keywords

Comments

The corresponding numbers of steps are 0, 1, 11, 12, 13, 14, 15, 16.

Examples

			a(4)=99 refers to the fact that it takes 12 steps to reach 99 from 1 using the Choix de Bruxelles (version 2) operation, and all numbers less than 99 (and not ending in 0 or 5) can be reached from 1 in fewer than 12 steps.
		

Crossrefs

Extensions

a(9) from Michael S. Branicky, Oct 01 2024

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

A323460 Choix de Bruxelles, version 2: 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 (including the empty string).

Original entry on oeis.org

1, 2, 1, 2, 4, 3, 6, 2, 4, 8, 5, 10, 3, 6, 12, 7, 14, 4, 8, 16, 9, 18, 5, 10, 20, 11, 12, 21, 22, 6, 11, 12, 14, 22, 24, 13, 16, 23, 26, 7, 12, 14, 18, 24, 28, 15, 25, 30, 110, 8, 13, 16, 26, 32, 112, 17, 27, 34, 114, 9, 14, 18, 28, 36, 116, 19, 29, 38
Offset: 1

Views

Author

N. J. A. Sloane, Jan 22 2019

Keywords

Comments

The differs from the first version (in A323286) in that now n can be reached from n (by using the empty string).
This slight modification of the definition makes the analysis simpler.
The number of numbers that can be reached from n in one step is A323287(n)+1.
The minimal number of steps to reach n starting at 1 is still given by A323454.

Examples

			Rows 1 through 20 are:
1, 2,
1, 2, 4,
3, 6,
2, 4, 8,
5, 10,
3, 6, 12,
7, 14,
4, 8, 16,
9, 18,
5, 10, 20,
11, 12, 21, 22,
6, 11, 12, 14, 22, 24,
13, 16, 23, 26,
7, 12, 14, 18, 24, 28,
15, 25, 30, 110,
8, 13, 16, 26, 32, 112,
17, 27, 34, 114,
9, 14, 18, 28, 36, 116,
19, 29, 38, 118,
10, 20, 40
		

Crossrefs

Programs

  • Python
    def cdb2(n):
        s, out = str(n), {n}
        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, 21) for c in cdb2(n)]) # Michael S. Branicky, Jul 24 2022

A337321 a(n) is the least number of steps required to reach 1 starting from n under substring substitutions of the form k <-> prime(k) (where prime(k) denotes the k-th prime number).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Aug 23 2020

Keywords

Comments

This sequence is a variant of "Choix de Bruxelles" (where we consider substring substitutions of the form k <-> 2*k, see A323286):
- we map a positive number n to any number that can be obtained as follows:
- take a nonempty substring s (without leading zero) in the decimal representation of n,
- if the value of s corresponds to a prime number, say the k-th prime number, then replace s by k or by prime(s),
- otherwise replace s by prime(s).
For example, the number 17 can be mapped to any of those values:
- 27 (by replacing the leading 1 by prime(1) = 2),
- 14 (by replacing the trailing 7 = prime(4) by 4),
- 117 (by replacing the trailing 7 by prime(7) = 17),
- 7 (by replacing 17 = prime(7) by 7),
- 59 (by replacing 17 by prime(17) = 59).
This sequence is well defined:
- the sequence is well defined for any number <= 11 by considering the following (minimal) paths:
1
2 -> 1
3 -> 2 -> 1
4 -> 7 -> 17 -> 27 -> 37 -> 12 -> 11 -> 5 -> 3 -> 2 -> 1
5 -> 3 -> 2 -> 1
6 -> 13 -> 12 -> 11 -> 5 -> 3 -> 2 -> 1
7 -> 17 -> 27 -> 37 -> 12 -> 11 -> 5 -> 3 -> 2 -> 1
8 -> 19 -> 67 -> 137 -> 127 -> 31 -> 11 -> 5 -> 3 -> 2 -> 1
9 -> 23 -> 13 -> 12 -> 11 -> 5 -> 3 -> 2 -> 1
10 -> 20 -> 71 -> 41 -> 13 -> 12 -> 11 -> 5 -> 3 -> 2 -> 1
11 -> 5 -> 3 -> 2 -> 1
- so for any number n:
- we can transform any of its nonzero digit > 1 into a digit 1,
- once we have a number with only 1's and 0's:
- while this number is > 1, it either starts with "10" or with "11",
and we can transform this prefix into a "1",
- and eventually we will reach 1.

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(prime(n)) <= 1 + a(n).

A323484 Minimal number of steps to reach 5*n from 5 using "Choix de Bruxelles" version 2 (cf. A323460).

Original entry on oeis.org

0, 1, 11, 2, 11, 12, 8, 3, 10, 12, 9, 11, 7, 9, 10, 4, 9, 10, 10, 13, 10, 10, 7, 10, 8, 6, 9, 9, 9, 9, 8, 5, 10, 8, 11, 9, 10, 9, 11, 14, 11, 11, 8, 10, 8, 7, 10, 9, 9, 9, 9, 6, 9, 9, 11, 8, 9, 10, 10, 10, 9, 7, 12, 6, 11, 11, 11, 7, 11, 12, 10, 10, 11, 10, 13
Offset: 1

Views

Author

Rémy Sigrist, Jan 16 2019

Keywords

Comments

This is equally the minimal number of steps to reach 5*n from 5 using "Choix de Bruxelles" version 1 (cf. A323286). - N. J. A. Sloane, Jan 24 2019
The sequence is well defined as we can reach any multiple of 5 starting from 5.

Crossrefs

A337357 "Choix de Collatz": a(n) is the least number of steps required to reach 1 starting from n under substring substitutions of the form k -> T(k) (where T is the Collatz map, A006370).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist and N. J. A. Sloane, Aug 24 2020

Keywords

Comments

This sequence is a variant of "Choix de Bruxelles" (where we consider substring substitutions of the form k <-> 2*k, see A323286):
- we map a positive number n to any number that can be obtained as follows:
- take a nonempty substring s (without leading zero) in the decimal representation of n,
- if the value of s corresponds to an even number, replace s by s/2,
- otherwise replace s by 3*s + 1.
The sequence is well defined:
- the proof is similar to that described in A337321,
- the initial paths to consider here are the following:
1
2 -> 1
3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1
4 -> 2 -> 1
5 -> 16 -> 8 -> 4 -> 2 -> 1
6 -> 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1
7 -> 22 -> 11 -> 34 -> 32 -> 16 -> 8 -> 4 -> 2 -> 1
8 -> 4 -> 2 -> 1
9 -> 28 -> 24 -> 22 -> 21 -> 64 -> 32 -> 16 -> 8 -> 4 -> 2 -> 1
10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1
11 -> 34 -> 32 -> 16 -> 8 -> 4 -> 2 -> 1

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) <= A006577(n) (when A006577(n) >= 0).

A358708 Starting from 1, successively take the smallest "Choix de Bruxelles" (A323286) which is not already in the sequence.

Original entry on oeis.org

1, 2, 4, 8, 16, 13, 23, 26, 46, 43, 83, 86, 166, 133, 136, 68, 34, 17, 27, 47, 87, 167, 137, 174, 172, 171, 271, 272, 236, 118, 19, 29, 49, 89, 169, 139, 178, 278, 239, 269, 469, 439, 478, 474, 237, 267, 467, 437, 837, 867, 1667, 1337, 1367, 687, 347, 177, 277, 477, 877, 1677, 1377, 1747, 1727, 1717, 1734, 1732, 866, 433, 233, 263, 163, 323, 313, 316, 38, 76, 73, 143, 123, 63, 33, 36, 18, 9
Offset: 0

Views

Author

Alon Vinkler, Nov 26 2022

Keywords

Comments

The Choix de Bruxelles doubles or halves some decimal digit substring and rows of A323286 are all ways this can be done.
So a(n) is the smallest term of the row a(n-1) of A323286 which is not among {a(0..n-1)}.
The sequence is finite since having reached 18 -> 9 the sole Choix for 9 would be back to 18, which is already in the sequence.

Examples

			Below, square brackets [] represent multiplication by 2 (e.g., [6] = 12); curly brackets {} represent division by 2 (e.g., {6} = 3); digits outside the brackets are not affected by the multiplication or division (e.g., 1[6] = 112 and 1{14} = 17).
We begin with 1 and, at each step, we go to the smallest number possible that hasn't yet appeared in the sequence:
 1 --> [1]  =  2
 2 --> [2]  =  4
 4 --> [4]  =  8
 8 --> [8]  = 16
 16 --> 1{6} = 13
 13 --> [1]3 = 23
 23 --> 2[3] = 26
 26 --> [2]6 = 46
 ... and so on.
		

Crossrefs

A323464 Values of n at which A323484 reaches a new record.

Original entry on oeis.org

1, 2, 3, 6, 20, 40, 80, 1975, 3999, 15995, 39999
Offset: 1

Views

Author

N. J. A. Sloane, Jan 23 2019

Keywords

Comments

The corresponding numbers of steps are 0, 1, 11, 12, 13, 14, 15, 16, 17.

Examples

			a(4)=20 refers to the fact that it takes 13 steps to reach 100 from 5 using the Choix de Bruxelles (version 2) operation, and all multiples of 5 less than 100 can be reached from 5 in fewer than 13 steps.
		

Crossrefs

Extensions

a(10) from Michael S. Branicky, Oct 05 2024
a(11) from Michael S. Branicky, Oct 11 2024

A334629 Smallest number that can be obtained by starting with 1 and applying "Choix de Bruxelles (version 2)" (see A323460) n times without backtracking or repeating.

Original entry on oeis.org

1, 2, 4, 8, 16, 13, 23, 17, 14, 7, 6, 3, 99, 369, 999, 1999, 9879, 19979
Offset: 0

Views

Author

Philip C. Ritchey, Sep 09 2020

Keywords

Examples

			a(0)-a(4) = 1,2,4,8,16 by applying 0,1,2,3,4 steps: 1->2->4->8->16.
a(5) = 13 by applying 5 steps: 1->2->4->8->16->13 (halve the 6 in 16).
a(11) = 3 by applying 11 steps to reach 3 from 1.
		

Crossrefs

Formula

A323454(a(n)) = n by definition.

Extensions

a(17) from Michael S. Branicky, Oct 01 2024
Showing 1-9 of 9 results.