login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A330599
If a(n) uses fewer digits than a(n+1), we compute K = |a(n) - a(n+1)|. The successive such Ks rebuild the sequence itself, with a(1) = 5.
1
5, 10, 1, 11, 99, 100, 2, 13, 112, 3, 103, 998, 1000, 4, 17, 129, 9, 12, 115, 1113, 6, 1006, 97, 101, 7, 24, 153, 93, 102, 8, 20, 135, 1248, 98, 104, 1110, 14, 111, 15, 116, 994, 1001, 81, 105, 16, 169, 21, 114, 18, 120, 995, 1003, 86, 106, 19, 154, 1402, 23, 121, 22, 126, 1236, 94, 108, 25, 136, 92, 107, 26
OFFSET
1,1
COMMENTS
The intent of the authors was not to produce the lexicographically earliest sequence S of distinct terms > 0 with this property; instead they used two rules:
Let x be the current last term, y the next term, z the term after that and w a previous term to be matched. The number of digits in x is denoted $x$.
The two rules are:
1) If possible, y is selected so that y - x = w and $y$ > $x$, for example x=5, y=10, w=5 in (5, 10);
2) Otherwise first select y with $y$ <= $x$ and then z so that z - y = w and $z$ > $y$, for example x=10, y=1, z=11, w=10 in (5, 10, 1, 11).
(See the end of the Example section for more.)
LINKS
EXAMPLE
As 5 uses fewer digits than 10, we compute K1 = |5-10| = 5;
as 10 uses more digits than 1, we don't do anything;
as 1 uses fewer digits than 11, we compute K2 = |1-11| = 10;
as 11 and 99 use the same number of digits, we don't do anything;
as 99 uses fewer digits than 100, we compute K3 = |99-100| = 1;
as 100 uses more digits than 2, we don't do anything;
as 2 uses fewer digits than 13, we compute K4 = |2-13| = 11;
as 13 uses fewer digits than 112, we compute K5 = |13-112| = 99; etc.
We see that the succession of K1, K2, K3, K4, K5, ... reproduces S.
a(4) = 11 illustrates the Comments section, as a(4) = 2 could also extend S with no contradiction. But 11, one digit longer than 2, was chosen instead.
a(9) = 112 illustrates the same option, as a(9) = 4 could also extend S with no contradiction. But 112, one digit longer than 13, was preferred.
CROSSREFS
Sequence in context: A357280 A370131 A258150 * A099731 A307716 A091306
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Lars Blomberg, Dec 19 2019
STATUS
approved