Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #37 Oct 18 2023 10:06:16
%S 1,2,3,4,5,6,7,8,9,10,11,12,21,22,23,32,33,34,43,44,45,54,55,56,65,66,
%T 67,76,77,78,87,88,89,98,99,100,101,102,201,202,203,302,303,304,403,
%U 404,405,504,505,506,605,606,607,706,707,708,807,808,809,908,909
%N a(1) = 1; a(2) = 2; for n > 2, a(n) = R(a(n-1)) if a(n-1) != R(a(n-2)) and R(a(n-1)) has not yet been used, where R is the digit reversal function A004086, otherwise a(n) is the smallest positive integer > a(n-1) that has not yet been used.
%C A regular pattern of rectangles, each 10 times larger than the last, appears on the scatter plot of this sequence. However, there are moments where the sequence deviates from its current rectangle to drop down to lower orders of magnitude or jump up to higher ones. Additionally, chaotic behavior can be observed at values of n in the approximate intervals [60000, 63000], [68000, 82000], and [85000, 100000].
%C Not all integers appear in this sequence. The smallest number that will never occur is 130, as the only way to achieve the number is through 129, which had already been used to jump to 921.
%H Sylvia Zevi Abrams, <a href="/A355617/b355617.txt">Table of n, a(n) for n = 1..10000</a> [Corrected to remove leading 0's by _Sean A. Irvine_]
%H Sylvia Zevi Abrams, <a href="https://i.imgur.com/BBZBUpe.png">Scatter Plot, for n < 100000</a>
%e a(11) = 11 because R(a(10)) = 1, which was already used as a(1).
%e a(13) = 21 because R(a(12)) = 21, which had not yet been used, and a(11) =! R(a(12)).
%e a(64) = 20 because although R(a(63)) = 91 and 91 has not yet been used, a(63) = R(a(62)).
%o (PARI) R(n) = fromdigits(Vecrev(digits(n))); \\ A004086
%o leastunused(va, m) = my(k=va[m]+1); while (#select(x->(x==k), va), k++); k;
%o lista(nn) = my(va = vector(nn)); va[1] = 1; va[2] = 2; for (n=3, nn, if ((va[n-1] != R(va[n-2])) && !#select(x->(x==R(va[n-1])), va), va[n] = R(va[n-1]), va[n] = leastunused(va, n-1));); va; \\ _Michel Marcus_, Jul 12 2022
%Y Cf. A004086.
%K base,easy,look,nonn
%O 1,2
%A _Sylvia Zevi Abrams_, Jul 09 2022