# [seqfan] Re: Starting and Ending Digits

Richard Mathar mathar at strw.leidenuniv.nl
Fri Jan 30 22:17:45 CET 2009

```ftaw> From seqfan-bounces at list.seqfan.eu Thu Jan 29 00:54:08 2009
ftaw> To: seqfan at seqfan.eu, zakseidov at gmail.com
ftaw> Date: Wed, 28 Jan 2009 18:35:54 -0500
ftaw> From: franktaw at netscape.net
ftaw> Cc: njas at research.att.com
ftaw> Subject: [seqfan]  Starting and Ending Digits
ftaw> ...
ftaw> I'm considering submitting (done by hand, so there may be errors):
ftaw>
ftaw> a(n+1) is the smallest number not yet in the sequence which contains
ftaw> the last digit of a(n):
ftaw>
ftaw> 1,10,20,30,40,50,60,70,80,90,100,101,11,12,2,
ftaw> 21,13,3,31,14,4,41,15,5,51,16,6,61,17,7,71,18,
ftaw> ...

I get 23, 24, 25 etc at earlier positions:

[1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 101, 11, 12, 2, 21, 13, 3, 23, 31,

14, 4, 24, 34, 41, 15, 5, 25, 35, 45, 51, 16, 6, 26, 36, 46, 56, 61, 17, 7,

27, 37, 47, 57, 67, 71, 18, 8, 28, 38, 48, 58, 68, 78, 81, 19, 9, 29, 39,

49, 59, 69, 79, 89, 91, 102, 22, 32, 42, 52, 62, 72, 82, 92, 112, 120, 103,

33, 43, 53, 63, 73, 83, 93, 113, 123, 130, 104, 44, 54, 64, 74, 84, 94,

114, 124, 134, 140, 105, 55]

from the Maple program

a := [1] ;
for n from 2 to 100 do
ldig := op(-1,a) mod 10 ;
for c from 1 do
if c in a then
;
else
dgs := convert(c,base,10) ;
if ldig in dgs then
a := [op(a),c] ;
break;
fi;
fi;
od:
od:
print(a) ;

Richard J. Mathar

```