Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

[OT] math fulguration

by Discipulus (Canon)
on Apr 06, 2021 at 13:40 UTC ( [id://11130893]=perlquestion: print w/replies, xml ) Need Help??

Discipulus has asked for the wisdom of the Perl Monks concerning the following question:

Hello folks!

I had a mathematical fulguration (is rare because I have troubles with two digits divisions..) and I'd like to know if this is a known fact. In English it goes like:

> The n power of a number a is equal to 1 plus the summation from a**n-1 to a**0 multiplied by n-1

I'm not able to draw it in nice math signs, but in perl is like:

perl -E "map{ $sigma += $ARGV[0]**$_ }0..$ARGV[1]-1; say 'true' if $AR +GV[0]**$ARGV[1] == 1+( $sigma * ($ARGV[0]-1))"

In the chat choroba was so kind to prove it mathematically (I leave to him the right to point to that ;)

I proved empirically and works also for powers of 2 (which I already known the formula and in my case becomes a reduced form as it implies * 1 ) and for powers of 1 where it implies * 0

It also works for n**1 and n**0 so it seems a nice generalisation.

Incidentally, there is a nicer way to do the above Σ in perl?

Does some mathematician knows if the above fulguration I had is a known fact?

L*

PS fixed English formula using choroba fix below

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re: [OT] math fulguration
by salva (Canon) on Apr 06, 2021 at 14:27 UTC
    Does some mathematician knows if the above fulguration I had is a known fact?

    Yeah, fortunately! That succession of powers is the base of the positional notation used to represent numbers!

    So, what do you get when you subtract 1 to a power or 10? a string of nines. What do you get when you do the same to a power of 16 in hexadecimal? a string of F's. What do you get when you subtract one to a power of 2 in binary? a string of ones.

    For instance:

    9000 = 9 * 1000 = (10 - 1) * 10 ** 3 900 = 9 * 100 = (10 - 1) * 10 ** 2 90 = 9 * 10 = (10 - 1) * 10 ** 1 + 9 = 9 * 1 = (10 - 1) * 10 ** 0 ----- 9999 = 9 * 1111 = (10 - 1) * 1111 9999 + 1 ----- 10000 = 10 ** 4
Re: [OT] math fulguration
by choroba (Cardinal) on Apr 06, 2021 at 13:56 UTC
    Use List::Util::sum for summation:
    #! /usr/bin/perl use warnings; use strict; use feature qw{ say }; use List::Util qw{ sum }; for my $A (2..20) { for my $n (1..10) { die "$A, $n\n" unless $A ** $n == 1 + ($A - 1) * sum(map $A ** $_, 0 .. $ +n - 1) } }

    The proof can be compiled in TeX:

    \documentclass{article} \title{Summation Fulguration} \newtheorem{thm}{Theorem} \newtheorem{prf}{Proof}[thm] \begin{document} \begin{thm} $$a^n = 1 + (a - 1) \sum_{i=0}^{n-1} a^i$$ \end{thm} \begin{prf} $$1 + (a - 1) \sum_{i=0}^{n-1} a^i$$ $$= 1 + \sum_{i=0}^{n-1}(a-1)a^i$$ $$= 1 + \sum_{i=0}^{n-1} a^{i+1} - a^i$$ $$= 1 + \sum_{i=0}^{n-1}a^{i+1} - \sum_{i=0}^{n-1}a^i$$ $$= 1 + (\sum_{i=1}^{n-1}a^i) + a^n - (a^0 + \sum_{i=1}^{n-1}a^i)$$ $$= 1 + (\sum_{i=1}^{n-1}a^i) + a^n - a^0 - \sum_{i=1}^{n-1}a^i$$ $$= 1 + a^n - a^0$$ $$= 1 + a^n - 1$$ $$= a^n$$ Q.E.D. \end{prf} \end{document}

    The result can be checked here.

    I have no idea how broadly it is known.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
      > I have no idea how broadly it is known.

      Pretty much, what Salva pointed out is discussed at university in CS in the context of numeral systems to basis n, before introducing binary system.

      By intuition I'd say it's also connected to some school math, like the theorem that every periodic fraction can be expressed in the form of

      n+(m/9...9) with n,m in N

      like

      DB<3> p 3+7834/9999 3.78347834783478

      This works in any number system.

      What I learned was the word "fulguration". ;-)

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

        ... learned ... the word "fulguration".

        Related: fulgurite. Also: Is there a link to a definition of "fulguration" in a mathematical context? I seem to see it only in the medical context of "radiofrequency ablation" or coagulation.


        Give a man a fish:  <%-{-{-{-<

        "fulguration"

        I don't recall that word at all from any crufty discussion in number theory or logic design with the faculties of a handful of american universities where I might have been a fly on the wall. Others' mileage may vary. The usage that is common for us of a certain age is the one that is a synonym for 'ablation'.

Re: [OT] math fulguration
by jo37 (Deacon) on Apr 06, 2021 at 14:35 UTC

    This is a slight modification of the well known binomial formula

    x^n - 1 = (x - 1) * (x^(n-1) + x^(n-2) + ... + 1)

    Greetings,
    -jo

    $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$
Re: [OT] math fulguration
by duelafn (Parson) on Apr 07, 2021 at 12:22 UTC

    Yes, as jo37 said, it is known, though they meant geometric series – the binomial formula would have binomial coefficients.

    Note: The wikipedia formula is a more general form and written a different way. Divide out the "a" then note that (1-xⁿ)/(1-x) = (xⁿ-1)/(x-1). Then solve for xⁿ.

    Good Day,
        Dean

      though they meant geometric series

      Maybe that has a cultural aspect. Here in Germany the equation x² - y² = (x - y)(x + y) is known as the "third binomial formula" with a generalization to the n-th power as cited.

      Greetings,
      -jo

      $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$
Re: [OT] math fulguration
by talexb (Chancellor) on Apr 06, 2021 at 13:56 UTC

    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.

      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.

      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: perlquestion [id://11130893]
Approved by haukex
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-03-28 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found