# [Medium] Find 9 with a twist

Using the set of digits 1-9 and input of the number of digits (always starting with 1 and going in sequence) and the grouping of digits, create a method that will return a count of all the permuations such that each sequetial group meets the rule stated above. For example:

637284591 (group by 3)

637/7 has no remainder.

372/2 has no remainder.

728/8 has no remainder.

284/8 has no remainder.

845/5 has no remainder.

459/9 has no remainder.

591/1 has no remainder.

The correct count if digits were 3 and group were 2 would be 2 as follows:

123 false;

132 false;

312 true; (31/1 and 12/2)

321 true; (32/2 and 21/1)

231 false;

213 false;

As a test (and I'm not 100% sure about this ) for 6 digits grouped by 3 I got 136 permutations that met the criteria.

This one is worth a box of Peanut Butter cookies Eric. You'll have to use a form for this one.

[ June 01, 2003: Message edited by: Michael Morris ]

*Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction.* - Ernst F. Schumacher

Rancher

Rancher

http://www10.brinkster.com/a1ien51/JavaRanch/FindNums3.htm

Eric

[get rid of the mistake]

[ June 03, 2003: Message edited by: Eric Pascarello ]

*Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction.* - Ernst F. Schumacher

*Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction.* - Ernst F. Schumacher

Sheriff

**Homemade sounds good to me.**

A man with true taste!

Looking at your table, there seems to be a pattern there but I can't quite put my finger on it. Did you notice anything? Of course the 1 grouping always yields the factoral value. Maybe I'm just seeing things again.

Sheriff

Just for the heck of it, I tried running the program past 9 digits. It's rougly akin to using hexadecimal digits, but decimal rules of position. E.g. 3B = 3 * 10 + 11 = 41. Weird way to overload decimal. I include some of these results below - they're just an extension of the previous result table. But things bog down quite a bit as we go; I'd like to make a complete table for 16 hexadecimal digits, but need to refactor for speed first. Anyway, in case you can spot any futher patterns:

[ June 02, 2003: Message edited by: Jim Yingst ]

"I'm not back." - Bill Harding, *Twister*

Rancher

Rancher

Eric

[edit]

I could not sleep. so i fixed it

Got 686 which I see matches.

[/edit]

[ June 03, 2003: Message edited by: Eric Pascarello ]