mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2007-06-04, 17:57   #1
davar55
 
davar55's Avatar
 
May 2004
New York City

10000100000112 Posts
Default 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?
davar55 is offline   Reply With Quote
Old 2007-06-04, 18:00   #2
Wacky
 
Wacky's Avatar
 
Jun 2003
The Texas Hill Country

32·112 Posts
Default

For A=B=0, it is trivial.
Wacky is offline   Reply With Quote
Old 2007-06-04, 18:03   #3
grandpascorpion
 
grandpascorpion's Avatar
 
Jan 2005
Transdniestr

503 Posts
Default

Davar, I assume A and B have to differ. Right?

Last fiddled with by grandpascorpion on 2007-06-04 at 18:04
grandpascorpion is offline   Reply With Quote
Old 2007-06-04, 18:15   #4
davar55
 
davar55's Avatar
 
May 2004
New York City

3·1,409 Posts
Default

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
davar55 is offline   Reply With Quote
Old 2007-06-04, 19:22   #5
grandpascorpion
 
grandpascorpion's Avatar
 
Jan 2005
Transdniestr

50310 Posts
Default

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
grandpascorpion is offline   Reply With Quote
Old 2007-06-04, 20:21   #6
davar55
 
davar55's Avatar
 
May 2004
New York City

3·1,409 Posts
Default

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.
davar55 is offline   Reply With Quote
Old 2007-06-04, 20:56   #7
grandpascorpion
 
grandpascorpion's Avatar
 
Jan 2005
Transdniestr

50310 Posts
Default

Quite true
grandpascorpion is offline   Reply With Quote
Old 2007-06-04, 21:24   #8
m_f_h
 
m_f_h's Avatar
 
Feb 2007

1B016 Posts
Default 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))}
m_f_h is offline   Reply With Quote
Old 2007-06-04, 21:41   #9
m_f_h
 
m_f_h's Avatar
 
Feb 2007

24·33 Posts
Default 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
m_f_h is offline   Reply With Quote
Old 2007-06-04, 21:58   #10
davar55
 
davar55's Avatar
 
May 2004
New York City

3×1,409 Posts
Default

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
davar55 is offline   Reply With Quote
Old 2007-06-04, 22:45   #11
m_f_h
 
m_f_h's Avatar
 
Feb 2007

24×33 Posts
Default

Quote:
Originally Posted by davar55 View Post
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
m_f_h is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where can I find a Reverse and Add program? I can't find any! Stargate38 Programming 18 2015-07-10 06:08
Perfect square or not? jnml Puzzles 12 2012-04-28 21:33
red square Fusion_power Puzzles 14 2008-04-25 11:37
How often is 2^p-1 square-free Zeta-Flux Math 16 2005-12-14 06:55
Fast way to square??? maheshexp Math 2 2004-05-29 01:54

All times are UTC. The time now is 03:09.

Mon Jul 13 03:09:55 UTC 2020 up 110 days, 42 mins, 0 users, load averages: 1.55, 1.80, 1.89

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.