login
A289286
Starting with a(1) = 1, a(n) = smallest nonnegative integer not yet in the sequence such that the last digit of a(n-1) plus the first digit of a(n) is equal to 8. The digit 0 is not allowed.
2
1, 7, 11, 71, 72, 6, 2, 61, 73, 5, 3, 51, 74, 4, 41, 75, 31, 76, 21, 77, 12, 62, 63, 52, 64, 42, 65, 32, 66, 22, 67, 13, 53, 54, 43, 55, 33, 56, 23, 57, 14, 44, 45, 34, 46, 24, 47, 15, 35, 36, 25, 37, 16, 26, 27, 17, 18
OFFSET
1,2
COMMENTS
The number of terms of this finite sequence is the eighth central polygonal number, n = 57.
MATHEMATICA
Module[{a = {1}, k, d = 8}, TimeConstrained[Do[k = 2; While[Or[MemberQ[a, k], MemberQ[IntegerDigits@ k, 0], # != d] &[Mod[a[[n - 1]], 10] + First@ IntegerDigits@ k], k++]; AppendTo[a, k], {n, 2, 100}], 2]; a] (* Michael De Vlieger, Jul 14 2017 *)
CROSSREFS
KEYWORD
nonn,base,fini,full
AUTHOR
Enrique Navarrete, Jul 01 2017
STATUS
approved