# Does there exist $a \in \mathbb{Q}$ such that $a^2 - a + 1$ is a square?

Does there exist $a \in \mathbb{Q}$ such that $a^2 - a + 1$ is a square?

Context for this question: For pedagogical purposes I was trying to create an example of a cubic polynomial with both its critical values and its zeros all at integers. After fumbling around with it unsuccessfully for a while, I realized that the problem of creating such an example was equivalent to finding a rational number $a$ ($a \ne 0,1$) with the property that $a^2 - a + 1$ is a perfect square. (Equivalently, find two integers $m,n$ such that $m^2 - mn + n^2$ is a perfect square.) I haven't been able to find an example and strongly suspect that it's not possible, but can't see a simple proof of why that should be so.

Any proof or counterexample to the conjecture that no such $a$ exists?

EDIT: I may have found the beginning of an argument, within a few minutes of posting the question. I'd appreciate feedback.

Suppose $b$ is a positive integer such that $a^2-a+1=b^2$. Then $a-1 = a^2-b^2$, so $a-1= (a-b)(a+b)$. Now if $a-b > 1$ then we have $$a-1 = (a-b)(a+b) > a+b$$ whence $b < -1$, contradicting the assumption that $b$ is a positive integer.

So if such a $b$ exists, it must be that $a-b \le 1$. Then.... (?)

• It might be useful to replace "perfect square" in the question by "perfect square rational" or "perfect square integer", whichever is meant. I think the former is meant when talking about rationals, the latter when talking about integers (which indeed makes the statements in the second paragraph equivalent). This is particularly pertinent since the accepted answer appears to show a negative answer to a different interpretation of the question (can $a^2-a-1$ be the square of an integer for $a\in\Bbb Q$?). – Marc van Leeuwen Mar 6 '17 at 7:49

$$a^2-a+1=(a-\frac{1}{2})^2+\frac{3}{4}$$

So what you ask are there any rational numbers $u=a-\frac{1}{2}$ and $v$ such that,

$$u^2+\frac{3}{4}=v^2$$

$$v^2-u^2=\frac{3}{4}$$

$$(v-u)(v+u)=\frac{3}{4}$$

Let $x$ and $y$ be two rational numbers that multiply to $\frac{3}{4}$

Solving the system

$$v-u=x$$

$$v+u=y$$

Yields the rational solutions $v=\frac{x+y}{2}$ and $u=\frac{y-x}{2}$. Which implies $a=\frac{y-x+1}{2}$.

• Nailed it. I was about to post my own solution (a different one) but you beat me to it by 2 minutes. Thanks! – mweiss Mar 6 '17 at 5:29
• You forgot to change the sign of $\frac34$ when moving it to the RHS. You would have found this out if you had tried your formulas to get an explicit example. Also I cannot understand your last sentence. – Marc van Leeuwen Mar 6 '17 at 5:43

For the record, integers $m,n$ such that $m^2-mn+n^2$ is a perfect square (integer) do exist, for instance $m=15$, $n=8$, for which $m^2-mn+n^2=169=13^2$. This is just to say that the answer to at least one unambiguous form of the question is affirmative.

An integer square multiple of one of your rational triples becomes an integer triple.

integer solutions ( with $a,b > 0$) of $a^2 - ab + b^2 = c^2$ are called Eisenstein triples, see https://en.wikipedia.org/wiki/Integer_triangle#Integer_triangles_with_a_60.C2.B0_angle_.28angles_in_arithmetic_progression.29

You would then get $$\left( \frac{a}{b} \right)^2 - \left( \frac{a}{b} \right) + 1 = \left( \frac{c}{b} \right)^2$$

I found an alternative parametrization: we can take $\gcd(u,v) = 1,$ also $u \neq v \pmod 3,$ then $0 < u < v,$ then take $$a = u^2 + 2uv, \; \; b = 2uv+ v^2, \; \; c = u^2 + uv + v^2$$

If you want $ab$ negative, you can replace $(a,b,c)$ by $(-a, -a+b,c),$ among other choices. Or, just allow $uv < 0.$ Put another way, if you begin with $a < 0, b > 0,$ replace $(a,b,c)$ by $(-a, -a+b,c)$ to get all positive. It all ends the same. If anyone can figure out the entire first line, please let me know, lyrics not posted anywhere easy to find. At about 27 seconds in, he says "A strongman from a carnival was in my dreams last night. He had an GIBBERISH and he rode upon a bike." GIBBERISH is about seconds 31-32.

           a^2 - a b + b^2 = c^2

c       a    b    c       u    v      c
7       5    8    7       1    2     7 = 7
13       7   15   13       1    3     13 = 13
19      16   21   19       2    3     19 = 19
31      11   35   31       1    5     31 = 31
37      33   40   37       3    4     37 = 37
43      13   48   43       1    6     43 = 43
49      39   55   49       3    5     49 = 7^2
61      56   65   61       4    5     61 = 61
67      32   77   67       2    7     67 = 67
73      17   80   73       1    8     73 = 73
79      51   91   79       3    7     79 = 79
91      19   99   91       1    9     91 = 7 * 13
91      85   96   91       5    6     91 = 7 * 13
97      57  112   97       3    8     97 = 97
103      40  117  103       2    9     103 = 103
109      95  119  109       5    7     109 = 109
127     120  133  127       6    7     127 = 127
133      23  143  133       1   11     133 = 7 * 19
133      88  153  133       4    9     133 = 7 * 19
139      69  160  139       3   10     139 = 139
151     115  171  151       5    9     151 = 151
157      25  168  157       1   12     157 = 157
163      75  187  163       3   11     163 = 163
169     161  176  169       7    8     169 = 13^2
181     104  209  181       4   11     181 = 181
193     175  207  193       7    9     193 = 193
199      56  221  199       2   13     199 = 199
211      29  224  211       1   14     211 = 211
217     208  225  217       8    9     217 = 7 * 31
217      87  247  217       3   13     217 = 7 * 31
223     168  253  223       6   11     223 = 223
229     145  264  229       5   12     229 = 229
241      31  255  241       1   15     241 = 241
247     203  275  247       7   11     247 = 13 * 19
247      93  280  247       3   14     247 = 13 * 19
259     155  299  259       5   13     259 = 7 * 37
259      64  285  259       2   15     259 = 7 * 37
271     261  280  271       9   10     271 = 271
277     217  312  277       7   12     277 = 277
283     192  325  283       6   13     283 = 283
301     136  345  301       4   15     301 = 7 * 43
301     279  319  301       9   11     301 = 7 * 43
307      35  323  307       1   17     307 = 307
313     105  352  313       3   16     313 = 313
331     320  341  331      10   11     331 = 331
337     272  377  337       8   13     337 = 337
343      37  360  343       1   18     343 = 7^3
349     111  391  349       3   17     349 = 349
361     185  416  361       5   16     361 = 19^2
367     315  403  367       9   13     367 = 367
373     152  425  373       4   17     373 = 373
379     259  435  379       7   15     379 = 379
397     385  408  397      11   12     397 = 397
403     333  448  403       9   14     403 = 13 * 31
403      80  437  403       2   19     403 = 13 * 31
409     304  465  409       8   15     409 = 409
421      41  440  421       1   20     421 = 421
427     123  475  427       3   19     427 = 7 * 61
427     240  493  427       6   17     427 = 7 * 61
433     407  455  433      11   13     433 = 433
439     205  504  439       5   18     439 = 439
457     287  527  457       7   17     457 = 457
463      43  483  463       1   21     463 = 463
469     129  520  469       3   20     469 = 7 * 67
469     456  481  469      12   13     469 = 7 * 67
481     215  551  481       5   19     481 = 13 * 37
481     369  544  481       9   16     481 = 13 * 37
487      88  525  487       2   21     487 = 487
499     301  576  499       7   18     499 = 499
511     264  589  511       6   19     511 = 7 * 73
511     451  555  511      11   15     511 = 7 * 73
523     387  595  523       9   17     523 = 523
541     184  609  541       4   21     541 = 541
547     533  560  547      13   14     547 = 547
553     473  608  553      11   16     553 = 7 * 79
553      47  575  553       1   23     553 = 7 * 79
559     141  616  559       3   22     559 = 13 * 43
559     440  629  559      10   17     559 = 13 * 43
571     235  651  571       5   21     571 = 571
577     368  665  577       8   19     577 = 577
589     329  680  589       7   20     589 = 19 * 31
589     559  615  589      13   15     589 = 19 * 31
601      49  624  601       1   24     601 = 601
607     147  667  607       3   23     607 = 607
613     423  703  613       9   19     613 = 613
619     245  704  619       5   22     619 = 619
631     616  645  631      14   15     631 = 631
637     200  713  637       4   23     637 = 7^2 * 13
637     552  697  637      12   17     637 = 7^2 * 13
643     517  720  643      11   18     643 = 643
661     441  760  661       9   20     661 = 661
673     400  777  673       8   21     673 = 673
679     104  725  679       2   25     679 = 7 * 97
679     611  731  679      13   17     679 = 7 * 97
691     539  779  691      11   19     691 = 691
703     312  805  703       6   23     703 = 19 * 37
703      53  728  703       1   26     703 = 19 * 37
709     159  775  709       3   25     709 = 709
721     265  816  721       5   24     721 = 7 * 103
721     705  736  721      15   16     721 = 7 * 103
727     637  792  727      13   18     727 = 727
733     600  817  733      12   19     733 = 733
739     371  851  739       7   23     739 = 739
751     520  861  751      10   21     751 = 751
757      55  783  757       1   27     757 = 757
763     165  832  763       3   26     763 = 7 * 109
763     477  880  763       9   22     763 = 7 * 109
769     735  799  769      15   17     769 = 769
787     112  837  787       2   27     787 = 787
793     385  912  793       7   24     793 = 13 * 61
793     583  903  793      11   21     793 = 13 * 61
811     336  925  811       6   25     811 = 811
817     495  943  817       9   23     817 = 19 * 43
817     800  833  817      16   17     817 = 19 * 43
823     728  893  823      14   19     823 = 823
829     689  920  829      13   20     829 = 829
853     232  945  853       4   27     853 = 853
859     560  989  859      10   23     859 = 859
871      59  899  871       1   29     871 = 13 * 67
871     795  931  871      15   19     871 = 13 * 67
877     177  952  877       3   28     877 = 877
883     715  987  883      13   21     883 = 883
889     295  999  889       5   27     889 = 7 * 127
889     464 1025  889       8   25     889 = 7 * 127
907     413 1040  907       7   26     907 = 907
919     901  936  919      17   18     919 = 919
931     531 1075  931       9   25     931 = 7^2 * 19
931      61  960  931       1   30     931 = 7^2 * 19
937     183 1015  937       3   29     937 = 937
949     305 1064  949       5   28     949 = 13 * 73
949     696 1081  949      12   23     949 = 13 * 73
961     649 1104  961      11   24     961 = 31^2
967     427 1107  967       7   27     967 = 967
973     248 1073  973       4   29     973 = 7 * 139
973     935 1007  973      17   19     973 = 7 * 139
991     549 1144  991       9   26     991 = 991
997     767 1127  997      13   23     997 = 997
1009     496 1161 1009       8   27     1009 = 1009
1021     671 1175 1021      11   25     1021 = 1021
1027    1008 1045 1027      18   19     1027 = 13 * 79
1027     128 1085 1027       2   31     1027 = 13 * 79
1033     928 1113 1033      16   21     1033 = 1033
1039     885 1144 1039      15   22     1039 = 1039
1051     384 1189 1051       6   29     1051 = 1051
1057      65 1088 1057       1   32     1057 = 7 * 151
1057     793 1200 1057      13   24     1057 = 7 * 151
1063     195 1147 1063       3   31     1063 = 1063
1069     744 1225 1069      12   25     1069 = 1069
1087    1003 1155 1087      17   21     1087 = 1087
1093     455 1247 1093       7   29     1093 = 1093
1099     640 1269 1099      10   27     1099 = 7 * 157
1099     915 1219 1099      15   23     1099 = 7 * 157
1117     585 1288 1117       9   28     1117 = 1117
1123      67 1155 1123       1   33     1123 = 1123
1129     201 1216 1129       3   32     1129 = 1129
1141    1121 1160 1141      19   20     1141 = 7 * 163
1141     335 1271 1141       5   31     1141 = 7 * 163
1147    1037 1232 1147      17   22     1147 = 31 * 37
1147     715 1323 1147      11   27     1147 = 31 * 37
1153     992 1265 1153      16   23     1153 = 1153
1159     136 1221 1159       2   33     1159 = 19 * 61
1159     469 1320 1159       7   30     1159 = 19 * 61
1171     896 1325 1171      14   25     1171 = 1171
1183     408 1333 1183       6   31     1183 = 7 * 13^2
1183     603 1363 1183       9   29     1183 = 7 * 13^2
1201    1159 1239 1201      19   21     1201 = 1201
1213     737 1400 1213      11   28     1213 = 1213
1231     680 1421 1231      10   29     1231 = 1231
1237     280 1353 1237       4   33     1237 = 1237
1249     871 1431 1249      13   27     1249 = 1249
1261    1240 1281 1261      20   21     1261 = 13 * 97
1261      71 1295 1261       1   35     1261 = 13 * 97
1267    1152 1357 1267      18   23     1267 = 7 * 181
1267     213 1360 1267       3   34     1267 = 7 * 181
1273    1105 1392 1273      17   24     1273 = 19 * 67
1273     560 1457 1273       8   31     1273 = 19 * 67
1279     355 1419 1279       5   33     1279 = 1279
1291    1005 1456 1291      15   26     1291 = 1291
1297     497 1472 1297       7   32     1297 = 1297
1303     952 1485 1303      14   27     1303 = 1303
1321     639 1519 1321       9   31     1321 = 1321
1327    1235 1403 1327      19   23     1327 = 1327
1333      73 1368 1333       1   36     1333 = 31 * 43
1333     840 1537 1333      12   29     1333 = 31 * 43
1339    1139 1475 1339      17   25     1339 = 13 * 103
1339     219 1435 1339       3   35     1339 = 13 * 103
1351     365 1496 1351       5   34     1351 = 7 * 193
1351     781 1560 1351      11   30     1351 = 7 * 193
1369     511 1551 1369       7   33     1369 = 37^2
1381     296 1505 1381       4   35     1381 = 1381
1387    1365 1408 1387      21   22     1387 = 19 * 73
1387     923 1595 1387      13   29     1387 = 19 * 73
1393    1273 1488 1393      19   24     1393 = 7 * 199
1393     657 1600 1393       9   32     1393 = 7 * 199
1399    1224 1525 1399      18   25     1399 = 1399
1417    1120 1593 1417      16   27     1417 = 13 * 109
1417     592 1617 1417       8   33     1417 = 13 * 109
1423     803 1643 1423      11   31     1423 = 1423
1429    1065 1624 1429      15   28     1429 = 1429
1447     152 1517 1447       2   37     1447 = 1447
1453    1407 1495 1453      21   23     1453 = 1453
1459     949 1680 1459      13   30     1459 = 1459
1471     456 1645 1471       6   35     1471 = 1471
1477    1207 1647 1477      17   27     1477 = 7 * 211
1477     888 1705 1477      12   31     1477 = 7 * 211
1483      77 1520 1483       1   38     1483 = 1483
1489     231 1591 1489       3   37     1489 = 1489
1501    1095 1711 1501      15   29     1501 = 19 * 79
1501     385 1656 1501       5   36     1501 = 19 * 79
1519    1496 1541 1519      22   23     1519 = 7^2 * 31
1519     760 1749 1519      10   33     1519 = 7^2 * 31
1531    1349 1664 1531      19   26     1531 = 1531
1543     693 1768 1543       9   34     1543 = 1543
1549    1241 1736 1549      17   28     1549 = 1549
1561    1184 1769 1561      16   29     1561 = 7 * 223
1561      79 1599 1561       1   39     1561 = 7 * 223
1567     237 1672 1567       3   38     1567 = 1567
1579     395 1739 1579       5   37     1579 = 1579
1591    1064 1829 1591      14   31     1591 = 37 * 43
1591    1491 1675 1591      21   25     1591 = 37 * 43
1597     553 1800 1597       7   36     1597 = 1597
1603    1387 1755 1603      19   27     1603 = 7 * 229
1603     160 1677 1603       2   39     1603 = 7 * 229
1609    1001 1856 1609      13   32     1609 = 1609
1621     711 1855 1621       9   35     1621 = 1621
1627     480 1813 1627       6   37     1627 = 1627
1651    1155 1891 1651      15   31     1651 = 13 * 127
1651     869 1904 1651      11   34     1651 = 13 * 127
1657    1633 1680 1657      23   24     1657 = 1657
1663    1533 1768 1663      21   26     1663 = 1663
1669    1480 1809 1669      20   27     1669 = 1669
1687    1027 1947 1687      13   33     1687 = 7 * 241
1687    1368 1885 1687      18   29     1687 = 7 * 241
1693     328 1833 1693       4   39     1693 = 1693
1699    1309 1920 1699      17   30     1699 = 1699
1723      83 1763 1723       1   41     1723 = 1723
1729    1185 1984 1729      15   32     1729 = 7 * 13 * 19
1729    1679 1775 1729      23   25     1729 = 7 * 13 * 19
1729     249 1840 1729       3   40     1729 = 7 * 13 * 19
1729     656 1961 1729       8   37     1729 = 7 * 13 * 19
c       a    b    c        u    v      c

a^2 - a b + b^2 = c^2

• "He had an acorn for a head, and he rode upon a bike." That's what it sounds like to me anyway. Googling the sentence produced this link that agrees with me, though I'm not sure how convincing that is. – André 3000 Mar 6 '17 at 21:44
• @Quasicoherent Thank you. That cable tv episode is where I first heard the song. The part about acorn fits both the dream setting and my hearing. I heard "AconFed" so I did not feel I really had the central idea yet. – Will Jagy Mar 7 '17 at 0:33
• @Quasicoherent here is a link with the few seconds from the song used in the cable episode. In this, the words "acorn for a head" are clear: youtube.com/watch?v=03lXJFKo9h0 – Will Jagy Mar 7 '17 at 2:41

Here is an alternative solution that I came up with shortly after Ahmed S. Attaalla posted his answer.

If $a^2 - a + 1 = b^2$ for some $b \in \mathbb{Q}$ then $a^2 - a + (1-b^2) = 0$, whence by the quadratic formula we have $$a = \frac{1 \pm \sqrt{1 - 4\left(1-b^2\right)}}{2} = \frac{1 \pm \sqrt{4b^2-3}}{2}$$ If this is to be rational, then we need $4b^2 - 3$ to be a rational square. In other words we need to find $c$ such that $4b^2 - 3 = c^2$, or equivalently such that $\left(2b\right)^2 - c^2 = 3$.

Now the problem has been reduced to: "Find two rational numbers (in this base $2b$ and $c$) whose squares differ by a given number (in this case $3$)." This is a classical problem whose solution is given in Diophantus's Arithmetica (Book II, Problem 10). The solution given there (generalized and in modern language and notation) runs more or less as follows:

Choose any nonzero rational parameter $k$, and set $2b = c + k$. Then the condition $\left(2b\right)^2 - c^2 = 3$ reduces to $$(c+k)^2 - c^2 = 3$$ $$c^2 + 2ck + k^2 - c^2 = 3$$ $$c = \frac{3-k^2}{2k}$$

Now follow the breadcrumbs back to the original problem: We have $$2b = \frac{3-k^2}{2k} + k = \frac{3+k^2}{2k}$$ $$b= \frac{3+k^2}{4k}$$

So \begin{align*}a &= \frac{1 \pm \sqrt{4\left(\frac{3+k^2}{4k}\right)^2-3}}{2}\\ &= \frac{1 \pm \sqrt{4\left(\frac{9+6k^2+k^4}{16k^2}\right)-3}}{2}\\ &=\frac{1\pm\sqrt{\frac{9-6k^2+k^4}{4k^2}}}{2}\\ &=\frac{1 \pm \frac{3-k^2}{2k}} {2}\\ &=\frac{2k \pm (3 - k^2)}{4k}\\ \end{align*}

To summarize: for any rational $k\ne 0$, we have $a = \frac{2k \pm (3 - k^2)}{4k}$ are two rational numbers satisfying the conditions of the problem.

For example, with $k$ = 1, we get $a = \frac{2\pm(2)}{4}$, which produces the two trivial solutions $a=0,1$. (It's interesting to note that $k=3$ also produces the same trivial solution.)

For a nontrivial example, with $k=4$, we get $a = \frac{8\pm 13}{16}$. We can confirm that $$\left(\frac{21}{16} \right)^2 - \left(\frac{21}{16} \right) + 1 =\frac{441-336+256}{256} = \frac{361}{256} = \left(\frac{19}{16}\right)^2$$ and $$\left(\frac{-5}{16} \right)^2 - \left(\frac{-5}{16} \right) + 1 =\frac{25+80+256}{256} = \frac{361}{256} = \left(\frac{19}{16}\right)^2$$

• there are several known parametrizations, the integer version (when all positive) are called Eisenstein triples. These also make integer triangles with a $60^\circ$ angle. Posted answer. – Will Jagy Mar 6 '17 at 17:40