Hi, all:

("Di-vi-si-bi-li-ty" ... far too many 'i's for just one single word, reminds me of the infamous song *"Miss Lilly Higgins sings shimmy in Mississippi's spring"* ...

Here's the brand new **S&SMC#9** I've just concocted for your HP-programming pleasure, let's hope it gathers

as much interest among forum contributors as the previous one did (still getting answers long after it was

duly archived). Just like it, this one can also be addressed using just about any HP calculator, combined

with a generous helping of ingenuity on the part of the user. Enough intro, let's go right to the

## Challenge:

**(1)**. Find a 10-digit integer number which consists of the digits 0-9 *without repetition* such that taking

its L (from 1 to 10) leftmost digits the resulting number is*exactly divisible*by L. For instance,

the number 32165 would be a solution, as it has no repeating digits and

3 is exactly divisible by 1 => 3/1 = 3

except for the unfortunate fact that it's got only 5 digits while we're after a 10-digit number.

32 is exactly divisible by 2 => 32/2 = 16

321 is exactly divisible by 3 => 321/3 = 107

3216 is exactly divisible by 4 => 3216/4 = 804

32165 is exactly divisible by 5 => 32165/5 = 6433

**The solution**. As usual, you're expected to produce a program for your chosen calculator(s) that upon running

is unique

will find the only solution*and*make sure there are no others.If you succeed, you may want to extend your quest to also:

**(2)**. Find out just*how many*solutions there are for N-digit numbers, with N ranging from 1 to 10: for N=10 there's just one

solution, but what about N=4 or N=9 ? Numbers beginning with a 0 are to be disregarded,*including "0" itself*

(i.e.: "0" is *not* to be considered a valid solution for the case N=1). Your program must output just the number of solutions

for each N, displaying the solutions themselves is not required.**(3)**. Same as**(2)**above, but*repeated*digits*are*allowed, the divisibility condition and not beginning with '0' being the only requirements.

As stated, you must produce one or several programs for your HP calculator(s) that will compute what's required,

the shorter and faster the better. Giving *just* the solutions (but no program) or providing programs for machines other than

(preferably HP) __*calculators*__ is to be considered as blatant disrespect to the stated rules and/or a clear statement of utter inability to comply within these terms.

Two or three days from now I'll post my solution (plus comments), which is essentially a rather simple, unoptimized 4-line program (plus variations) for a bare-bones HP-71B that takes less

than 2 minutes to find the only solution to **(1)**, less than half an hour to count all __706 solutions__ to **(2)**, and less than 4 hours to count all __11,453 solutions__ to **(3)** (in a physical HP-71B, that is; emulated times for Emu71 @ 2.4 Ghz are 1 second, 8 seconds, and 10 minutes, respectively). These are not the best times possible in a 71B, of course. In order for you to test your programs, results for **(2)** and **(3)** when N=4 are 168 and 375 solutions, respectively.

Let's see your efforts. If you can't solve this challenge for N up to 10, by all means do try with a lower limit for N, say 5, but do try all the same. Good luck and happy programming, and above all, enjoy !

Best regards from V.