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

Home > Numbers
2 neighbours create a square (Posted on 2021-08-19) Difficulty: 3 of 5
Concatenating two consecutive integers 183 and 184
we get a six-digit number 183184, equalling square of 428.
List similar pairs, below 500,000 (final product).

How about the same task with a pair of a consecutve numbers
in a decreasing order?
Please provide a similar list (same constraints).

No Solution Yet Submitted by Ady TZIDON    
Rating: 4.0000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
solution ++ | Comment 2 of 9 |
lim=floor(sqrt(500000));
for i=1:lim
   sq=str2num([char(string(i)) char(string(i+1))]);
   sr=round(sqrt(sq));
   if sr*sr==sq
      disp([i i+1 sr]); 
   end
end
disp(' ')
for i=1:lim
   sq=str2num([char(string(i+1)) char(string(i))]);
   sr=round(sqrt(sq));
   if sr*sr==sq
      disp([i+1 i sr]); 
   end
end

finds
              concat's
  two numbers  square 
                root
   183   184     428
   328   329     573
   528   529     727 actually 528529 exceeds the 500,000 limit
 
    82    81      91
    
Since the computer is doing the grunt work, we can extend further:    
    
    183         184         428
    328         329         573
    528         529         727
    715         716         846
   6099        6100        7810
  13224       13225       36365
  40495       40496       63636
 106755      106756      326734
 453288      453289      673267
2066115     2066116     4545454
2975208     2975209     5454547
 
     82          81          91
   8242        8241        9079
   9802        9801        9901
 538277      538276      733674
 998002      998001      999001 
  
 
Descending always seems to find fewer. 

  Posted by Charlie on 2021-08-19 10:45:11
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


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