login
The nonnegative terms followed by their first position in the concatenation of all terms of the sequence.
1

%I #17 Jul 08 2024 02:23:12

%S 0,1,1,2,2,4,3,7,4,6,5,11,6,10,7,8,8,18,9,22,10,15,11,2,12,3,13,35,14,

%T 39,15,27,16,13,17,51,18,20,19,59,20,57,21,24,22,4,23,33,24,5,25,81,

%U 26,85,27,45,28,93,29,97,30,101,31,34,32,77,33,36,34,108

%N The nonnegative terms followed by their first position in the concatenation of all terms of the sequence.

%C The nonnegative terms are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, ... They are odd-indexed in the above Data section; the even-indexed terms of the Data section form the last column of the Example section hereunder.

%H Michael S. Branicky, <a href="/A374405/b374405.txt">Table of n, a(n) for n = 1..10000</a>

%e The 1st nonnegative term is 0 and 0 is followed by 1 in the sequence as the earliest 0 of the concatenation of all terms of the sequence is at position 1;

%e the 2nd nonnegative term is 1 and 1 is followed by 2 in the sequence as the earliest 1 of the concatenation of all terms of the sequence is at position 2;

%e the 3rd nonnegative term is 2 and 2 is followed by 4 in the sequence as the earliest 2 of the concatenation of all terms of the sequence is at position 4;

%e the 4th nonnegative term is 3 and 3 is followed by 7 in the sequence as the earliest 3 of the concatenation of all terms of the sequence is at position 7;

%e the 5th nonnegative term is 4 and 4 is followed by 6 in the sequence as the earliest 4 of the concatenation of all terms of the sequence is at position 6;

%e the 6th nonnegative term is 5 and 5 is followed by 11 in the sequence as the earliest 5 of the concatenation of all terms of the sequence is at position 11;

%e the 7th nonnegative term is 6 and 6 is followed by 10 in the sequence as the earliest 6 of the concatenation of all terms of the sequence is at position 10;

%e the 8th nonnegative term is 7 and 7 is followed by 8 in the sequence as the earliest 7 of the concatenation of all terms of the sequence is at position 8;

%e the 9th nonnegative term is 8 and 8 is followed by 18 in the sequence as the earliest 8 of the concatenation of all terms of the sequence is at position 18;

%e the 10th nonnegative term is 9 and 9 is followed by 22 in the sequence as the earliest 9 of the concatenation of all terms of the sequence is at position 22;

%e the 11th nonnegative term is 10 and 10 is followed by 15 in the sequence as the earliest 10 of the concatenation of all terms of the sequence is at position 15;

%e the 12th nonnegative term is 11 and 11 is followed by 2 in the sequence as the earliest 11 of the concatenation of all terms of the sequence is at position 2;

%e the 13th nonnegative term is 12 and 12 is followed by 3 in the sequence as the earliest 12 of the concatenation of all terms of the sequence is at position 3; etc.

%o (Python)

%o from itertools import count, islice

%o def agen(): # generator of terms

%o s = ""

%o for n in count(0):

%o sn = str(n)

%o s += sn

%o locn = 1 + s.index(sn)

%o s += str(locn)

%o yield from [n, locn]

%o print(list(islice(agen(), 70))) # _Michael S. Branicky_, Jul 07 2024

%Y Cf. A001477, A097614.

%K base,nonn

%O 1,4

%A _Eric Angelini_, Jul 07 2024

%E a(63) and beyond from _Michael S. Branicky_, Jul 07 2024