mersenneforum.org Help with series convergence in Fermat method of factoring
 Register FAQ Search Today's Posts Mark Forums Read

 2017-03-01, 19:20 #2 mahbel   "mahfoud belhadj" Feb 2017 Kitchener, Ontario 6010 Posts I don't know how helpful the following is but your number N=152851016917 is a (6k+1) type of number. So the squares in N + n^2 = m^2 must be of the following form: n=3k and m=10+3j. Then your number becomes N + 9k^2 = (10+3j)^2. You obviously don't need to start with m=10. You get the starting point from the sqrt(N). That is if your number is 217=7*31, your starting point is m=10+3=13 because 13^2 is the first square of the correct from below 217. This will allow you to discard a lot of squares that do not have the right form. The other simple trick is the fact that N and m^2 must have have the same sum of digits. In the case of N=217, you can jump straight to m^2=19^2 since 13^2 and 16^2 do not have the same sum of digits. Good luck to you.
 2017-03-01, 23:09 #3 EdH     "Ed Hall" Dec 2009 Adirondack Mtns 25·3·47 Posts Thanks for the reply. I'm more interested in the general concept than specific forms of composites right now. The number chosen was simply a composite that only had two primes and was handy. But, thank you for the effort in responding.
2017-03-02, 18:05   #4
fivemack
(loop (#_fork))

Feb 2006
Cambridge, England

645310 Posts

Quote:
 Originally Posted by EdH In my do-while loop, I'm simply advancing the lower series by square differences and once the value has surpassed the high square, I advance the high square to the next square. The difference swings above and below 0, until at some point it equals 0
You don't need the lower series - you just need to advance the high series until the difference is _some_ square, and checking whether a number is a square isn't too difficult. If a number is a possible-square-mod-p for lots of p, it's pretty likely to be square, and each p rules out about half the numbers ... you can keep track of the values of the high series modulo lots of p quite efficiently since you're only doing addition.

2017-03-02, 23:58   #5
EdH

"Ed Hall"
Dec 2009

25·3·47 Posts

Quote:
 Originally Posted by fivemack You don't need the lower series - you just need to advance the high series until the difference is _some_ square, and checking whether a number is a square isn't too difficult. If a number is a possible-square-mod-p for lots of p, it's pretty likely to be square, and each p rules out about half the numbers ... you can keep track of the values of the high series modulo lots of p quite efficiently since you're only doing addition.
Thanks fivemack, but I realize that I can do addition/testing for a long time to find the right lower square. I'm looking for a way to calculate the coincidence rather than stepping to it, which would take a thousand years for some of the larger composites. I've been trying to see if I can find a way via modular means, but I'm too darn rusty with any background in math I may have had long ago. Maybe there isn't a way to do what I'm looking for and that's why I can't find it.

In a way, I'm picturing two graphs converging to the crossover, but the two series are really just two sections of the same graph, without the composite offset. If I can "visualize" a way to work this, maybe a function can be derived. I suspect, that function already is known by everyone, but I don't know enough to describe it properly or recognize it, yet.

Thank you very much for all your help.

2017-03-03, 07:58   #6
fivemack
(loop (#_fork))

Feb 2006
Cambridge, England

193516 Posts

Quote:
 Originally Posted by EdH Thanks fivemack, but I realize that I can do addition/testing for a long time to find the right lower square. I'm looking for a way to calculate the coincidence rather than stepping to it, which would take a thousand years for some of the larger composites.
If you were stepping along the two sequences in perfect sequence, it's just a problem in quadratic equations; but the variable stepping rates make it much more difficult.

You're looking for a point on the conic Y^2-N=X^2, and there are good ways to do this iff you know the factorisation of N :)

2017-03-03, 14:32   #7
EdH

"Ed Hall"
Dec 2009

25·3·47 Posts

Quote:
 Originally Posted by fivemack If you were stepping along the two sequences in perfect sequence, it's just a problem in quadratic equations; but the variable stepping rates make it much more difficult. You're looking for a point on the conic Y^2-N=X^2, and there are good ways to do this iff you know the factorisation of N :)
Thanks fivemack! This gives me an area for my next study...

 2017-03-05, 16:31 #8 a1call     "Rashid Naimi" Oct 2015 Remote to Here/There 2,243 Posts Perhaps you shouldn't dismiss mahbel's remarks so quickly. I can't quite follow what he is stating but he is telling you that rather than blindly searching for squares, you can narrow your search to relevant forms. It also helps to analyze routines with small numeric examples instead of astronomically large ones. Suppose you want to factor 21, 5-2 | 21=5^2-2^2 You could build some intelligence into your search by knowing effective ranges and rules. You could also extend your search to powers other than 2. For example: n^5-m^3 | n^(5j)-m(3j) 3 and 5 are arbitrary and can be replaced by any integers (or primes if you prefer). But generally there is a commonality to the form of the composite candidate and it's sub-power factors that can be built as intelligence into the search. The Mersenne numbers are a subset of this rule of the form: 2^n-1^m | 2^(nj)-1^(mj) Last fiddled with by a1call on 2017-03-05 at 16:37
2017-03-05, 16:46   #9
EdH

"Ed Hall"
Dec 2009

25×3×47 Posts

Quote:
 Originally Posted by a1call Perhaps you shouldn't dismiss mahbel's remarks so quickly. I can't quite follow what he is stating but he is telling you that rather than blindly searching for squares, you can narrow your search to relevant forms. It also helps to analyze routines with small numeric examples instead of astronomically large ones. Suppose you want to factor 21, 5-2 | 21=5^2-2^2 You could build some intelligence into your search by knowing effective ranges and rules. You could also extend your search to powers other than 2. For example: n^5-m^3 | n^(5j)-m(3j) 3 and 5 are arbitrary and can be replaced by any integers. But generally there is a commonality to the form of the composite candidate and it's sub-power factors that can be built as intelligence into the search. The Mersenne numbers are a subset of this rule of the form: 2^n-1^m | 2^(nj)-1^(mj)
Thank you for your post. I'm not tossing everything aside, but I am trying to find something that doesn't really involve filtering search criteria, per se. It would seem that even though he shows a way to reduce the search squares, there will still be too many to effectively test each one for larger composites. As for size issues, I'm currently playing with a grid of numbers based from 0 through 1600 and am learning some very interesting (to me) things.

Thank you very much for your post.

2017-03-05, 17:14   #10
science_man_88

"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts

Quote:
 Originally Posted by EdH Thank you for your post. I'm not tossing everything aside, but I am trying to find something that doesn't really involve filtering search criteria, per se. It would seem that even though he shows a way to reduce the search squares, there will still be too many to effectively test each one for larger composites. As for size issues, I'm currently playing with a grid of numbers based from 0 through 1600 and am learning some very interesting (to me) things. Thank you very much for your post.
at least fermat's idea isn't brute forcing the values such that 2kj+k+j = l such that 2l+1 = N like an inverse to the sieve of sundaram.

 2017-03-05, 19:46 #11 science_man_88     "Forget I exist" Jul 2009 Dumbassville 100000110000002 Posts if N=p*q then N= ((p+q)/2)^2-((p-q)/2)^2 of course but without p and q these formulae are pointless.

 Similar Threads Thread Thread Starter Forum Replies Last Post wildrabbitt Math 3 2016-08-16 08:38 rdotson Miscellaneous Math 0 2007-07-27 10:32 philmoore Math 131 2006-12-18 06:27 Carlos Programming 0 2005-09-11 12:50 LoKI.GuZ Math 10 2004-11-28 03:07

All times are UTC. The time now is 16:36.

Fri May 27 16:36:56 UTC 2022 up 43 days, 14:38, 0 users, load averages: 2.00, 1.80, 1.77