# b-file for OEIS sequence A180442, "Numbers n such that a sum of two # or more consecutive squares beginning with n^2 is a square." # # For each such number n, there exists at least one ordered pair of # integers (k,m) such that # # n^2 + (n+1)^2 + (n+2)^2 + ... + k^2 = m^2 (Eqn. 1) # # where k > n (since the left hand side is the sum of two or more # squares). # # This can be expressed as # # m^2 = (1^2 + 2^2 + ... + k^2) - (1^2 + 2^2 + ... + (n-1)^2) # # and since 1^2 + 2^2 + ... + k^2 = (2*k^3 + 3*k^2 + k)/6, Eqn. 1 can # be rewritten as # # m^2 = (2*k^3 + 3*k^2 + k)/6 - s (Eqn. 2) # # where # # s = (2*(n-1)^3 + 3*(n-1)^2 + (n-1))/6 # # Multiplying each side of Eqn. 2 by 72^2 = 5184 gives # # 5184*m^2 = 1728*k^3 + 2592*k^2 + 864*k - 5184*s # or # (72*m)^2 = (12*k)^3 + 18*(12*k)^2 + 72*(12*k) - 5184*s # # and substituting x=12*k and y=72*m gives the elliptic curve # in a standard form as # # y^2 = x^3 + 18*x^2 + 72*x - 5184*s # # for which the integer solutions can be readily found using Magma; # e.g., copying the Magma code # # for n in [1..100] do # s:=(2*(n-1)^3 + 3*(n-1)^2 + (n-1)) div 6; # A:=IntegralPoints(EllipticCurve([0,18,0,72,-5184*s])); # for i in [1..#A] do # x:=Round(Abs(A[i][1])); # y:=Round(Abs(A[i][2])); # if (x mod 12 eq 0) and (y mod 72 eq 0) then # k:=x div 12; # m:=y div 72; # if (k gt n) then # n, k, m; # break; # end if; # end if; # end for; # end for; # # and pasting it into the Online Magma Calculator at # # http://magma.maths.usyd.edu.au/calc/ # # will cause it to -- # # -- find, for each value of n in 1..100, the integer solutions of # the above elliptic curve (i.e., the points (x,y) where both x # and y are integers); # # -- search through those (x,y) pairs for one where x/12 and y/72 # (i.e., k and m) are both integer and k > n; and, if such a pair # (x,y) is found, # # -- output n, k, and m, and go on to examine the next value of n. # # The 123 terms listed below were obtained by using the Online Magma # Calculator (which, at present, has a 120-second time limit per run) # to search through all values of n in the interval 1..460 (using # multiple runs, breaking the interval into a number of smaller # subintervals by changing the starting and ending values in the # "for" statement at the top). An integer n in the interval 1..460 is # listed below if and only if this search found a pair of integers # (k, m) satisfying Eqn. 1 (with k > n). # 1 1 2 3 3 7 4 9 5 11 6 13 7 15 8 17 9 18 10 20 11 21 12 22 13 25 14 27 15 28 16 30 17 32 18 38 19 44 20 50 21 52 22 55 23 58 24 60 25 64 26 65 27 67 28 73 29 74 30 76 31 83 32 87 33 91 34 103 35 104 36 106 37 112 38 115 39 117 40 119 41 121 42 124 43 128 44 129 45 131 46 132 47 137 48 140 49 142 50 146 51 158 52 168 53 170 54 172 55 175 56 178 57 181 58 183 59 192 60 193 61 197 62 199 63 200 64 204 65 210 66 214 67 216 68 223 69 225 70 227 71 232 72 233 73 234 74 244 75 246 76 247 77 248 78 253 79 255 80 258 81 262 82 269 83 272 84 280 85 286 86 287 87 291 88 294 89 301 90 302 91 304 92 306 93 309 94 311 95 312 96 316 97 319 98 321 99 322 100 323 101 324 102 331 103 344 104 346 105 349 106 353 107 358 108 377 109 378 110 379 111 380 112 390 113 395 114 403 115 409 116 413 117 429 118 433 119 442 120 443 121 451 122 454 123 456