Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: [OT] math fulguration

by talexb (Canon)
on Apr 06, 2021 at 13:56 UTC ( #11130894=note: print w/replies, xml ) Need Help??


in reply to [OT] math fulguration

This rule doesn't seem to work for 3^3 which following this equation would be 3^0 + 3^1 + 3^2 + 1 => 14; the correct answer is 27. Yes, it does work for powers of 2.

Update: Oof -- clearly, my reading comprehension sucks. I never did well on exams. :/

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Replies are listed 'Best First'.
Re^2: [OT] math fulguration
by choroba (Archbishop) on Apr 06, 2021 at 14:29 UTC
    I guess the English formula should be fixed with s/ multiplied\K for n-1/ by a-1/, i.e.
    3^3 = 1 + (3 - 1) * (3^0 + 3^1 + 3^2) = 1 + 2 * (1 + 3 + 9) = 1 + 2 * +13 = 1 + 26 = 27
    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

      Yes -- it's missing a 'multiplied by' in exactly the place you're describing.

      Alex / talexb / Toronto

      Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Re^2: [OT] math fulguration
by hippo (Chancellor) on Apr 06, 2021 at 14:26 UTC

    I think you have missed a term. For 33 it should be:

    (3^0 + 3^1 + 3^2) * (3 - 1) + 1 = 27

    HTH.


    🦛

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11130894]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2021-09-24 16:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?