Lets say you have a set with all natural numbers until n:
M = { 1 ; 2 ; 3 ; 4 ; ⋯ ; n }
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 }
Now you go through each number of N . When this number appears in M , you have to delete this number from M . For example: 1 2 = 1 and 1 appears in M . So you delete 1 from M . Now M = { 2 ; 3 ; 4 ; ⋯ ; n } (repeat this process for all numbers in N )
S is the sum of all remaining numbers in M . What is S for n = 2 0 1 9 2 .
bonus: generalize S in a formula without sums!
Hint: the result is a 13-digit number. The main part of this problem is to generalize S . Therefor I choose a verry big number for n .
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.
Put simply, the problem wants us to find the sum of all numbers from 1 to 2 0 1 9 2 and then subtract the numbers 1 2 , 2 2 , 3 2 , . . . , 2 0 1 9 2
There are two very famous formulas for these specific operations:
1 + 2 + . . . + n = 2 n ( n + 1 )
1 2 + 2 2 + . . . + n 2 = 6 n ( n + 1 ) ( 2 n + 1 )
So the sum we want is
2 2 0 1 9 2 ( 2 0 1 9 2 + 1 ) − 6 2 0 1 9 ( 2 0 1 9 + 1 ) ( 2 ( 2 0 1 9 ) + 1 ) = 8 3 0 5 6 1 6 1 0 9 8 7 1
This is exactly the same way I did. May be some calculation mistake.
In an sixteenth of a second, Total [ Complement [ Table [ n , { n , 2 0 1 9 2 } ] , Table [ n 2 , { n , 2 0 1 9 } ] ] ] ⇒ 8 3 0 5 6 1 6 1 0 9 8 7 1 , direct computation.
Problem Loading...
Note Loading...
Set Loading...
Lets look at M befor the process: M = { 1 ; 2 ; 3 ; 4 ; ⋯ ; n }
Now look at N befor the process: N = { 1 2 ; 2 2 ; 3 2 ; 4 2 ; ⋯ ; n 2 }
Now you have to delete all numbers from M which appear in N as well. But which numbers appear in N as well?
Imagine this example for n = 1 0 :
M = { 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 ; 1 0 }
N = { 1 2 ; 2 2 ; 3 2 ; 4 2 ; 5 2 ; 6 2 ; 7 2 ; 8 2 ; 9 2 ; 1 0 2 } = { 1 ; 4 ; 9 ; 1 6 ; 2 5 ; 3 6 ; 4 9 ; 6 4 ; 8 1 ; 1 0 0 }
As you can see, all numbers after 3 2 are not in M . So we delete all square numbers from M which are smaller or equal n . We know we have a formula for the first n square numbers (see S N ). But how many squares are less or equal to our n ?
3 2 ≤ 1 0 ≤ 4 2
3 ≤ 1 0 ≤ 4
Thus the number of squares less than or equal to n is the biggest integer, less than or equal to n . This leads us to the definition of the floor function . Thus the sum of all squares less than or equal to n is:
Cancel out all squares, less than or equal to n , from M is the same as subtract S s q u a r e s ≤ n from S M .
This is the generalization of S .
Thus :
S 2 0 1 9 2 = 2 2 0 1 9 2 ⋅ ( 2 0 1 9 2 + 1 ) − 6 ⌊ 2 0 1 9 2 ⌋ ⋅ ( ⌊ 2 0 1 9 2 ⌋ + 1 ) ⋅ ( 2 ⋅ ⌊ 2 0 1 9 2 ⌋ + 1 )
S 2 0 1 9 2 = 2 2 0 1 9 2 ⋅ ( 2 0 1 9 2 + 1 ) − 6 2 0 1 9 ⋅ ( 2 0 1 9 + 1 ) ⋅ ( 2 ⋅ 2 0 1 9 + 1 )
S 2 0 1 9 2 = 2 2 0 1 9 2 ⋅ ( 2 0 1 9 2 + 1 ) − 6 2 0 1 9 ⋅ 2 0 2 0 ⋅ 4 0 3 9
S 2 0 1 9 2 = 8 3 0 5 6 1 6 1 0 9 8 7 1