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

 Consecutively Divisible (Posted on 2013-03-18)
PART A:

P is a positive integer such that each of sod(P-1), sod(P) and P+1 is divisible by 13. Determine the minimum value of P.

What if each of P-1, sod(P) and sod(P+1) is divisible by 13? How about each of sod(P-1), P and sod(P+1) being divisible by 13?

PART B:

What will be the respective answers to Part A, when the words "divisible by 13" are replaced with "divisible by 11"?

*** sod(x) refers to the sum of the digits in the base ten expansion of x.

 No Solution Yet Submitted by K Sengupta No Rating

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

DECLARE FUNCTION sod# (x#)
DEFDBL A-Z

'CLS
FOR n = 0 TO 13 * 99999999 STEP 13
IF sod(n + 1) MOD 13 = 0 AND sod(n + 2) MOD 13 = 0 THEN
ct1 = ct1 + 1
IF ct1 <= 5 THEN PRINT n, n + 1, n + 2, "p-1"
END IF
IF sod(n - 1) MOD 13 = 0 AND sod(n + 1) MOD 13 = 0 THEN
ct2 = ct2 + 1
IF ct2 <= 5 THEN PRINT n - 1, n, n + 1, "p"
END IF
IF sod(n - 1) MOD 13 = 0 AND sod(n - 2) MOD 13 = 0 THEN
ct3 = ct3 + 1
IF ct3 <= 5 THEN PRINT n - 2, n - 1, n, "p+1"
END IF
NEXT

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

The output was limited to 5 each of two of the varieties of solution as the "p-1" and "p+1" types were so much more common:

`                                       which one  p-1           p            p+1    was itself divisible                                        by 13                                        75998         75999         76000        p-1156999        157000        157001       p+1192998        192999        193000       p-1273999        274000        274001       p+1390999        391000        391001       p+1426998        426999        427000       p-1507999        508000        508001       p+1543998        543999        544000       p-1624999        625000        625001       p+1660998        660999        661000       p-138999999      39000000      39000001     p155999999     156000000     156000001    p156999998     156999999     157000000    p272999999     273000000     273000001    p273999998     273999999     274000000    p`

So the minimum p for A1 is 157000; for A2 is 75999; and for A3 is 39000000.

In each case, the two not themselves divisible have sod's divisible by 13.

Similarly for 11:

`                                       which one  p-1           p            p+1    was itself divisible                                        by 11`
`5599999       5600000       5600001      p+111899998      11899999      11900000     p-115499999      15500000      15500001     p+121799998      21799999      21800000     p-125399999      25400000      25400001     p+131699998      31699999      31700000     p-135299999      35300000      35300001     p+141599998      41599999      41600000     p-145199999      45200000      45200001     p+151499998      51499999      51500000     p-1`

None are found where p is divisible by 11 and the surrounding numbers' sod's divisible by 11.

So minimum p for B1 is 5600000; B2 is 11899999; and none is in sight for B3.

 Posted by Charlie on 2013-03-18 15:05:17

 Search: Search body:
Forums (0)