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

Home > Numbers > Sequences
Consecutive (Posted on 2023-12-25) Difficulty: 3 of 5
Find a sequence of consecutive integers, a, a+1, a+2, ..., b such that b is a square and that:
[a+(a+1)+(a+2)+...+(b-1)]b and [(a-1)+a+(a+1)+(a+2)+...+(b-1)]b are both 10-digit numbers containing all of the digits 0 to 9.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 1 of 2
clc
for sr=10:450
  b=sr^2;
  for a=1:b-2
    v1=(b-a)*(a+b-1)/2 * b;
    if v1>=1023456789 && v1<=9876543210
      vs=char(string(v1));
      if length(unique(vs))==10
        v2=(b-a+1)*(a+b-2)/2 * b;
        if v2>=1023456789 && v2<=9876543210
          vs=char(string(v2));
          if length(unique(vs))==10
            fprintf('%d ',a, b, sr, v1, v2)
            fprintf('\n')
          end
        end
      end
    end
  end
end

finds

a=78 
b=1296 which is 36^2
The two 10-digit numbers are 1083659472 and 1083759264.

Verification using direct summation rather than summation formula:

>> sum(78:1296-1)
ans =
      836157
>> ans*1296
ans =
                1083659472
                
>> sum(78-1:1296-1)
ans =
      836234
>> ans*1296
ans =
                1083759264                

  Posted by Charlie on 2023-12-25 09:00:01
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 (9)
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