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

Home > Numbers
Center Six Digits (Posted on 2023-07-15) Difficulty: 3 of 5
A 6-digit positive integer N is squared to form a 12-digit number. The center six digits of N^2 constitute N. Determine all possible values of N.

(If 'abcdef' was the 6-digit number, then the 12-digit number would look like 'uvwabcdefxyz'.)

Will there be any further solution(s) if N contained a leading zero?

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 my program | Comment 2 of 3 |
for n=1:999999
  nstr=char(string(n));
  nsq=char(string(n^2));
  if length(nstr)==6 && length(nsq)==12
    if isequal(nsq(4:9),nstr)
      fprintf('%s %s\n',nstr,nsq)
    end
  else
    nstr=sprintf('%06s',nstr);
    nsq=sprintf('%012s',nsq);
    if isequal(nsq(4:9),nstr)
      fprintf('                      %s %s\n',nstr,nsq)
    end
  end
end

finds there is one example with leading zeros and four examples with no leading zeros:

>> center6digits
                      001000 000001000000
376000 141376000000
495475 245495475625
625000 390625000000
971582 943971582724 

  Posted by Charlie on 2023-07-15 10:33:28
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