OFFSET
1,2
COMMENTS
This sequence is a permutation of the positive integers, in contrast to the variant A277858, which was the inspiration for this sequence but which is defined using the much stronger constraint "|a(n+1)-a(n)| is a substring of a(n)".
PROG
(PARI) u=[a=1]; for(n=1, 99, print1(a", "); u=setunion(u, [a]); while(#u>2&&u[2]==u[1]+1, u=u[^1]); d=Set(digits(a)); for(k=u[1]+1, 9e9, !setsearch(u, k)&&!#setminus(Set(digits(abs(a-k))), d) &&(a=k)&&break))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Nov 04 2016
STATUS
approved