Results 1 to 2 of 2

Math Help - may be of number theory...

  1. #1
    Newbie
    Joined
    Apr 2013
    From
    Mumbai
    Posts
    1

    Question may be of number theory...

    A set S contains elements{2^1,2^2,2^3,....,2^9,2^10}.A number 'm' is obtained by adding all possible positive differences of elements of set S.What is the sum of the digits of S ?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member
    Joined
    Dec 2012
    From
    Athens, OH, USA
    Posts
    545
    Thanks
    219

    Re: may be of number theory...

    Hi,
    I assume you want the sum of the (decimal) digits of m. The problem is small enough that I suppose you could do all the computations by hand, but a quick little C program does all the work for you (exact same idea in any language):

    Code:
    #include <stdio.h>
    
    int powers[10];
    int differences[45];
    
    int main(void) {
    	int i,j,k,m,sumOfDigits;
    	powers[0] = 2;
    	for (i=1;i<10;i++) {
    		powers[i]=2*powers[i-1];
    	}
    	k=0;
    	for (i=0;i<10;i++) {
    		for (j=i+1;j<10;j++) {
    			differences[k++]=powers[j]-powers[i];
    		}
    	}
    	m=0;
    	for (i=0;i<45;i++) {
    		m+=differences[i];
    	}
    	printf("The number m is %d\n",m);
    	sumOfDigits=0;
    	while (m!=0) {
    		sumOfDigits+=m%10;
    		m/=10;
    	}
    	printf("The sum of the digits of m is %d\n",sumOfDigits);
    	return(0);
    }
    The output of the program is m = 14362 and the sum of the digits is 16. I don't see any clever way to find these answers except by brute force computation.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Using group theory to prove results in number theory
    Posted in the Math Philosophy Forum
    Replies: 6
    Last Post: May 12th 2012, 01:34 AM
  2. Textbooks on Galois Theory and Algebraic Number Theory
    Posted in the Advanced Algebra Forum
    Replies: 3
    Last Post: July 8th 2011, 06:09 PM
  3. some help with number theory
    Posted in the Number Theory Forum
    Replies: 3
    Last Post: September 11th 2009, 08:01 AM
  4. Replies: 2
    Last Post: December 18th 2008, 05:28 PM
  5. Number theory, prime number
    Posted in the Number Theory Forum
    Replies: 1
    Last Post: September 17th 2006, 08:11 PM

Search Tags


/mathhelpforum @mathhelpforum