Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: [OT] math fulguration

by talexb (Chancellor)
on Apr 06, 2021 at 13:56 UTC ( [id://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 (Cardinal) 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 (Bishop) 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?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2024-04-19 01:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found