login
A299984
Lexicographic first sequence of nonnegative integers such that a(n) + a(n+1) has a digit 4, and no term occurs twice.
1
0, 4, 10, 14, 20, 21, 3, 1, 13, 11, 23, 17, 7, 27, 15, 9, 5, 19, 22, 2, 12, 28, 6, 8, 16, 18, 24, 25, 29, 35, 39, 45, 49, 55, 59, 65, 69, 71, 33, 31, 43, 41, 53, 51, 63, 61, 73, 67, 37, 47, 57, 77, 64, 30, 34, 40, 44, 50, 54, 60, 74, 66, 38, 26, 48, 36, 58, 46, 68, 56, 78, 62, 32, 42, 52, 72, 70, 75, 79, 85, 89, 95, 99, 105, 109, 115, 119, 121, 83
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
Cf. A299974 (analog with positive terms), A299957 (analog with digit 1), A299970, A299982, ..., A299988, A299969 (digit 0, 2, ..., 8, 9).
Sequence in context: A310404 A310405 A310406 * A310407 A310408 A310409
KEYWORD
nonn,base
AUTHOR
M. F. Hasler and Eric Angelini, Feb 22 2018
STATUS
approved