Not a member?

# Discussion Groups | Comp.DSP | numerical challenge, part 2

There are 60 messages in this thread.

You are currently looking at messages 1 to .

Is this discussion worth a thumbs up?

+1

# numerical challenge, part 2 - RichD - 2012-10-30 22:22:00

```I saw this posed as an interview question:

What is the sum of the digits of 3 ^ 1000?

--
Rich
```
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

# Re: numerical challenge, part 2 - William Elliot - 2012-10-30 22:50:00

```On Tue, 30 Oct 2012, RichD wrote:

> What is the sum of the digits of 3 ^ 1000?

The sum of the base 3 digits of 3^1000 is 1.
The sum of the base 9 digits of 3^1000 is 1.

```
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

# Re: numerical challenge, part 2 - Eric Sosman - 2012-10-30 22:55:00

```On 10/30/2012 10:22 PM, RichD wrote:
> I saw this posed as an interview question:
>
> What is the sum of the digits of 3 ^ 1000?

My computer says 2142.

(Maybe they meant to ask a different question?)

--
Eric Sosman
e...@comcast-dot-net.invalid
```
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

# Re: numerical challenge, part 2 - Wally W. - 2012-10-30 23:36:00

```On Tue, 30 Oct 2012 19:22:09 -0700 (PDT), RichD wrote:

>I saw this posed as an interview question:
>
>What is the sum of the digits of 3 ^ 1000?

I'll say 45, summing each occurrence of a unique digit; not the sum of
all occurrences of every digit.

My spreadsheet loses precision after 3^25 = 847288609443.

The sum of the unique digits there is 8+4+7+2+6+0+9+3 = 39

I assume each decimal digit occurs at least once in the long string of
digits for 3^1000.

1+2+3+4+5+6+7+8+9 = 45

Maybe these questioners should team up with the Physics Olympiad
folks. Then they can drive each other crazy with their mind reading
games.

```
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

# Re: numerical challenge, part 2 - Christian Gollwitzer - 2012-10-31 04:32:00

```Am 31.10.12 03:22, schrieb RichD:
> I saw this posed as an interview question:
>
> What is the sum of the digits of 3 ^ 1000?

I think this question is ill-posed. Using a modern computer, you can do
this in milliseconds; just use bc on a Unix box or even wolfram alpha:

http://www.wolframalpha.com/input/?i=sum+of+digits+of+3^1000

Lacking access to a computer, I'm afraid there is no answer besides
doing the power with pen&paper.

But slightly different questions *can* actually be answered easily. For
example

==================================1) what is the *repeated* sum of digits of 3^1000, i.e. sum
the digits
to base ten until you have a single digit?

Answer: 3^1000 = 9^500, i.e. the sum of digits must be divisible by 9,
and therefore the repeated sum is 9

2) What is the last digit of 3^1000?

Answer: multiplying can be done mod 10

3^0 = 1 (mod 10)
3^1 = 3 (mod 10)
3^2 = 9 (mod 10)
3^4 = 7 (mod 10)
3^5 = 1 (mod 10)

We have a cycle of length four, 1,3,9,7. 1000=0(mod4), therefore the
last digit is 1.

3) What is the sum of digits of 3^1000 to base 3?

3^1000 = digit one+1000x digit 0 (base 3)
therefore the sum is 1
======================================
Maybe there exists a shortcut for the original queston, too, but I don't
think so - however, I'm not so strong in number theory to be really sure.

PS: Here is another one:

4) Estimate the sum of digits of 3^1000

Answer: 3^1000 = 10 ^ (log(3)*1000)

log 3 ~0.477, therefore 3^1000 has ~477 digits. The mean value is nery
near to 4.5 (=(1+2+3+4+5+6+7+8+9+0)/10), this means

sum of digits of 3^1000 ~ 4.5*477 = 2146.5

which is astonishingly near to the true answer 2142.

Christian
```
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

# Re: numerical challenge, part 2 - Dave W - 2012-10-31 07:24:00

```On 31 Oct, 02:22, RichD <r_delaney2...@yahoo.com> wrote:
> I saw this posed as an interview question:
>
> What is the sum of the digits of 3 ^ 1000?
>
> --
> Rich

4 if you ignore the ^ symbol.
--
Dave W
```
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

# Re: numerical challenge, part 2 - Wally W. - 2012-10-31 08:12:00

```On Wed, 31 Oct 2012 04:24:16 -0700 (PDT), Dave W wrote:

>On 31 Oct, 02:22, RichD <r_delaney2...@yahoo.com> wrote:
>> I saw this posed as an interview question:
>>
>> What is the sum of the digits of 3 ^ 1000?
>>
>> --
>> Rich
>
>4 if you ignore the ^ symbol.

Clever.

And it seems most plausible, given the probable time constraints and
tools available.

But is that the answer they would want from a product they intend to
deliver to customers?

```
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

# Re: numerical challenge, part 2 - Frnak McKenney - 2012-10-31 08:34:00

```On Tue, 30 Oct 2012 19:22:09 -0700 (PDT), RichD <r...@yahoo.com> wrote:
> I saw this posed as an interview question:
>
> What is the sum of the digits of 3 ^ 1000?

Um... let's see...

perl -e 'print 1000^3;print "\n";'

1003

So the sum is clearly 4.

Frank
--
In America there flourished a ritual or game which popularized the
effort to make "proper" speech available to all.  This was the
spelling bee; and the word "bee" in this sense was appropriately an
Americanism.  In this public ceremony contestants and audience bore
witness that there was no secret about how to speak or write the
most "correct" language of the community and hence that the
linguistic upper class was open to all.
-- Daniel J. Boorstin / The Americans: The Colonial Experience
--
Frank McKenney, McKenney Associates
Richmond, Virginia / (804) 320-4887
Munged E-mail: frank uscore mckenney aatt mindspring ddoott com

```
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

# Re: numerical challenge, part 2 - Eric Jacobsen - 2012-10-31 11:09:00

```On Tue, 30 Oct 2012 19:50:19 -0700, William Elliot <m...@panix.com>
wrote:

>On Tue, 30 Oct 2012, RichD wrote:
>
>> What is the sum of the digits of 3 ^ 1000?
>
>The sum of the base 3 digits of 3^1000 is 1.
>The sum of the base 9 digits of 3^1000 is 1.
>

That's clever.   If I were interviewing, asked this question, and got
this answer I'd be favorably impressed.

Eric Jacobsen
Anchor Hill Communications
http://www.anchorhill.com
```
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

# Re: numerical challenge, part 2 - 2012-10-31 12:27:00

```e...@ieee.org (Eric Jacobsen) writes:
> On Tue, 30 Oct 2012 19:50:19 -0700, William Elliot <m...@panix.com>
> wrote:
>
> >On Tue, 30 Oct 2012, RichD wrote:
> >
> >> What is the sum of the digits of 3 ^ 1000?
> >
> >The sum of the base 3 digits of 3^1000 is 1.

True.

> >The sum of the base 9 digits of 3^1000 is 1.
>
> That's clever.   If I were interviewing, asked this question, and got
> this answer I'd be favorably impressed.

Nope, it's 3.

3^1=3
3^2
3^30
3^40
3^5000
3^6000
3^70000
3^80000
3^1000000
...

Phil
--
Regarding TSA regulations:
How are four small bottles of liquid different from one large bottle?
Because four bottles can hold the components of a binary liquid explosive,
whereas one big bottle can't. -- camperdave responding to MacAndrew on /.
```
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

| 1 | | 3 | 4 | 5 | 6 |