 more useful options PerlMonks

Re: [OT] math fulguration

by talexb (Chancellor)
 on Apr 06, 2021 at 13:56 UTC 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}[\*||{},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.

🦛

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 chilling in the Monastery: (6)
As of 2022-01-25 14:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
In 2022, my preferred method to securely store passwords is:

Results (66 votes). Check out past polls.

Notices?