[R] expand.grid game

baptiste auguie baptiste.auguie at googlemail.com
Sat Dec 19 19:36:44 CET 2009


2009/12/19 David Winsemius <dwinsemius at comcast.net>:
>
> On Dec 19, 2009, at 9:06 AM, baptiste auguie wrote:
>
>> Dear list,
>>
>> In a little numbers game, I've hit a performance snag and I'm not sure
>> how to code this in C.
>>
>> The game is the following: how many 8-digit numbers have the sum of
>> their digits equal to 17?
> And are you considering the number "00000089" to be in the acceptable set?
> Or is the range of possible numbers in 10000079:98000000 ?
>

The latter, the first digit should not be 0. But if you have an
interesting solution for the other case, let me know anyway.

I should also stress that this is only for entertainment and curiosity's sake.

baptiste




More information about the R-help mailing list