[seqfan] Re: Divided by first digit, have last digit as remainder

Harvey P. Dale hpd1 at nyu.edu
Wed Mar 21 16:16:50 CET 2012


	This Mma program will select the terms of the sequence up to 10000.  On my computer, it takes less than 0.2 seconds to do so.

	ldrQ[n_]:=Module[{idn=IntegerDigits[n],f,l},f=First[idn];l=Last[idn];Mod[n,f]==l]; Select[Range[10000],ldrQ]
	
	Best,

	Harvey

-----Original Message-----
From: seqfan-bounces at list.seqfan.eu [mailto:seqfan-bounces at list.seqfan.eu] On Behalf Of Charles Greathouse
Sent: Wednesday, March 21, 2012 10:27 AM
To: Sequence Fanatics Discussion list
Subject: [seqfan] Re: Divided by first digit, have last digit as remainder

This is an automatic sequence in the terminology of Allouche &
Shallit: it can be recognized by a regular expression (or finite-state
machine) working on the decimal expansion of the number.

The easy parts:
1.*0
2.*[01]
4.*[02468][0123]
4[0123]
5.*[01234]

8 is routine but somewhat long.

3, 6, and 9 are longer than 8 but not too hard; here's 3:
3([0369]|[147][0369]*[258]|[147][0369]*[147][0369]*[147]|[258][0369]*[147])*[012]

7 is hard.  The length of the entire regular expression will be essentially the same as the length of this part, which will be several thousand characters.

Charles Greathouse
Analyst/Programmer
Case Western Reserve University

On Wed, Mar 21, 2012 at 9:00 AM, Eric Angelini <Eric.Angelini at kntv.be> wrote:
>
> Hello SeqFans,
> Numbers which, when divided by their first digit, have their last 
> digit as remainder:
>
> 10, 20, 21, 30, 31, 32, 40, 41, 42, 43, 50, 51, 52, 53, 54, 60, 61, 
> 62, 63, 64, 65, 70, 71, 72, 73, 74, 75, 76, 80, 81, 82, 83, 84, 85, 
> 86, 87, 90, 91, 92, 93, 94, 95, 96, 97, 98, 100, ...
>
> This is not a subsequence of https://oeis.org/A009995 ("Numbers with 
> digits in strictly decreasing order").
>
> Best,
> É.

_______________________________________________

Seqfan Mailing list - http://list.seqfan.eu/



More information about the SeqFan mailing list