mersenneforum.org Find a Square
 Register FAQ Search Today's Posts Mark Forums Read

 2007-06-04, 17:57 #1 davar55     May 2004 New York City 5·7·112 Posts Find a Square Find a positive integral square whose (decimal) digit representation ends in the pattern ABABABABAB. Is it possible to have a square end in a longer repeated pattern?
 2007-06-04, 18:00 #2 Wacky     Jun 2003 The Texas Hill Country 32·112 Posts For A=B=0, it is trivial.
 2007-06-04, 18:03 #3 grandpascorpion     Jan 2005 Transdniestr 503 Posts Davar, I assume A and B have to differ. Right? Last fiddled with by grandpascorpion on 2007-06-04 at 18:04
 2007-06-04, 18:15 #4 davar55     May 2004 New York City 5×7×112 Posts Yes, the number must end in ABABABABAB with A and B distinct. There is more than one solution, so perhaps find the smallest. Last fiddled with by davar55 on 2007-06-04 at 18:17
 2007-06-04, 19:22 #5 grandpascorpion     Jan 2005 Transdniestr 503 Posts Found with the help of Excel, probably not the smallest. My solution is around 4.4 billion and change 4491146011^2 = 20170392492121212121 Yeah, there's an infinite number of solutions. a*10^10 + (any solution under 10^10) where a is an integer >= 1 will give you a different solution. Last fiddled with by grandpascorpion on 2007-06-04 at 19:33
 2007-06-04, 20:21 #6 davar55     May 2004 New York City 5·7·112 Posts Perfectly good solution, though not the smallest. And yes there are an infinite number of solutions. Another that you didn't mention is four times yours (double the square root) since that square ends in 8484848484.
 2007-06-04, 20:56 #7 grandpascorpion     Jan 2005 Transdniestr 503 Posts Quite true
 2007-06-04, 21:24 #8 m_f_h     Feb 2007 43210 Posts smallest 162459327 found in 9 min by PARI script (KISS principle, could be improved in roughly as many ways as there are characters in...) {zz=10^8;for(x=2*10^6,10^10,if((tt=divrem(x^2%zz,10000))[1]!=tt[2],next); if(!tt|(tt=divrem(tt[1],100))[1]!=tt[2],next); print([x,tt[2]=x^2%10^10]);if(tt[1]==tt[2]\zz,break))}
 2007-06-04, 21:41 #9 m_f_h     Feb 2007 24×33 Posts Theorem If x^2 = x^2\10^4 (mod 10^4) and x^2 = x^2\100 (mod 100), then x^2 = 0,64,21,84,69,29 or 61 mod 100. (where \ means truncated integer division) The proof of this theorem exists, even if I don't know it since I don't look for it... (and anyway, one cannot write into the margins of this forum...) Last fiddled with by m_f_h on 2007-06-04 at 21:44
 2007-06-04, 21:58 #10 davar55     May 2004 New York City 5·7·112 Posts Yes I think that's the smallest! My source gave 508853989[sup]2[/sup] = 258932382121212121 which is larger! Since your solution 162459327[sup]2[/sup] = 26,393,032,929,292,929 ends in 2929292929, we now have solutions that end in ABABABABAB with AB = 21, 29, and 84. According to my source, there are two more possible ending values of AB besides 00. (You listed three: 61,64,69.) Can you find solutions for these values too? (I don't have their smallest solutions at hand.) Last fiddled with by davar55 on 2007-06-04 at 22:09 Reason: fix spoilers
2007-06-04, 22:45   #11
m_f_h

Feb 2007

6608 Posts

Quote:
 Originally Posted by davar55 Can you find solutions for these values too? (I don't have their smallest solutions at hand.)
Everybody can, it's sufficient to paste my pari script into gp and change the starting value to (least solution)+1

PS:
1/ hey guys, I have 2 or 3 other things (less funny but more required) to do...
2/ note my Thm speaks about mod 10^8 not mod 10^10 but adding the same thing with a sufficiently large multiple of 100...001 should do the job, no ?
3/ you should optimize my script, maybe by using Mod(,10^10) and adding 2n+1 to go to the next square, instead of doing x^2%10^8 each time.
(check if it's really faster, I had some counter-intuitive surprises regarding similar pbs...)
I don't have time for more than this quick hack, today :-( !
(besides the fact that my box has 2 mprimes running and a dozen of other active windows with a dozen of tabs in each, including gmail with its CPU intensive scripts...

Last fiddled with by m_f_h on 2007-06-04 at 22:57

 Similar Threads Thread Thread Starter Forum Replies Last Post Stargate38 Programming 18 2015-07-10 06:08 jnml Puzzles 12 2012-04-28 21:33 Fusion_power Puzzles 14 2008-04-25 11:37 Zeta-Flux Math 16 2005-12-14 06:55 maheshexp Math 2 2004-05-29 01:54

All times are UTC. The time now is 01:52.

Wed Aug 4 01:52:48 UTC 2021 up 11 days, 20:21, 0 users, load averages: 2.93, 2.90, 3.04