 dedicated to explicating prime numbers
without imaginary numbers   home

First published Feb. 24.
Revised March 11, 2008

Perfect Squares and Factorization

Instantly Factor a Semiprime

Related Postings

Euclidean Algorithm using subtraction only

The Magic Square of Subtraction: A 'Classic' Discovery.

Looking for Lists of Perfect Squares...?

Factors and Perfect Squares: Two Interesting "Rules"

It's a very odd thing that there's no commonly understood mathematical symbol to represent a perfect square. If there were, maybe perfect squares would get more respect. In fact, if I were a mathematician, I'd demand two: one for odd perfect squares and one for even ones! They are the veritable yin and yang, male and female, of the numberverse.

These "rules" have a lot do with perfect squares - but maybe not as much I would wish. Although these observations come out of my recent thinking about Q-paired primes - they are really cases of my rediscovering things that mathematicians have known for a very long time. Nevertheless, since I'm excited about them, I would like to share them with you here.

If the first of these rules is merely ridiculous, the second rule may just be sublime.... For the sake of brevity, I will illustrate these by looking only at numbers between 99 and 999. If you would like to see must larger samples, download the supplied text files (at the end of each list).

Rule #1a

The highest factor of the composite immediately preceding an even perfect square is the square root of the next odd perfect square.

Rule #1b

The subtractive product of the composite immediately preceding an even perfect square and the next odd perfect square is the sum of the odd perfect square's factors.

Rule #1a means that, for example, 11 is a factor of 99 (3 * 3 * 11) and 121 (11 * 11). Rule #1b means that, for example, 121 - 99 = 22 (11 + 11).

It only takes a moment to realize that these factors are increasing by 2, the common difference of quadratic growth. The perfect squares are, by definition, growing quadratically - so, of course, this must be so for the factors of the predictive composite (the one occurring immediately before the prior even perfect square) if they are to correspond. Notice also that when the square root of a perfect square is not a prime, the prime factors of the predictive composite will create that square root by combination.

These observations must have been made many times before, but perhaps the implications have not been taken to their logical conclusions. (See The Magic Square of Subtraction.)

 Composite Before Even Perfect Square (Highest Factor) Even Perfect Square Odd perfect Square (Square Root Factors ) 99 = 3 * 3 * 11 100 121 = 11 * 11 143 = 11 * 13 144 169 = 13 * 13 195 = 3 * 5 * 13 = (13 * 15) 196 225 = 3 * 3 * 5 * 5 = (15 * 15) 255 = 3 * 5 * 17 256 289 = 17 * 17 323 = 17 * 19 324 361 = 19 * 19 399 = 3 * 7 * 19 = (19 * 21) 400 441 = 3 * 3 * 7 * 7 = (21 * 21) 483 = 3 * 7 * 23 484 529 = 23 * 23 575 = 5 * 5 * 23 = (23 * 25) 576 625 = 5 * 5 * 5 * 5 = (25 * 25) 675 = 3 * 3 * 3 * 5 * 5 = (25 * 27) 676 729 = 3 * 3 * 3 * 3 * 3 * 3 = (27 * 27) 783 = 3 * 3 * 3 * 29 784 841 = 29 * 29 899 = 29 * 31 900 961 = 31 * 31

Rule #2

Negatively stated:
The difference* between a prime number and its immediately preceding perfect square cannot be a factor of that perfect square.

Positively stated:
A number must be composite if its offset* from the immediately preceding perfect square is a factor of that perfect square.

* Difference and offset are used interchangeably on this site.

Rule #2 (negatively stated) means that, for example, 113 - 100 = 13 and the GDC of 100 and 13 is 1. Rule #2 (positively stated) means that, for example, 115 - 100 = 15 and the GDC of 100 and 15 is 5.

BTW This is not a proof of primality, of course, because the absence of a common factor, or divisor (a GCD other than 1), of the perfect square and the difference between it and a given number greater than the perfect square - is a property displayed by many composites also. The presence of a common factor is, however, a proof of compositeness.

I have just realized that this is really nothing more than another way of demonstrating two integers are not relatively prime - so this has been around for a few thousand years! I realized this while playing around with the Euclidean algorithm. In case anyone is interested, I've posted VB6 source code that demonstrates how the Euclidean algorithm can be calculated using only subtraction - no other arithmetic operator - which is probably the way Euclid did it....

 Do PS and D have a common factor (CF)? where: N - Perfect Square (PS) = Difference (D) If CF > 0 then N is Composite OR If CF = 0 then N is Prime (or composite)* 99 - 81 = 18 (3) C 101 - 100 = 1 (0) P 103 - 100 = 3 (0) P 105 - 100 = 5 (5) C 107 - 100 = 7 (0) P 109 - 100 = 9 (0) P 110 - 100 = 10 (5) C 113 - 100 = 13 (0) P 115 - 100 = 15 (5) C 120 - 100 = 20 (5) C 127 - 121 = 6 (0) P 131 - 121 = 10 (0) P 132 - 121 = 11 (11) C 137 - 121 = 16 (0) P 139 - 121 = 18 (0) P 143 - 121 = 22 (11) C 147 - 144 = 3 (3) C 149 - 144 = 5 (0) P 150 - 144 = 6 (3) C 151 - 144 = 7 (0) P 153 - 144 = 9 (3) C 156 - 144 = 12 (3) C 157 - 144 = 13 (0) P 159 - 144 = 15 (3) C 162 - 144 = 18 (3) C 163 - 144 = 19 (0) P 165 - 144 = 21 (3) C 167 - 144 = 23 (0) P 168 - 144 = 24 (3) C 173 - 169 = 4 (0) P 179 - 169 = 10 (0) P 181 - 169 = 12 (0) P 182 - 169 = 13 (13) C 191 - 169 = 22 (0) P 193 - 169 = 24 (0) P 195 - 169 = 26 (13) C 197 - 196 = 1 (0) P 199 - 196 = 3 (0) P 203 - 196 = 7 (7) C 210 - 196 = 14 (7) C 211 - 196 = 15 (0) P 217 - 196 = 21 (7) C 223 - 196 = 27 (0) P 224 - 196 = 28 (7) C 227 - 225 = 2 (0) P 229 - 225 = 4 (0) P 230 - 225 = 5 (5) C 233 - 225 = 8 (0) P 235 - 225 = 10 (5) C 239 - 225 = 14 (0) P 240 - 225 = 15 (5) C 241 - 225 = 16 (0) P 245 - 225 = 20 (5) C 250 - 225 = 25 (5) C 251 - 225 = 26 (0) P 255 - 225 = 30 (5) C 257 - 256 = 1 (0) P 258 - 256 = 2 (2) C 260 - 256 = 4 (2) C 262 - 256 = 6 (2) C 263 - 256 = 7 (0) P 264 - 256 = 8 (2) C 266 - 256 = 10 (2) C 268 - 256 = 12 (2) C 269 - 256 = 13 (0) P 270 - 256 = 14 (2) C 271 - 256 = 15 (0) P 272 - 256 = 16 (2) C 274 - 256 = 18 (2) C 276 - 256 = 20 (2) C 277 - 256 = 21 (0) P 278 - 256 = 22 (2) C 280 - 256 = 24 (2) C 281 - 256 = 25 (0) P 282 - 256 = 26 (2) C 283 - 256 = 27 (0) P 284 - 256 = 28 (2) C 286 - 256 = 30 (2) C 288 - 256 = 32 (2) C 293 - 289 = 4 (0) P 306 - 289 = 17 (17) C 307 - 289 = 18 (0) P 311 - 289 = 22 (0) P 313 - 289 = 24 (0) P 317 - 289 = 28 (0) P 323 - 289 = 34 (17) C 327 - 324 = 3 (3) C 330 - 324 = 6 (3) C 331 - 324 = 7 (0) P 333 - 324 = 9 (3) C 336 - 324 = 12 (3) C 337 - 324 = 13 (0) P 339 - 324 = 15 (3) C 342 - 324 = 18 (3) C 345 - 324 = 21 (3) C 347 - 324 = 23 (0) P 348 - 324 = 24 (3) C 349 - 324 = 25 (0) P 351 - 324 = 27 (3) C 353 - 324 = 29 (0) P 354 - 324 = 30 (3) C 357 - 324 = 33 (3) C 359 - 324 = 35 (0) P 360 - 324 = 36 (3) C 367 - 361 = 6 (0) P 373 - 361 = 12 (0) P 379 - 361 = 18 (0) P 380 - 361 = 19 (19) C 383 - 361 = 22 (0) P 389 - 361 = 28 (0) P 397 - 361 = 36 (0) P 399 - 361 = 38 (19) C 401 - 400 = 1 (0) P 405 - 400 = 5 (5) C 409 - 400 = 9 (0) P 410 - 400 = 10 (5) C 415 - 400 = 15 (5) C 419 - 400 = 19 (0) P 420 - 400 = 20 (5) C 421 - 400 = 21 (0) P 425 - 400 = 25 (5) C 430 - 400 = 30 (5) C 431 - 400 = 31 (0) P 433 - 400 = 33 (0) P 435 - 400 = 35 (5) C 439 - 400 = 39 (0) P 440 - 400 = 40 (5) C 443 - 441 = 2 (0) P 448 - 441 = 7 (7) C 449 - 441 = 8 (0) P 455 - 441 = 14 (7) C 457 - 441 = 16 (0) P 461 - 441 = 20 (0) P 462 - 441 = 21 (7) C 463 - 441 = 22 (0) P 467 - 441 = 26 (0) P 469 - 441 = 28 (7) C 476 - 441 = 35 (7) C 479 - 441 = 38 (0) P 483 - 441 = 42 (7) C 487 - 484 = 3 (0) P 491 - 484 = 7 (0) P 495 - 484 = 11 (11) C 499 - 484 = 15 (0) P 503 - 484 = 19 (0) P 506 - 484 = 22 (11) C 509 - 484 = 25 (0) P 517 - 484 = 33 (11) C 521 - 484 = 37 (0) P 523 - 484 = 39 (0) P 528 - 484 = 44 (11) C 541 - 529 = 12 (0) P 547 - 529 = 18 (0) P 552 - 529 = 23 (23) C 557 - 529 = 28 (0) P 563 - 529 = 34 (0) P 569 - 529 = 40 (0) P 571 - 529 = 42 (0) P 575 - 529 = 46 (23) C 577 - 576 = 1 (0) P 579 - 576 = 3 (3) C 582 - 576 = 6 (3) C 585 - 576 = 9 (3) C 587 - 576 = 11 (0) P 588 - 576 = 12 (3) C 591 - 576 = 15 (3) C 593 - 576 = 17 (0) P 594 - 576 = 18 (3) C 597 - 576 = 21 (3) C 599 - 576 = 23 (0) P 600 - 576 = 24 (3) C 601 - 576 = 25 (0) P 603 - 576 = 27 (3) C 606 - 576 = 30 (3) C 607 - 576 = 31 (0) P 609 - 576 = 33 (3) C 612 - 576 = 36 (3) C 613 - 576 = 37 (0) P 615 - 576 = 39 (3) C 617 - 576 = 41 (0) P 618 - 576 = 42 (3) C 619 - 576 = 43 (0) P 621 - 576 = 45 (3) C 624 - 576 = 48 (3) C 630 - 625 = 5 (5) C 631 - 625 = 6 (0) P 635 - 625 = 10 (5) C 640 - 625 = 15 (5) C 641 - 625 = 16 (0) P 643 - 625 = 18 (0) P 645 - 625 = 20 (5) C 647 - 625 = 22 (0) P 650 - 625 = 25 (5) C 653 - 625 = 28 (0) P 655 - 625 = 30 (5) C 659 - 625 = 34 (0) P 660 - 625 = 35 (5) C 661 - 625 = 36 (0) P 665 - 625 = 40 (5) C 670 - 625 = 45 (5) C 673 - 625 = 48 (0) P 675 - 625 = 50 (5) C 677 - 676 = 1 (0) P 683 - 676 = 7 (0) P 689 - 676 = 13 (13) C 691 - 676 = 15 (0) P 701 - 676 = 25 (0) P 702 - 676 = 26 (13) C 709 - 676 = 33 (0) P 715 - 676 = 39 (13) C 719 - 676 = 43 (0) P 727 - 676 = 51 (0) P 728 - 676 = 52 (13) C 732 - 729 = 3 (3) C 733 - 729 = 4 (0) P 735 - 729 = 6 (3) C 738 - 729 = 9 (3) C 739 - 729 = 10 (0) P 741 - 729 = 12 (3) C 743 - 729 = 14 (0) P 744 - 729 = 15 (3) C 747 - 729 = 18 (3) C 750 - 729 = 21 (3) C 751 - 729 = 22 (0) P 753 - 729 = 24 (3) C 756 - 729 = 27 (3) C 757 - 729 = 28 (0) P 759 - 729 = 30 (3) C 761 - 729 = 32 (0) P 762 - 729 = 33 (3) C 765 - 729 = 36 (3) C 768 - 729 = 39 (3) C 769 - 729 = 40 (0) P 771 - 729 = 42 (3) C 773 - 729 = 44 (0) P 774 - 729 = 45 (3) C 777 - 729 = 48 (3) C 780 - 729 = 51 (3) C 783 - 729 = 54 (3) C 787 - 784 = 3 (0) P 791 - 784 = 7 (7) C 797 - 784 = 13 (0) P 798 - 784 = 14 (7) C 805 - 784 = 21 (7) C 809 - 784 = 25 (0) P 811 - 784 = 27 (0) P 812 - 784 = 28 (7) C 819 - 784 = 35 (7) C 821 - 784 = 37 (0) P 823 - 784 = 39 (0) P 826 - 784 = 42 (7) C 827 - 784 = 43 (0) P 829 - 784 = 45 (0) P 833 - 784 = 49 (7) C 839 - 784 = 55 (0) P 840 - 784 = 56 (7) C 853 - 841 = 12 (0) P 857 - 841 = 16 (0) P 859 - 841 = 18 (0) P 863 - 841 = 22 (0) P 870 - 841 = 29 (29) C 877 - 841 = 36 (0) P 881 - 841 = 40 (0) P 883 - 841 = 42 (0) P 887 - 841 = 46 (0) P 899 - 841 = 58 (29) C 905 - 900 = 5 (5) C 907 - 900 = 7 (0) P 910 - 900 = 10 (5) C 911 - 900 = 11 (0) P 915 - 900 = 15 (5) C 919 - 900 = 19 (0) P 920 - 900 = 20 (5) C 925 - 900 = 25 (5) C 929 - 900 = 29 (0) P 930 - 900 = 30 (5) C 935 - 900 = 35 (5) C 937 - 900 = 37 (0) P 940 - 900 = 40 (5) C 941 - 900 = 41 (0) P 945 - 900 = 45 (5) C 947 - 900 = 47 (0) P 950 - 900 = 50 (5) C 953 - 900 = 53 (0) P 955 - 900 = 55 (5) C 960 - 900 = 60 (5) C 967 - 961 = 6 (0) P 971 - 961 = 10 (0) P 977 - 961 = 16 (0) P 983 - 961 = 22 (0) P 991 - 961 = 30 (0) P 992 - 961 = 31 (31) C 997 - 961 = 36 (0) P
*Composites with no common factors are not shown.