Successive triples, same pattern


Hello Math-Fun,

See the hereunder sequence S as a succession of triples (we use yellow and red colors to highlight them):

S = 0, 2, 1, 3, 5, 4, 6, 8, 7, 12, 13, 9, 10, 20, 14, 11, 21, 15, 16, 70, 17, 18, 90, 19, 22, 30, 23, 24, 50, 25, 26, 71, 27, 28, 91, 29, 31, 40, 34, 32, 41, 35, 33, 42, 36, 37, 80, 38, 43, 51, 39,...

0, 2, 1, 3, 5, 4, 6, 8, 7, 12, 13, 9, 10, 20, 14, 11, 21, 15, 16, 70, 17, 18, 90, 19, 22, 30, 23, 24, 50, 25, 26, 71, 27, 28, 91, 29, 31, 40, 34, 32, 41, 35, 33, 42, 36, 37, 80, 38, 43, 51, 39,...

There is an obvious pattern in those triples: the central integer n2 in a triple is strictly bigger than its two neighbors.
We have  [n1 < n2 > n3].

S is peculiar – as the same pattern is present in the successive triples of digits (we use below blue and cyan colors to highlight them): the central digit d2 in a digit-triple is strictly bigger than its two neighbors.
We have [d1 < d2 > d3]:

0, 2, 1, 3, 5, 4, 6, 8, 7, 12, 13, 9, 10, 20, 14, 11, 21, 15, 16, 70, 17, 18, 90, 19, 22, 30, 23, 24, 50, 25, 26, 71, 27, 28, 91, 29, 31, 40, 34, 32, 41, 35, 33, 42, 36, 37, 80, 38, 43, 51, 39,...

We wanted S to be the lexicographically earliest sequence of distinct nonnegative terms with this property.

Quiz
1) what is the smallest integer that will never be part of S?
2) what is the first wrong integer of S (as S was a nightmare to build by hand – my apologizes). 

Best,
É.
__________
P.-S.
More such patterns might be interesting to explore: [a > b < c], [a < b < c], [a > b > c], etc.
__________
Update, December 12
Maximilian was quick to answer both questions:

1) I think it's 99 because consecutive equal digits must be the last 
of one triple and the first of the next triple, but 9 can't be the
last nor the first of a triple because the central one must be larger.

Then the next "impossible" term is probably 109, where digits "10" 
must be the last two of a triple, but again, 9 can't be the first 
of the next triple.
110 is also impossible, again the two '11' must be last and first
of two consecutive triples, but 0 can't be the central one. 
In general, two equal digits must always be preceded and followed 
by a strictly larger digit. For that reason,  111 and 122 etc are 
also impossible.

2) > What is the first wrong integer of S (as S was a nightmare to 
   build by hand).

... There is no wrong integer in S! 
(Nor in your computation - at least according to my program. 
  Congratulations!)

[A special situation happens first after S(83)=78.
At first sight, the term 101 seems possible for S(84), but then the
next term would have to start with a digit 0, which is impossible.
So one has to take S(84) = 102, which is followed by 104, 103, 105, 
107, 106, 108, 109, 82, 83, 89, 84, 85, 120, 79, 86,...
after which we need a larger digit followed by a smaller digit.
87 and 93 ... 98 would be available, but for none of these there's 
a possible (smaller) successor (a number with two digits in increasing 
order) therefore the smallest possible successor is the very "early 
bird" 700.]

- Maximilian


 

  


Commentaires

Enregistrer un commentaire

Posts les plus consultés de ce blog

Beautés ?

Le tripalin se présente

Underline, reproduce