OFFSET
1,3
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.
LINKS
Rémy Sigrist, PARI program for A337321
FORMULA
a(prime(n)) <= 1 + a(n).
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Aug 23 2020
STATUS
approved