A summoning of sums

For positive integers n n let S ( n ) S(n) be the number of positive integer pairs ( a , b ) (a,b) such that a 2 + a + n = b 2 a^{2} + a + n = b^{2} .

Let n k n_{k} be the least positive integer for which S ( n k ) = k S(n_{k}) = k .

Find k = 0 4 n k \displaystyle\sum_{k=0}^{4} n_{k} .


The answer is 63.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

4 solutions

Note first that for a 1 a \ge 1 we have that a 2 < a 2 + a + 1 < a 2 + 2 a + 1 = ( a + 1 ) 2 a^{2} \lt a^{2} + a + 1 \lt a^{2} + 2a + 1 = (a + 1)^{2} , so as a 2 + a + 1 a^{2} + a + 1 lies strictly between successive squares it cannot itself be a perfect square b 2 b^{2} . So S ( 1 ) = 0 S(1) = 0 and thus n 0 = 1 n_{0} = 1 .

Now a 2 + a + n = b 2 ( a + 1 2 ) 2 1 4 + n = b 2 ( 2 a + 1 ) 2 + 4 n 1 = 4 b 2 a^{2} + a + n = b^{2} \Longrightarrow (a + \frac{1}{2})^{2} - \frac{1}{4} + n = b^{2} \Longrightarrow (2a + 1)^{2} + 4n - 1 = 4b^{2}

( 2 b ) 2 ( 2 a + 1 ) 2 = 4 n 1 ( 2 b ( 2 a + 1 ) ) ( 2 b + ( 2 a + 1 ) ) = 4 n 1 \Longrightarrow (2b)^{2} - (2a + 1)^{2} = 4n - 1 \Longrightarrow (2b - (2a + 1))(2b + (2a + 1)) = 4n - 1 .

Note first that for a 1 a \ge 1 we have that 2 b + ( 2 a + 1 ) ( 2 b ( 2 a + 1 ) ) = 4 a + 2 6 2b + (2a + 1) - (2b - (2a + 1)) = 4a + 2 \ge 6 . So if we factor 4 n 1 4n - 1 into positive integer divisor pairs ( d 1 , d 2 ) , d 1 + 6 d 2 (d_{1}, d_{2}), d_{1} + 6 \le d_{2} then set d 1 = 2 b ( 2 a + 1 ) , d 2 = 2 b + ( 2 a + 1 ) d_{1} = 2b - (2a + 1), d_{2} = 2b + (2a + 1) we see that d 1 + d 2 = 4 b d_{1} + d_{2} = 4b . So we are looking for n n such that 4 n 1 4n - 1 has k k divisor pairs where each pair ( d 1 , d 2 ) (d_{1}, d_{2}) is such that d 2 d 1 6 |d_{2} - d_{1}| \ge 6 and 4 ( d 2 d 1 ) 4 | (d_{2} - d_{1}) .

For n = 2 n = 2 we have 4 n 1 = 7 4n - 1 = 7 , for which we have precisely 1 1 suitable divisor pair ( d 1 , d 2 ) = ( 1 , 7 ) (d_{1}, d_{2}) = (1,7) . Thus S ( 2 ) = 1 S(2) = 1 and n 1 = 2 n_{1} = 2 .

We can then quickly work our way up integers n n checking for values 4 n 1 4n - 1 that have multiple divisor pairs. We first reach n = 7 , 4 n 1 = 27 n = 7, 4n - 1 = 27 giving us suitable divisor pairs ( 1 , 27 ) (1,27) and ( 3 , 9 ) (3,9) , and so S ( 7 ) = 2 , n 2 = 7 S(7) = 2, n_{2} = 7 .

The next level is reached with n = 19 , 4 n 1 = 75 n = 19, 4n - 1 = 75 with suitable divisor pairs ( 1 , 75 ) , ( 3 , 25 ) (1,75), (3,25) and ( 5 , 15 ) (5,15) , giving us S ( 19 ) = 3 , n 3 = 19 S(19) = 3, n_{3} = 19 . Next up is n = 34 , 4 n 1 = 135 n = 34, 4n - 1 = 135 with divisor pairs ( 1 , 135 ) , ( 3 , 45 ) , ( 5 , 27 ) (1,135), (3,45), (5,27) and ( 9 , 15 ) (9,15) , giving us S ( 34 ) = 4 , n 4 = 34 S(34) = 4, n_{4} = 34 .

(I'm sure that there is a more elegant way to determine n 3 , n 4 n_{3}, n_{4} rather than going from one integer n n to the next, but factoring successive values 4 n 1 4n - 1 only took a few minutes so the motivation to be more clever wasn't there. That said, the focus for n 3 n_{3} is to find the first n n such that 4 n 1 4n - 1 has 6 6 divisors satisfying the divisor pair difference condition, (DPC), and for n 4 n_{4} to find the first n n such that 4 n 1 4n - 1 has 8 8 divisors again satisfying the DPC.

For example, for n 3 n_{3} we first reach 4 ( 16 ) 1 = 63 = 3 2 7 4(16) - 1 = 63 = 3^{2}*7 , which has 6 6 (positive) divisors, but one of the divisor pairs, namely ( 7 , 9 ) (7,9) , does not satisfy the DPC. With 75 = 3 5 2 75 = 3*5^{2} we have the first value 4 ( 19 ) 1 4(19) - 1 that has 6 6 divisors such that all divisor pairs satisfy the DPC, making n 3 = 19 n_{3} = 19 . With 4 ( 34 ) 1 = 135 = 3 3 5 4(34) - 1 = 135 = 3^{3}*5 we have the first n n such that 4 n 1 4n - 1 has 8 8 positive divisors, and since the associated divisor pairs all satisfy the DPC we need look no further for n 4 n_{4} .)

We thus have k = 0 4 n k = 1 + 2 + 7 + 19 + 34 = 63 \displaystyle\sum_{k=0}^{4} n_{k} = 1 + 2 + 7 + 19 + 34 = \boxed{63} .

(Additional analysis: Curiously, I'm finding that n 5 > n 6 n_{5} \gt n_{6} , with n 5 = 142 n_{5} = 142 and n 6 = 79 n_{6} = 79 .)

We can also solve this problem by treating the given equation as a quadratic in a a and then by making the discriminant perfect square.

But your solution is awesome!(+1)

Harsh Shrivastava - 5 years, 2 months ago

Log in to reply

Thanks! There still hasn't been a successful attempt of this question; I hope that my answer of 63 63 is correct.

Edit: Jon H. has just answered the question, so I'm comfortable now that my answer is correct. :)

Brian Charlesworth - 5 years, 2 months ago

Log in to reply

I found the same solution, and ended up with pretty much the same approach. See my posted solution. A good way to check is to run it through the computer. Here is my code:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
int maxk = 10;
int nk[] = new int[maxk+1];
int found = 0;

for (int i = 0; i <= maxk; i++) nk[i] = 0;

int n = 1;
while (found <= maxk) {
    int S = 0;
    for (int a = 1; ; a++) {
        int y = a*a + a + n;
        int b = a+1;
        if (b*b > y) break;     // a is getting too big
        while (b*b < y) b++;
        if (b*b == y) S++;      // solution found!
    }

    if (S <= maxk && nk[S] == 0) {  // new nk value found
        nk[S] = n;
        System.out.print(S); System.out.print(": "); System.out.println(n); 
        found++;
    }

    n++;
}

Output:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
0: 1
1: 2
2: 7
3: 19
4: 34
6: 79
5: 142
7: 289
9: 394
8: 439
10: 709

(Nicely confirming your observation about n 6 < n 5 n_6 < n_5 ...)

Arjen Vreugdenhil - 5 years, 2 months ago

Log in to reply

@Arjen Vreugdenhil A slight edit allows this program to find all factorizations of 4 n 1 4n-1 . Show here are n [ 4 n 1 ] ( a , b ) [ x y ] n [4n-1]\ \ (a,b)\ [x\star y]\dots

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
1 [3]  (0, 1) [1*3]  
2 [7]  (1, 2) [1*7]  
3 [11]  (2, 3) [1*11]  
4 [15]  (0, 2) [3*5]  (3, 4) [1*15]  
5 [19]  (4, 5) [1*19]  
6 [23]  (5, 6) [1*23]  
7 [27]  (1, 3) [3*9]  (6, 7) [1*27]  
8 [31]  (7, 8) [1*31]  
9 [35]  (0, 3) [5*7]  (8, 9) [1*35]  
10 [39]  (2, 4) [3*13]  (9, 10) [1*39]  
11 [43]  (10, 11) [1*43]  
12 [47]  (11, 12) [1*47]  
13 [51]  (3, 5) [3*17]  (12, 13) [1*51]  
14 [55]  (1, 4) [5*11]  (13, 14) [1*55]  
15 [59]  (14, 15) [1*59]  
16 [63]  (0, 4) [7*9]  (4, 6) [3*21]  (15, 16) [1*63]  
17 [67]  (16, 17) [1*67]  
18 [71]  (17, 18) [1*71]  
19 [75]  (2, 5) [5*15]  (5, 7) [3*25]  (18, 19) [1*75]  
20 [79]  (19, 20) [1*79]  
21 [83]  (20, 21) [1*83]  
22 [87]  (6, 8) [3*29]  (21, 22) [1*87]  
23 [91]  (1, 5) [7*13]  (22, 23) [1*91]  
24 [95]  (3, 6) [5*19]  (23, 24) [1*95]  
25 [99]  (0, 5) [9*11]  (7, 9) [3*33]  (24, 25) [1*99]  
26 [103]  (25, 26) [1*103]  
27 [107]  (26, 27) [1*107]  
28 [111]  (8, 10) [3*37]  (27, 28) [1*111]  
29 [115]  (4, 7) [5*23]  (28, 29) [1*115]  
30 [119]  (2, 6) [7*17]  (29, 30) [1*119]  
31 [123]  (9, 11) [3*41]  (30, 31) [1*123]  
32 [127]  (31, 32) [1*127]  
33 [131]  (32, 33) [1*131]  
34 [135]  (1, 6) [9*15]  (5, 8) [5*27]  (10, 12) [3*45]  (33, 34) [1*135]  
35 [139]  (34, 35) [1*139]  
36 [143]  (0, 6) [11*13]  (35, 36) [1*143]  
37 [147]  (3, 7) [7*21]  (11, 13) [3*49]  (36, 37) [1*147]  
38 [151]  (37, 38) [1*151]  
39 [155]  (6, 9) [5*31]  (38, 39) [1*155]  
40 [159]  (12, 14) [3*53]  (39, 40) [1*159]  
41 [163]  (40, 41) [1*163]  
42 [167]  (41, 42) [1*167]  
43 [171]  (2, 7) [9*19]  (13, 15) [3*57]  (42, 43) [1*171]  
44 [175]  (4, 8) [7*25]  (7, 10) [5*35]  (43, 44) [1*175]  
45 [179]  (44, 45) [1*179]  
46 [183]  (14, 16) [3*61]  (45, 46) [1*183]  
47 [187]  (1, 7) [11*17]  (46, 47) [1*187]  
48 [191]  (47, 48) [1*191]  
49 [195]  (0, 7) [13*15]  (8, 11) [5*39]  (15, 17) [3*65]  (48, 49) [1*195]  
50 [199]  (49, 50) [1*199]  
51 [203]  (5, 9) [7*29]  (50, 51) [1*203]  
52 [207]  (3, 8) [9*23]  (16, 18) [3*69]  (51, 52) [1*207]  
53 [211]  (52, 53) [1*211]  
54 [215]  (9, 12) [5*43]  (53, 54) [1*215]  
55 [219]  (17, 19) [3*73]  (54, 55) [1*219]  
56 [223]  (55, 56) [1*223]  
57 [227]  (56, 57) [1*227]  
58 [231]  (2, 8) [11*21]  (6, 10) [7*33]  (18, 20) [3*77]  (57, 58) [1*231]  
59 [235]  (10, 13) [5*47]  (58, 59) [1*235]  
60 [239]  (59, 60) [1*239]  
61 [243]  (4, 9) [9*27]  (19, 21) [3*81]  (60, 61) [1*243]  
62 [247]  (1, 8) [13*19]  (61, 62) [1*247]  
63 [251]  (62, 63) [1*251]  
64 [255]  (0, 8) [15*17]  (11, 14) [5*51]  (20, 22) [3*85]  (63, 64) [1*255]  
65 [259]  (7, 11) [7*37]  (64, 65) [1*259]  
66 [263]  (65, 66) [1*263]  
67 [267]  (21, 23) [3*89]  (66, 67) [1*267]  
68 [271]  (67, 68) [1*271]  
69 [275]  (3, 9) [11*25]  (12, 15) [5*55]  (68, 69) [1*275]  
70 [279]  (5, 10) [9*31]  (22, 24) [3*93]  (69, 70) [1*279]  
71 [283]  (70, 71) [1*283]  
72 [287]  (8, 12) [7*41]  (71, 72) [1*287]  
73 [291]  (23, 25) [3*97]  (72, 73) [1*291]  
74 [295]  (13, 16) [5*59]  (73, 74) [1*295]  
75 [299]  (2, 9) [13*23]  (74, 75) [1*299]  
76 [303]  (24, 26) [3*101]  (75, 76) [1*303]  
77 [307]  (76, 77) [1*307]  
78 [311]  (77, 78) [1*311]  
79 [315]  (1, 9) [15*21]  (6, 11) [9*35]  (9, 13) [7*45]  (14, 17) [5*63]  (25, 27) [3*105]  (78, 79) [1*315]  
80 [319]  (4, 10) [11*29]  (79, 80) [1*319] 

Arjen Vreugdenhil - 5 years, 2 months ago

@Arjen Vreugdenhil Great! Thanks for writing the program and confirming n 5 n_{5} and n 6 n_{6} . I see that n 9 < n 8 n_{9} \lt n_{8} as well. The sequence { n k } \{n_{k}\} seems to be quite random; I didn't get any hits on OEIS.

Brian Charlesworth - 5 years, 2 months ago

I think n5 is 79

Ahmed Abdelaal - 2 years, 2 months ago

Never mind you’re right

Ahmed Abdelaal - 2 years, 2 months ago

Normally we'd try something like b 2 a 2 = ( b + a ) ( b a ) b^2 - a^2 = (b+a)(b-a) , but here that would leave us with an undesirable term a a . To incorporate it, we complete the square: a 2 + a = ( a + 1 2 ) 2 1 4 a^2 + a = (a+\tfrac12)^2 - \tfrac14 , and so n = b 2 ( a 2 + a ) = b 2 ( a + 1 2 ) 2 + 1 4 4 n 1 = ( 2 b ) 2 ( 2 a + 1 ) 2 . n = b^2 - (a^2 + a) = b^2 - (a+\tfrac12)^2 + \tfrac14\ \ \therefore\ \ 4n-1 = (2b)^2 - (2a+1)^2. We define p = 2 b p = 2b and q = 2 a + 1 q = 2a+1 and so obtain 4 n 1 = p 2 q 2 = ( p q ) ( p + q ) = x y . 4n-1 = p^2 - q^2 = (p-q)(p+q) = xy.

Lemma : For every factorization of the form 4 n 1 = x y 4n-1 = xy , with x < y x < y , the equation is satisfied with ( a , b ) = ( 1 4 ( y x 2 ) , 1 4 ( x + y ) ) (a,b) = (\tfrac14(y-x-2),\tfrac14(x+y)) .

Let's apply this.

  • There is always the trivial factorization with x = 1 x = 1 , y = 4 n 1 y = 4n-1 . This produces the solution ( a , b ) = ( n 1 , n ) (a,b) = (n-1,n) . However, this solution is invalid for n = 1 n = 1 , which corresponds to the factorization 3 = 1 3 3 = 1\cdot 3 . Since there are no other factorizations of 3, we have S ( 1 ) = 0 ; n 0 = 1. S(1) = 0;\ \ n_0 = 1.
  • For all n > 1 n > 1 , if 4 n 1 4n-1 is prime then this trivial solution is the only one, so that S ( n ) = 1 S(n) = 1 in that case. This occurs when n = 2 n = 2 : 7 is prime. Therefore S ( 2 ) = 1 ; n 1 = 2. S(2) = 1;\ \ n_1 = 2.
  • The first non-prime happens at n = 4 n = 4 . But the factorization 15 = 3 5 15 = 3\cdot 5 results in the solution ( a , b ) = ( 0 , 2 ) (a,b) = (0, 2) , which is not valid. Thus S ( 4 ) = 1 S(4) = 1 as well.
  • The next non-prime is when n = 7 n = 7 . The non-trivial factorization 27 = 3 9 27 = 3\cdot 9 gives ( a , b ) = ( 1 , 3 ) (a,b) = (1,3) in addition to the trivial solution ( 6 , 7 ) (6,7) . Therefore S ( 7 ) = 2 ; n 2 = 7. S(7) = 2;\ \ n_2 = 7.
  • Next we look for a value of 4 n 1 4n-1 that can be factored in at least 3 different ways; it must have at least 6 divisors. This happens when n = 16 n = 16 and 4 n 1 = 63 4n-1 = 63 . But one of the three factorizations is 63 = 7 9 63 = 7\cdot 9 , resulting in the invalid solution ( a , b ) = ( 0 , 4 ) (a,b) = (0, 4) . Thus S ( 16 ) = 2 S(16) = 2 and the search continues.
  • We get luckier with n = 19 n = 19 : each of the factorizations 1 75 = 3 25 = 5 15 1\cdot 75 = 3\cdot 25 = 5\cdot 15 produces a valid solution. They are ( a , b ) = ( 18 , 19 ) ; ( 10 , 7 (a,b) = (18,19);\ (10, 7 ;\ (2, 5)). So we have S ( 19 ) = 3 ; n 3 = 19. S(19) = 3;\ \ n_3 = 19.
  • Continuing in search of a number with at least eight divisors, we run into n = 34 n = 34 . The factorizations are 1 135 = 3 45 = 5 27 = 9 15 1\cdot 135 = 3\cdot 45 = 5\cdot 27 = 9\cdot 15 , and the corresponding solutions ( a , b ) = ( 33 , 34 ) ; ( 10 , 12 ) ; ( 5 , 8 ) ; ( 1 , 6 ) (a,b) = (33,34);\ (10,12);\ (5, 8);\ (1,6) . This finally gives S ( 34 ) = 4 ; n 4 = 34. S(34) = 4;\ \ n_4 = 34. To finish up the problem: n k = 1 + 2 + 7 + 19 + 34 = 63 \sum n_k = 1 + 2 + 7 + 19 + 34 = \boxed{63} .

Thanks for posting your solution. As you've mentioned, our approaches are similar, but your presentation is much clearer than mine.

Brian Charlesworth - 5 years, 2 months ago
Davy Ker
Apr 17, 2016

I thought I would share my solution as my method was slightly different to the ones I found here.

Firstly, the solution to this problem (https://brilliant.org/practice/quadratic-diophantine-equations-level-2-3/) tells us that n 0 = 1 n_{0}=1 .

Since a , b > 0 a, b>0 , we know b > a b>a , so b = a + k b=a+k for some positive integer k. I will characterise solutions by this difference, k, considering each possible k and seeing which values of n can have solutions (a,b) with a difference of k.

Substituting b = a + k b=a+k into the equation:

a 2 + a + n = ( a + k ) 2 a^2+a+n=(a+k)^2

a 2 + a + n = a 2 + 2 a k + k 2 a^2+a+n=a^2+2ak+k^2

a ( 1 2 k ) = k 2 n a(1-2k)=k^2-n

a = n k 2 2 k 1 a=\frac{n-k^2}{2k-1}

For this to be a valid solution, we need a to be a positive integer, so we need two things: n k 2 2 k 1 \frac{n-k^2}{2k-1} is an integer, and a 1 a≥1 (given this, it follows that b is also a positive integer and thus (a,b) is a solution)

k = 1 \boxed{k=1}

a = n 1 1 = n 1 1 a=\frac{n-1}{1}=n-1≥1 so n 2 n≥2 . This is always an integer since n is an integer. ( b = n ) (b=n)

So there is a " k = 1 k=1 " solution for n = 2 , 3 , 4 , 5 , . . . n=2,3,4,5,...

k = 2 \boxed{k=2}

a = n 4 3 1 a=\frac{n-4}{3}≥1 so n 7 n≥7 and n is 1 more than a multiple of 3.

So there is a " k = 2 k=2 " solution for n = 7 , 10 , 13 , 16 , . . . n=7,10,13,16,...

k = 3 \boxed{k=3}

a = n 9 5 1 a=\frac{n-9}{5}≥1 so n 14 n≥14 and n is 1 less than a multiple of 5.

So there is a " k = 3 k=3 " solution for n = 14 , 19 , 24 , 29 , . . . , 14 + 5 m , . . . n=14,19,24,29,..., 14+5m,...

Repeating this method tells us:

" k = 4 k=4 " solutions for n = 23 , 30 , 37 , 43 , . . . , 23 + 7 m , . . . n=23,30,37,43,...,23+7m,...

" k = 5 k=5 " solutions for n = 34 , 43 , 52 , 61 , . . . , 34 + 9 m , . . . n=34,43,52,61,...,34+9m,...

" k = 6 k=6 " solutions for n = 47 , 58 , 69 , 80 , . . . , 47 + 11 m , . . . n=47,58,69,80,...,47+11m,...

and in general, for a given k, there is a solution when n = k 2 + m ( 2 k 1 ) n=k^2+m(2k-1) for m = 1 , 2 , 3 , . . . m=1,2,3,...

Shove this in a spreadsheet and do some stuff and you'll find that

n 0 = 1 n_{0}=1

n 1 = 2 n_{1}=2

n 2 = 7 n_{2}=7

n 3 = 19 n_{3}=19

n 4 = 34 n_{4}=34 and hence k = 0 4 n k = 63 \sum_{k=0}^4 n_{k}=\boxed{63}

I'm glad you stopped there, because if you had included n 5 n_{5} , I may have used n 5 = 79 n_{5}=79 when in fact S ( 79 ) = 6 S(79)=6 so n 6 = 79 n_{6}=79 , while n 5 = 142 n_{5}=142

The exact same solution as mine, nice

Matthew Christopher Pohadi - 2 years, 3 months ago
Mark Hennings
Apr 9, 2016

The equation a 2 + a + n = b 2 a^2 +a + n = b^2 can be written 4 n 1 = ( 2 b + 2 a + 1 ) ( 2 b 2 a 1 ) 4n-1 \;=\; (2b + 2a + 1)(2b - 2a -1) Since 4 n 1 4n-1 is never a square, the number of divisors σ 0 ( 4 n 1 ) \sigma_0(4n-1) is even, and any pair of factors 4 n 1 = u v 4n-1\,=\, uv with u > v 1 u > v \ge 1 gives a single solution a , b a,b , except when u = v + 2 u = v+2 , which happens when n n is a perfect square. Thus S ( n ) = { 1 2 σ 0 ( 4 n 1 ) n not a square 1 2 σ 0 ( 4 n 1 ) 1 n a square S(n) \;=\; \left\{ \begin{array}{lll} \tfrac12 \sigma_0(4n-1) & \qquad & n \text{ not a square} \\ \tfrac12\sigma_0(4n-1) - 1 & & n \text{ a square} \end{array} \right. Checking gives S ( 1 ) = 0 S(1)=0 , S ( 2 ) = 1 S(2)=1 , S ( 7 ) = 2 S(7)=2 , S ( 19 ) = 3 S(19)=3 and S ( 34 ) = 4 S(34)=4 are the first occurrences of these values, so the answer is 1 + 2 + 7 + 19 + 34 = 63 1+2+7+19+34=\boxed{63} .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...