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

 Feisty Fifty-six (Posted on 2013-10-04)
Determine the minimum value of a positive integer N such that:
N ends with 56, and:
N is divisible by 56 and:
The sum of the digits of N is equal to 56.

Extra Challenge: Solving this puzzle without a computer program.

 No Solution Yet Submitted by K Sengupta No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution | Comment 2 of 5 |

The lowest 40 such numbers:

29899856
39979856
48799856
48988856
49996856
56989856
57997856
58879856
59698856
59799656
59887856
59988656
65998856
67699856
67888856
67989656
68896856
68959856
68997656
69589856
69778856
69879656
69967856
73999856
75889856
76897856
76998656
77779856
77968856
78598856
78699656
78787856
78888656
78976856
78989456
79669856
79795856
79858856
79896656
79959656

DECLARE FUNCTION sod# (n#)
DEFDBL A-Z
DIM SHARED ct
CLS
FOR n = 560000 TO 999999999 STEP 56
IF n MOD 100 = 56 THEN
IF sod(n) = 56 THEN
PRINT n
ct = ct + 1
END IF
END IF
IF ct > 39 THEN END
NEXT

FUNCTION sod (n)
sum = 0
s\$ = LTRIM\$(STR\$(n))
FOR i = 1 TO LEN(s\$)
sum = sum + VAL(MID\$(s\$, i, 1))
NEXT
sod = sum
END FUNCTION

 Posted by Charlie on 2013-10-04 11:44:12

 Search: Search body:
Forums (0)