The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.
Please make a donation to keep the OEIS running. We are now in our 56th year. In the past year we added 10000 new sequences and reached almost 9000 citations
(which often say "discovered thanks to the OEIS").
a(0)=1. Let S = string of digits of a(0),a(1),a(2),... To get a(n+1) (n>=0), subtract next element of S from a(n) if that would give a positive number different from a(0),...,a(n), otherwise add it to a(n).