login
Positive integers with digits in decreasing order that differ by 2.
0

%I #10 Aug 27 2017 23:18:36

%S 1,2,3,4,5,6,7,8,9,20,31,42,53,64,75,86,97,420,531,642,753,864,975,

%T 6420,7531,8642,9753,86420,97531

%N Positive integers with digits in decreasing order that differ by 2.

%C There are 12 - 2*k terms of the sequence with k digits, 1 <= k <= 6.

%F The terms can be described by the following linear equations:

%F for 1 <= n <= 9, a(n) = n;

%F for 10 <= n <= 17, a(n) = 11*(n - 9) + 9;

%F for 18 <= n <= 23, a(n) = 111*(n - 17) + 309;

%F for 24 <= n <= 27, a(n) = 1111*(n - 23) + 5309;

%F for 28 <= n <= 29, a(n) = 11111*(n - 27) + 75309.

%t Select[Range[10^5], Or[Length@ # == 1, Union@ Differences@ # == {-2}] &@ IntegerDigits@ # &] (* _Michael De Vlieger_, Aug 15 2017 *)

%K nonn,base,fini,full

%O 1,2

%A _Enrique Navarrete_, Aug 14 2017