OFFSET
1,2
COMMENTS
In contrast to A277845, the order of the digits does not matter: for example, if a(n) = 123, the difference with the next term might be 21, 31, or 32, which is not possible in A277845 or in A277858.
This sequence differs from A277858 and A277845 from a(63) = 71 + 17 = 88 on, while A277858(63) = A277845(63) = 71 + 71 = 142. In contrast to A277858 and A277845 in which the 12 numbers {3, 5, 6, 7, 11, 12, 13, 14, 15, 33, 46, 61} do not appear, the number 46 = a(78) is in this sequence, and only the other 11 numbers are missing here.
It is easy to prove that this is not a permutation of the positive integers: for example, the number 5 cannot occur anywhere later in the sequence, since it has no possible successor (10 being already used). Relaxing the defining condition to "each digit of |a(n+1)-a(n)| is a digit of a(n)" (e.g., a step of 11 would be allowed after 123), leads to the variant A276070 which is a permutation.
PROG
(PARI) /* 'a' subsequence of 'b'?*/ ss(a, b, i=1, k=1)={while(k < #b && #b-k >= #a-i, b[k] == a[i] && (i==#a || ss(a, b, i+1, k+1)) && return(1); k++); k==#b && i==#a && b[k] == a[i]}
AA277846(n, a=1, g=1)={u=[]; for(n=2, n, g&&print1(a", "); u=setunion(u, [a]); d=vecsort(digits(a)); for(k=u[1]+1, 2*a, (!setsearch(u, k) && ss(vecsort(digits(abs(a-k))), d))||next; p==a && u=setminus(u, [b]); p=a; a=k; next(2)); g&&print1("-- no: delete "a", go back to "); b=a; a=p); a} \\ This implementation of backtracking is actually not required.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Nov 05 2016
STATUS
approved