Easy solution
1. Convert numbers to base 10
2. Add
3. Convert result to base n
To add without converting, follow these steps Adding 2 Numbers in a Different Base:
A. Adding numbers in a different base is similar to adding numbers in base 10.
1. Add the one's digits first like you would in base 10.
2. If the number is less than the base, write it down. If the number is greater than
or equal to the base, you must carry. So find the remainder after dividing by
the base and write it down (i.e. n MOD b) and to find the number you should
carry, find out how many times b will go into n (i.e. n DIV b).
3. Continue adding the next digits as described in step 2 until all numbers are
added. Don't forget to add in any carried numbers.
4. Note: You must add the digits from the right to left. In other words, add the
ones digit first, followed by the tens digit, and so on.
Ex [1] 143
5
+ 41
5
=_________
5
.
a. 3 + 1 = 4. Since 4 is less than 5, write it down.
b. 4 + 4 = 8. Since 8 is greater than 5, we must carry. 8 Mod 5 = 3.
Write down 3. 8 DIV 5 = 1. Carry the *1.
c. 1 + *1 = 2. Since 2 is less than 5, write it down.
d. The answer is 234.
Ex [2] 222
3
+ 121
3
+ 220
3
=________
3
.
a. 2 + 1 + 0 = 3. Since 3 is equal to 3, we must carry. 3 MOD 3 = 0.
Write this down. 3 DIV 3 = 1. Carry *1.
b. 2 + 2 + 2 = 6 + *1 = 7. Since 7 is greater than 3, we must carry.
7 MOD 3 = 1. Write down 1. 7 DIV 3 = 2. Carry *2.
c. 2 + 1 + 2 = 5 + *2 = 7. Since 7 is greater than 3, we must carry.
7 MOD 3 = 1. Write down 1. 7 DIV 3 = 2. Since there are no
more numbers we can just write down 2.
d. The answer is 2110.
Both base 16 and base 2 number systems use binary numbers (1 and 0) to write out and define decimal numbers.
Oh, what a lovely question! To compute the sum of the squares of N numbers, you can create a simple algorithm. Start by initializing a variable to hold the sum, then loop through each number, square it, and add it to the sum. Once you've done this for all N numbers, you'll have the sum of their squares. Just like painting a happy little tree, take your time and enjoy the process.
#include<stdio.h> main(void) { int n; int i; printf("Type n: "); scanf("%d",&n); for(i=1;i<=n;i++) //generates natural numbers from 1,....,n. printf("%d\n",i); //prints these numbers to standard output }
Sum = n/2[2Xa1+(n-1)d] where n is last number, a1 is the first number & d is the common difference between the numbers, here d=2 for the even /odd numbers. Sum = n/2 [2Xa1+(n-1)2]
int sum = 0; int i; for(i = 0; i < n; ++i) { sum += i; }
Add any two numbers that add to 1134 or 7734. So pick any number, say n. Calculate the second number as 1134 - n or 7734 - n. Add these two.
To find the perimeter of the base, you must add all the numbers on the base together!
Sum of first n numbers = n/2(n +1) = 500 x 1001 = 500500
EVERY three consecutive numbers add to a multiple of 3: Proof: numbers are n, n + 1 and n + 2. The total is 3n + 3 or 3(n + 1) This means that for any three consecutive numbers, the total is 3 times the middle number.
Let the consecutive numbers be n,n+1, n+2, n+3, & n+ 4. Add n + (n+1)+(n+2) + (n + 3) + ( n + 4) = 115 5n + 10 = 115 5n = 105 n = 21 N+1 = 22 n+2 = 23 n+3 = 24 n + 4 = 25 So the five consecutive numbers are 21,22,23,24 & 25.
Pick a number. Add or subtract 1 to or from it.
Let the odd numbers be n-4, n- 2, n, n + 2 , n + 4 Hence summing. (n - 4) + (n - 2) + n + ( n + 2) + (n + 4) = 235 5n = 235 (NB The constants add to zero) n = 235/ 5 n = 47 Hence the other four odd numbers are, 43,45,49,51
5050 To add all numbers from 1 to n: (n/2)(n + 1), in this case n = 100 so it is 50 x 101...
28
If the base numbers or variables are the same, you add the exponents.
-49
-73