%I #4 Feb 23 2018 09:47:56
%S 1,6,11,16,21,26,31,36,34,3,4,13,14,23,24,33,37,10,7,20,17,30,27,40,
%T 32,5,2,15,12,25,22,35,38,9,8,19,18,29,28,39,48,49,58,59,68,69,78,79,
%U 88,82,45,42,55,52,65,62,75,72,85,86,41,46,51,56,61,66,71,76,81,89,83,44,43,54,53,64,63,74,73,84,87,50,47,60,57,70,67,80,77,90,97
%N Lexicographic first sequence of positive integers such that a(n) + a(n+1) has a digit 7, and no term occurs twice.
%C A permutation of the positive integers.
%o (PARI) a(n,f=1,d=7,a=1,u=[a])={for(n=2,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. A299987 (analog with nonnegative terms), A299957 (analog with digit 1), A299971, A299972, ..., A299979 (digit 0, 2, ..., 9).
%K nonn,base
%O 1,2
%A _M. F. Hasler_ and _Eric Angelini_, Feb 22 2018
|