[seqfan] Re: Counting problem

Max Alekseyev maxale at gmail.com
Wed Jun 17 06:08:53 CEST 2009


n Tue, Jun 16, 2009 at 11:22 PM, David Wilson<davidwwilson at comcast.net> wrote:

> How many n-digit numbers with all odd digits are divisible by 5^n?

There is exactly one such number for every n. The sequence of such
n-digit numbers is:

5, 75, 375, 9375, 59375, 359375, 3359375, 93359375, 193359375,
3193359375, 73193359375, ...

The elements of this sequence satisfy the recurrence:

a(n) = d(n)*10^(n-1) + a(n-1)

where d(n), the leading digit of a(n), is one of the odd digits 1, 3,
5, 7, or 9 (forming the complete set of residues modulo 5) and is
uniquely defined by the congruence:

d(n) == (- a(n-1) / 10^(n-1))  (mod 5).

The sequence of leading digits d(n) is:

5, 7, 3, 9, 5, 3, 3, 9, 1, 3, 7, 7, 3, 7, 7, 5, 1, 5, 7, 9, 3, 7, 3,
3, 9, 9, 9, 5, 3, 7, 1, 7, 9, 5, 7, 9, ...

Regards,
Max




More information about the SeqFan mailing list