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

Home > Numbers
The magic Number (Posted on 2004-03-17) Difficulty: 1 of 5
Whats the smallest number ("the magic number") that can satisfy these conditions?

- its positive

- it is not divisible by any number below 20 (excluding 1)

- the average of the digits is an even number between 3 and 9

See The Solution Submitted by Victor Zapana    
Rating: 3.3333 (9 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution solution | Comment 7 of 35 |

53 is found by:

DATA 2,3,5,7,11,13,17,19
DIM pr(8)
FOR i = 1 TO 8
  READ pr(i)
NEXT
i = 20
DO
 i = i + 1
 good = 1
 FOR j = 1 TO 8
  q = i \ pr(j)
  IF q * pr(j) = i THEN good = 0: EXIT FOR
 NEXT
 IF good THEN
   n$ = LTRIM$(STR$(i))
   l = LEN(n$)
   s = 0
   FOR j = 1 TO l
     s = s + VAL(MID$(n$, j, 1))
   NEXT
   avg = s / l
   IF avg = INT(avg) THEN
    IF avg MOD 2 = 0 AND avg > 2 AND avg < 9 THEN
      PRINT i
      ct = ct + 1
      IF ct = 40 THEN END
    END IF
   END IF
 END IF
LOOP

which also finds larger numbers:

53
71
79
97
1069
1087
1249
1357
1429
1447
1483
1537
1591
1609
1627
1663
1681
1753
1861
1933
1951
2059
2077
2239
2257
2293
2347
2383
2419
2437
2473
2491
2581
2617
2671
2707
2833
2851
2923
3049

 


  Posted by Charlie on 2004-03-17 08:47:37
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 (17)
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