%I #23 Mar 05 2018 14:31:41
%S 0,2,10,11,1,19,3,9,12,8,4,16,5,7,13,14,6,15,17,25,27,35,37,45,47,55,
%T 57,63,29,23,39,33,49,43,59,53,67,54,18,24,28,34,38,44,48,64,56,26,36,
%U 46,66,58,62,20,22,30,32,40,42,50,52,60,61,21,31,41,51,69,73,79,83,89,93,99,101,71,81,91,109,92,70
%N Lexicographic first sequence of nonnegative integers such that a(n) + a(n+1) has a digit 2, and no term occurs twice.
%C A permutation of the nonnegative integers.
%o (PARI) a(n,f=1,d=2,a=0,u=[a])={for(n=1,n,f&&if(f==1,print1(a","),write(f,n-1," "a));for(k=u[1]+1,oo,setsearch(u,k)&&next;setsearch(Set(digits(a+k)),d)&&(a=k)&&break);u=setunion(u,[a]);u[2]==u[1]+1&&u=u[^1]);a}
%Y Cf. A299972 (analog with positive terms), A299957 (analog with digit 1), A299970, A299983, ..., A299988, A299969 (digit 0, 3, ..., 9).
%K nonn,base
%O 0,2
%A _M. F. Hasler_ and _Eric Angelini_, Feb 22 2018
|