Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 30-07-2008, 07:42 PM   #1 (permalink)
=--=l33t=--=
 
ring_wraith's Avatar
 
Join Date: Oct 2007
Location: In Limbo
Posts: 722
Default Find the Sum of the Digits of 2^1000


215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.

What is the sum of the digits of the number 2^1000?

Ripped off from Project Euler. Any solutions anyone?
__________________
Homer: God bless those pagans.
ring_wraith is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 30-07-2008, 08:05 PM   #2 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: Find the Sum of the Digits of 2^1000

Isn't it straightforward? Or are you looking for non-bruteforce methods. I don't know of a way if so.

Is a nice one-liner in most languages otherwise.

Edit: Guess you are wondering how to store such a large number? Using modulo (10) can help in that case. You need to understand a bit more of multiplication. Else just use BigNum/Etc
__________________
Harsh J
www.harshj.com

Last edited by QwertyManiac; 30-07-2008 at 08:11 PM.
QwertyManiac is offline  
Old 30-07-2008, 08:33 PM   #3 (permalink)
=--=l33t=--=
 
ring_wraith's Avatar
 
Join Date: Oct 2007
Location: In Limbo
Posts: 722
Default Re: Find the Sum of the Digits of 2^1000

Modulo ? Can you elaborate on that?
__________________
Homer: God bless those pagans.
ring_wraith is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
1000+ Proxy's for you hullap Chit-Chat 29 08-02-2010 09:57 PM
want HeadPhones under Rs.1000/- sagardani Mobiles and Tablets 5 18-12-2007 05:19 PM
Rs 1000 for 0.2 GHz? danny_geo QnA (read only) 5 24-11-2004 09:40 AM

 
Latest Threads
- by Sujeet
- by clmlbx
- by Sujeet
- by icebags

Advertisement




All times are GMT +5.5. The time now is 11:08 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2