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

Home > Numbers
Concatenation sum (Posted on 2019-05-15) Difficulty: 3 of 5
The number 123456789 is concatenated 1729 times to form a number A

Similarly, the number 987654321 is concatenated 1729 times to form another number B

If A+B=C, find the sum of digits of C

No Solution Yet Submitted by Danish Ahmed Khan    
Rating: 2.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer-aided solution | Comment 1 of 4
    5   open "conctsum.txt" for output as #2
   10   N1=123456789
   20   N2=987654321
   30   for I=1 to 6
   40     N1=N1*1000000000+123456789
   50     N2=N2*1000000000+987654321
   55   next
   60   N3=N1+N2
   70   print N1:print N2:print N3
   80   print #2,N1:print #2,N2:print #2,N3
   90   close #2

produces only 7 concatenations (actually 6 concatenations but producing 7 occurrences of the respective 9-digit sequences) rather than the 1729 asked for. But the result should be expandable reliably.

The 7*9=63 digit length of each summand produces a 64-digit sum, with 63 of those digits being a 1 and one being a zero.

In fact, spelled out, it's easy to see why:

  123456789123456789123456789123456789123456789123456789123456789 
  987654321987654321987654321987654321987654321987654321987654321 
 1111111111111111111111111111111111111111111111111111111111111110 

The sum of digits of this sum is just the length of each addend. In the case of what's mentioned, or presumably meant, is 9 * 1729 = 15,561.


  Posted by Charlie on 2019-05-15 11:23:30
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (0)
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