%I #17 Jun 10 2016 00:21:00
%S 1,10,11,12,21,23,13,32,20,22,24,31,34,14,43,25,35,30,33,36,41,45,15,
%T 54,26,42,46,37,47,40,44,48,51,56,16,65,27,53,52,57,38,58,49,59,50,55,
%U 61,67,17,76,28,64,62,68,39,63,69,60,66,71,78,18,87,29,75,72,79,70,77,81,89,19,98,80,88,91,100
%N a(1)=1; a(n+1) is the smallest number, not already used, containing two digits whose difference is the smallest digit of a(n).
%H Hans Havermann, <a href="/A235828/b235828.txt">Table of n, a(n) for n = 1..1000</a>
%H Eric Angelini, <a href="http://www.cetteadressecomportecinquantesignes.com/SmallestMakesDiff.htm">Smallest digit makes the difference</a>
%H E. Angelini, <a href="/A235828/a235828.pdf">Smallest digit makes the difference</a> [Cached copy, with permission]
%e a(2) = 10 because it is the smallest number containing two digits whose difference is 1.
%e a(3) = 11 because it is the smallest number containing two digits whose difference is 0.
%t A = {1}; Do[d = Min@IntegerDigits@Last@A; k = 10; While[MemberQ[A, k] || ! MemberQ[ Abs[ Subtract @@@ Subsets[IntegerDigits@k, {2}]], d], k++]; AppendTo[A, k], {99}]; A (* _Giovanni Resta_, Jan 16 2014 *)
%K nonn,base
%O 1,2
%A _Eric Angelini_, Jan 16 2014
|