News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Dave's nickname hijacked??

Started by raymond, August 12, 2011, 03:04:56 AM

Previous topic - Next topic

raymond

Just noticed that Dave's nickname dedndave is being used by a new member on Project Euler but with some upper case letters, i.e. DednDave (although his e-mail address is with all lower case letters).

Could it be his cyber twin? :eek :dazzled: :dance:
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

dedndave

no, Raymond
that is me   :P

didn't realize my email was visible - thanks for the heads-up

raymond

I wasn't too sure since upper case letters were being used, and you never use them on this forum.

And don't worry Dave. Your e-mail is NOT visible. Remember I'm one of the admins having access to all the info.
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

dedndave

oohhhhhh
then, you probably saw my first post, too

raymond

As I have replied to someone else on that forum, we are studying various possibilities to open up locked threads for new members. Stay tuned and be patient.
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

dedndave

i was disappointed to see the previous discussion for that particular problem
hopefully, they aren't all like that

MichaelW

What is "that particular problem"?
eschew obfuscation

dedndave

Euler problem #48
QuoteThe series, 11 + 22 + 33 + ... + 1010 = 10405071317.

Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000.

http://projecteuler.net/index.php?section=problems&id=48

once you have provided the correct answer, you are allowed to see the forum for that problem
unfortunately, the discussion spans from 2004 to 2008, when the thread was locked
for the most part, they discussed their favorite languages
and showed how few lines and how short the source text was - lol
i am more interested in methodology than i am in syntax

clive

Well that was straight forward. It just surprised me how many people computed it to full precision, and the level of complexity they used. This would make a great interview question.
It could be a random act of randomness. Those happen a lot as well.

dedndave

it is certainly more efficient to tally only the low 10 digits
however, it is easier to write the code to go full precision
especially in my case, as i already had the bignum exponentiation and integer to ascii routines on hand

this is about all i had to write to get the full string...
loop00: INVOKE  uExpInt,ebx,ebx,offset Accum,sizeof Accum
        add     ecx,7
        shr     ecx,2
        call    AddAcc
        inc     ebx
        cmp     ebx,1000
        jbe     loop00

        INVOKE  uArb2StrL9,offset Result,sizeof Result,offset Buff,sizeof Buff
;
;
;
AddAcc  PROC

        mov     esi,offset Accum
        clc
        mov     edi,offset Result

AddAc0: mov     eax,[esi]
        adc     [edi],eax
        dec     ecx
        lea     esi,[esi+4]
        lea     edi,[edi+4]
        jnz     AddAc0

        ret

AddAcc  ENDP


i think i spent more time calculating how many digits there would be, which took a few minutes - lol

clive

Quote from: dedndave
i think i spent more time calculating how many digits there would be, which took a few minutes - lol

I didn't have a library to hand, so jammed it out in C using 64-bit math, for both the power and accumulation. The assembler version is a bit more bulky, but you're probably hiding behind several hundred lines of library code.

Ok so how many digits would you have with n=10000, the 10 least significant digits should be 6237204500, I think.
It could be a random act of randomness. Those happen a lot as well.

dedndave

i am gonna guess about 30,000 digits   :bg

raymond

1000010000 = (104)10000 = 1040000 = 40000 digits

As a side note, in the post previous to yours, someone also suggested to look into modular exponentiation.

And everything could have been a lot easier (in assembly) if only the last 9 digits had been required. 10-digit remainders don't all fit in 32-bit!
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

clive

Yes, it dawned on me driving about town that 10000 has 4 zeros, so multiplying it 10000 times would be up at 40001 digits.

It was pretty clear 32-bit didn't work, the 64-bit method I used should work for values of n up to 100000000. Or some 800000001 digits
It could be a random act of randomness. Those happen a lot as well.

dedndave

my last ten digits agree with yours, Clive   :bg