A set of square numbers

Algebra Level 3

Lets say you have a set with all natural numbers until n:

M = { 1 ; 2 ; 3 ; 4 ; ; n } M = \left\{1; 2; 3; 4; \cdots; n \right\}

Lets say you have another set with the squares of all natural numbers until n:

N = { 1 2 ; 2 2 ; 3 2 ; 4 2 ; ; n 2 } N = \left\{ { 1 }^{ 2 }; { 2 }^{ 2 }; { 3 }^{ 2 }; { 4 }^{ 2 }; \cdots ; { n }^{ 2 } \right\}

Now you go through each number of N N . When this number appears in M M , you have to delete this number from M M . For example: 1 2 = 1 { 1 }^{ 2 }=1 and 1 1 appears in M M . So you delete 1 1 from M M . Now M = { 2 ; 3 ; 4 ; ; n } M = \left\{2; 3; 4; \cdots; n \right\} (repeat this process for all numbers in N N )

S S is the sum of all remaining numbers in M M . What is S S for n = 2019 2 n = { 2019 }^{ 2 } .

bonus: generalize S S in a formula without sums!

Hint: the result is a 13-digit number. The main part of this problem is to generalize S S . Therefor I choose a verry big number for n n .


The answer is 8305616109871.

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.

3 solutions

CodeCrafter 1
Apr 7, 2019

Lets look at M M befor the process: M = { 1 ; 2 ; 3 ; 4 ; ; n } M = \left\{1; 2; 3; 4; \cdots; n \right\}

Thus S M = i = 1 n i = n ( n + 1 ) 2 { S }_{ M} =\sum _{ i=1 }^{ n }{ i } =\frac { n\cdot \left( n+1 \right) }{ 2 }

Now look at N N befor the process: N = { 1 2 ; 2 2 ; 3 2 ; 4 2 ; ; n 2 } N = \left\{ { 1 }^{ 2 }; { 2 }^{ 2 }; { 3 }^{ 2 }; { 4 }^{ 2 }; \cdots ; { n }^{ 2 } \right\}

Thus S N = i = 1 n i 2 = n ( n + 1 ) ( 2 n + 1 ) 6 { S }_{ N }=\sum _{ i=1 }^{ n }{ { i }^{ 2 } } =\frac { n\cdot \left( n+1 \right) \cdot \left( 2\cdot n+1 \right) }{ 6 }

Now you have to delete all numbers from M M which appear in N N as well. But which numbers appear in N N as well?

Imagine this example for n = 10 n=10 :

M = { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 ; 10 } M = \left\{1; 2; 3; 4; 5; 6; 7; 8; 9; 10 \right\}

N = { 1 2 ; 2 2 ; 3 2 ; 4 2 ; 5 2 ; 6 2 ; 7 2 ; 8 2 ; 9 2 ; 10 2 } = { 1 ; 4 ; 9 ; 16 ; 25 ; 36 ; 49 ; 64 ; 81 ; 100 } N=\left\{ { 1 }^{ 2 }; { 2 }^{ 2 }; { 3 }^{ 2 }; { 4 }^{ 2 }; { 5 }^{ 2 }; { 6 }^{ 2 }; { 7 }^{ 2 }; { 8 }^{ 2 }; { 9 }^{ 2 }; { 10 }^{ 2 } \right\} =\left\{ 1; 4; 9; 16; 25; 36; 49; 64; 81; 100 \right\}

As you can see, all numbers after 3 2 {3}^{2} are not in M M . So we delete all square numbers from M M which are smaller or equal n n . We know we have a formula for the first n n square numbers (see S N { S }_{ N } ). But how many squares are less or equal to our n n ?

3 2 10 4 2 { 3 }^{ 2 }\le 10\le { 4 }^{ 2 }

3 10 4 { 3 }\le \sqrt { 10 } \le { 4 }

Thus the number of squares less than or equal to n n is the biggest integer, less than or equal to n \sqrt { n } . This leads us to the definition of the floor function . Thus the sum of all squares less than or equal to n n is:

S s q u a r e s n = i = 1 n i 2 = n ( n + 1 ) ( 2 n + 1 ) 6 { S }_{ squares\le n } = \sum _{ i=1 }^{ \left\lfloor \sqrt { n } \right\rfloor }{ { i }^{ 2 } } =\frac { \left\lfloor \sqrt { n } \right\rfloor \cdot \left( \left\lfloor \sqrt { n } \right\rfloor +1 \right) \cdot \left( 2\cdot \left\lfloor \sqrt { n } \right\rfloor +1 \right) }{ 6 }

Cancel out all squares, less than or equal to n n , from M M is the same as subtract S s q u a r e s n { S }_{ squares\le n } from S M { S }_{ M} .

S a f t e r P r o c e s s = S M S s q u a r e s n = i = 1 n i i = 1 n i 2 = n ( n + 1 ) 2 n ( n + 1 ) ( 2 n + 1 ) 6 {S}_{afterProcess} = { S }_{ M} - { S }_{ squares\le n } =\sum _{ i=1 }^{ n }{ i } - \sum _{ i=1 }^{ \left\lfloor \sqrt { n } \right\rfloor }{ { i }^{ 2 } } = \frac { n\cdot \left( n+1 \right) }{ 2 } - \frac { \left\lfloor \sqrt { n } \right\rfloor \cdot \left( \left\lfloor \sqrt { n } \right\rfloor +1 \right) \cdot \left( 2\cdot \left\lfloor \sqrt { n } \right\rfloor +1 \right) }{ 6 }

This is the generalization of S S .

Thus :

S 2019 2 = 2019 2 ( 2019 2 + 1 ) 2 2019 2 ( 2019 2 + 1 ) ( 2 2019 2 + 1 ) 6 { S }_{ { 2019 }^{ 2 } }=\frac { { 2019 }^{ 2 }\cdot \left( { 2019 }^{ 2 }+1 \right) }{ 2 } -\frac { \left\lfloor \sqrt { { 2019 }^{ 2 } } \right\rfloor \cdot \left( \left\lfloor \sqrt { { 2019 }^{ 2 } } \right\rfloor +1 \right) \cdot \left( 2\cdot \left\lfloor \sqrt { { 2019 }^{ 2 } } \right\rfloor +1 \right) }{ 6 }

S 2019 2 = 2019 2 ( 2019 2 + 1 ) 2 2019 ( 2019 + 1 ) ( 2 2019 + 1 ) 6 { S }_{ { 2019 }^{ 2 } }=\frac { { 2019 }^{ 2 }\cdot \left( { 2019 }^{ 2 }+1 \right) }{ 2 } -\frac { 2019\cdot \left( 2019+1 \right) \cdot \left( 2\cdot 2019+1 \right) }{ 6 }

S 2019 2 = 2019 2 ( 2019 2 + 1 ) 2 2019 2020 4039 6 { S }_{ { 2019 }^{ 2 } }=\frac { { 2019 }^{ 2 }\cdot \left( { 2019 }^{ 2 }+1 \right) }{ 2 } -\frac { 2019\cdot 2020\cdot 4039 }{ 6 }

S 2019 2 = 8305616109871 { S }_{ { 2019 }^{ 2 } }=8305616109871

Vedant Saini
Apr 7, 2019

Put simply, the problem wants us to find the sum of all numbers from 1 1 to 201 9 2 2019^2 and then subtract the numbers 1 2 , 2 2 , 3 2 , . . . , 201 9 2 1^2, 2^2, 3^2, ..., 2019^2

There are two very famous formulas for these specific operations:

1 + 2 + . . . + n = n ( n + 1 ) 2 1 + 2 + ... + n = \dfrac{n(n+1)}{2}

1 2 + 2 2 + . . . + n 2 = n ( n + 1 ) ( 2 n + 1 ) 6 1^2 + 2^2 + ... + n^2 = \dfrac{n(n + 1)(2n + 1)}{6}

So the sum we want is

201 9 2 ( 201 9 2 + 1 ) 2 2019 ( 2019 + 1 ) ( 2 ( 2019 ) + 1 ) 6 = 8305616109871 \dfrac{2019^2(2019^2+1)}{2} - \dfrac{2019(2019 + 1)(2(2019) + 1)}{6} = 8305616109871

This is exactly the same way I did. May be some calculation mistake.

A Former Brilliant Member - 2 years, 2 months ago

In an sixteenth of a second, Total [ Complement [ Table [ n , { n , 201 9 2 } ] , Table [ n 2 , { n , 2019 } ] ] ] 8305616109871 \text{Total}\left[\text{Complement}\left[\text{Table}\left[n,\left\{n,2019^2\right\}\right],\text{Table}\left[n^2,\{n,2019\}\right]\right]\right] \Rightarrow 8305616109871 , direct computation.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...