All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Seven come eleven (Posted on 2010-12-11)
A positive integer N fulfills the following demands:.
N is a 7 digit number.
N's digits can be arranged as seven distinct members of an arithmetic progression(either ascending or descending) .

N is a multiple of 11.

How many positive integers like N exist?
Evaluate the lowest and the highest N.
BONUS : How about 8 digits? Nine? All ten?
Rem: It is D4 for fully explained and errorless P&P result,might be significantly lower for software solution.

Comments: ( Back to comment list | You must be logged in to post comments.)
 for 10 digits | Comment 2 of 12 |

DEFDBL A-Z

DECLARE SUB permute (a\$)
CLS
a\$ = "0123456789": h\$ = a\$
DO
IF LEFT\$(a\$, 1) > "0" THEN
v = VAL(a\$)
vm = v - 11 * INT(v / 11)
IF vm = 0 THEN ct = ct + 1
END IF
permute a\$
LOOP UNTIL a\$ = h\$
PRINT ct

finds

285120

 Posted by Charlie on 2010-12-11 15:28:45

 Search: Search body:
Forums (0)