 All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars  perplexus dot info  Forty- niners (Posted on 2011-02-01) Find a pair of two consecutive integers, such that the s.o.d. of each of them is a multiple of 49. i.e. SOD(N)=K*49 & SOD(N+1)=L*49: (K,L integers)

Rem1: S.o.d. of a number is the sum of said number's digits.
Rem2: Only the smallest values requested. Comments: ( Back to comment list | You must be logged in to post comments.) Late solution agreeing with Justin Comment 6 of 6 | At first a dashed off some code to try a brute force solution, but while the program was running forever, I elected to actually think about it instead.

The smallest number with sod=49 is 499999 but then then n+1 has sod of 5.
If n ends with anything other than 9, then sod(n+1) = sod(n) + 1, so our number must end in 9.

If n ends with a string of k 9's then sod(n+1) - sod(n) = 8 + (k-1)*9
The smallest k such that sod(8 + (k-1)*9) is 0 is for k = 11.
So, for example, n equal to a 1 followed by 11 9's has an sod = 100, in which case n+1 would be a 2 followed by 11 zeros so sod = 2, a difference of 98 which is a multiple of 49.

So our number must end in a string of 11 9's, (sod = 99) but it's overall sod must be 147, a multiple of 49.
So our number's "prefix" must have an sod of 48.  The smallest such number would be 399999, except the prefix cannot end in 9 or this would make a longer string of 9's at the end.  So the smallest prefix with sod 48 and ending in a non-9 is 499998.

49,999,899,999,999,999  sod = 147
49,999,900,000,000,000  sod = 49
 Posted by Larry on 2020-07-20 11:05:28 Please log in:

 Search: Search body:
Forums (0)