login
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

%I #9 Jul 24 2017 12:54:07

%S 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,

%T 42,65,32,66,22,67,13,53,54,43,55,33,56,23,57,14,44,45,34,46,24,47,15,

%U 35,36,25,37,16,26,27,17,18

%N 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.

%C The number of terms of this finite sequence is the eighth central polygonal number, n = 57.

%t 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 *)

%Y Cf. A002061, A289283, A289284, A289285.

%K nonn,base,fini,full

%O 1,2

%A _Enrique Navarrete_, Jul 01 2017