OFFSET
0,3
COMMENTS
The sequence starts with a(0) = 0 and is always extended with the smallest integer not yet present that does not lead to a contradiction. The sequence is a permutation of the natural numbers.
Originally the sequence was defined starting with a(1) = 1 and using only positive integers. This leads to the same sequence restricted to positive indices, which yields a permutation of the positive integers. - M. F. Hasler, Feb 28 2018
LINKS
M. F. Hasler, Table of n, a(n) for n = 0..10000
EXAMPLE
1 + 9 = 10; 9 + 2 = 11; 2 + 8 = 10; 8 + 3 = 11; 3 + 7 = 10; 7 + 4 = 11; 4 + 6 = 10; 6 + 5 = 11; etc.
MATHEMATICA
Nest[Append[#, Block[{k = 1}, While[Nand[FreeQ[#, k], DigitCount[k + #[[-1]], 10, 1] > 0], k++]; k]] &, {1}, 98] (* Michael De Vlieger, Feb 22 2018 *)
PROG
(PARI) a(n, f=1, a=0, u=[a])={for(n=a+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)), 1)&&(a=k)&&break); u=setunion(u, [a]); u[2]==u[1]+1&&u=u[^1]); a} \\ M. F. Hasler, Feb 22 2018
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Eric Angelini, Feb 22 2018
EXTENSIONS
Extended to a(0) = 0 by M. F. Hasler, Feb 28 2018
STATUS
approved