login
Lexicographic first sequence of positive integers such that a(n) + a(n+1) has a digit 6, and no term occurs twice.
1

%I #4 Feb 23 2018 09:49:54

%S 1,5,11,15,21,25,31,29,7,9,17,19,27,33,3,13,23,37,24,2,4,12,14,22,34,

%T 26,10,6,20,16,30,32,28,8,18,38,48,58,68,78,82,44,42,54,52,64,62,74,

%U 72,84,76,40,36,50,46,60,56,70,66,80,81,35,41,45,51,55,61,65,71,75,85,77,39,47,49,57,59,67,69,87,73,43,53,63,83,79,86,90,96,100

%N Lexicographic first sequence of positive integers such that a(n) + a(n+1) has a digit 6, and no term occurs twice.

%C A permutation of the positive integers.

%o (PARI) a(n,f=1,d=6,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. A299986 (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