cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A341936 a(0) = 0; for n > 0, a(n) is the smallest positive integer not yet in the sequence that can be created by adding 1, 0, or -1, for digits > 0, to every digit in a(n-1).

This page as a plain text file.
%I A341936 #20 Feb 27 2021 21:55:09
%S A341936 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,28,27,26,25,24,23,
%T A341936 22,21,20,30,31,32,33,34,35,36,37,38,29,39,48,47,46,45,44,43,42,41,40,
%U A341936 50,51,52,53,54,55,56,57,58,49,59,68,67,66,65,64,63,62,61,60,70,71,72,73
%N A341936 a(0) = 0; for n > 0, a(n) is the smallest positive integer not yet in the sequence that can be created by adding 1, 0, or -1, for digits > 0, to every digit in a(n-1).
%C A341936 Each individual digit in a(n-1) has either -1,0, or 1 added to it to find the next term. For example 23 can become 12,13,14,22,23,24,32,33,34. Of these options the lowest number not previously seen is then chosen for a(n). A 1 digit becomes 0,1 or 2, a zero digit becomes 0 or 1, while a 9 digit becomes 8,9 or 10 in the next term, e.g. 19 can become 8,9,10,18,19,110,28,29,210. Note that if a leading 1 becomes a 0 it is dropped, along with other leading 0's, for the next term.
%C A341936 The sequence is likely a permutation of the nonnegative integers. The lowest unused number after 1 million terms is 999897.
%H A341936 Scott R. Shannon, <a href="/A341936/a341936.png">Scatterplot of the first 1 million terms</a>.
%H A341936 Scott R. Shannon, <a href="/A341936/a341936_1.png">Line graph of the first 1 million terms</a>.
%e A341936 a(1) = 1 as a(0) = 0 and the two numbers that can be created from 0 are 0 and 1, since 0 cannot have 1 subtracted. 0 has already occurred so 1 must be chosen.
%e A341936 a(20) = 28 as a(19) = 19 and the nine numbers that can be created from 19 are 8,9,10,18,19,110,28,29,210. The numbers 8,9,10,18,19 have already occurred and 28 is the smallest of the other four possibilities, so 28 is chosen.
%e A341936 a(29) = 30 as a(28) = 20 and the six numbers that can be created from 20 are 10,11,20,21,30,31. The numbers 10,11,20,21 have already occurred and 30 is the smallest of the other two possibilities, so 30 is chosen.
%e A341936 a(1870) = 995 as a(1869) = 1886 and of the 81 possible numbers that can be created from 1886, 995 is the smallest that has not previously occurred. This example shows that the terms can have a large drop in value if the leading digit can decrease by 1.
%e A341936 a(1875) = 8108 as a(1874) = 999 and of the 27 possible numbers that can be created from 999, 8108 is the smallest that has not previously occurred. This example shows that the terms can have a large increase in value if any of its 9 digits are forced to increase to 10.
%t A341936 Nest[Block[{a = #, n = #[[-1]]}, Append[a, SelectFirst[Union@ Map[FromDigits@ DeleteCases[Flatten@ IntegerDigits[IntegerDigits[n] + #], _?(AnyTrue[#, # < 0 &] &)] &, Tuples[{-1, 0, 1}, IntegerLength[n]]], FreeQ[a, #] &]]] &, {0, 1}, 71] (* _Michael De Vlieger_, Feb 27 2021 *)
%Y A341936 Cf. A341935 (add 1 or -1), A001477, A000027, A033075, A341002, A331163.
%K A341936 nonn,base
%O A341936 0,3
%A A341936 _Scott R. Shannon_, Feb 23 2021