OFFSET
0,2
COMMENTS
A permutation of the nonnegative integers.
PROG
(PARI) a(n, f=1, d=4, 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}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler and Eric Angelini, Feb 22 2018
STATUS
approved