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

Home > Numbers
Seven come eleven (Posted on 2010-12-11) Difficulty: 4 of 5
  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.    

See The Solution Submitted by Ady TZIDON    
Rating: 4.0000 (3 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
7 thru 9 again | Comment 9 of 13 |

1042536
 7             1728
9857463


10234576
 8             13248
98764523


102347586
 9             61632
987652413

DEFDBL A-Z
PRINT : PRINT
FOR sz = 7 TO 9
  ct = 0
  n = INT(10 ^ (sz - 1))
  n = n + 11 - (n MOD 11)
  DO
     ns$ = LTRIM$(STR$(n))
     c$ = ns$
     REDIM used(9)
     low = 99: high = -1
     good = 1
     FOR i = 1 TO LEN(c$)
       d = VAL(MID$(c$, i, 1))
       IF used(d) THEN good = 0: EXIT FOR
       used(d) = 1
       IF d < low THEN low = d
       IF d > high THEN high = d
     NEXT
     IF good THEN
       IF high - low = sz - 1 THEN
        ct = ct + 1
        IF did(sz) = 0 THEN PRINT prev$: PRINT ns$: did(sz) = 1
        prev$ = ns$
       END IF
     END IF
   n = n + 11
  LOOP UNTIL n > 10 ^ sz
  PRINT sz, ct
NEXT sz
PRINT prev$


  Posted by Charlie on 2010-12-11 17:06:09
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information