• Re: Add the numbers in a 9x9 multiplication Table

    From David Entwistle@21:1/5 to B. Pym on Mon Jun 9 11:25:49 2025
    On Fri, 6 Jun 2025 15:25:51 -0000 (UTC), B. Pym wrote:

    B. Pym wrote:


    Given the sequence 0, 1, 9, 36, 100, 225, 441... it is possible to
    calculate the polynomial expression for the sum of the entries in a multiplication table of n rows and n columns. 2025 is the 9th entry in
    this sequence as it is the sum for the entries in a 9 x 9 multiplication
    table.

    Can you calculate that function?

    It'd be interesting to see how the various functions perform with respect
    to that polynomial for large n. They may well implement it.

    If you don't know how to proceed, there is a pointer below to the method I
    used (any other methods would be of interest):

    V hfrq gur zrgubq bs svavgr qvssreraprf.



    --
    David Entwistle

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Entwistle@21:1/5 to David Entwistle on Mon Jun 9 15:28:00 2025
    On Mon, 9 Jun 2025 11:25:49 -0000 (UTC), David Entwistle wrote:

    It'd be interesting to see how the various functions perform with
    respect to that polynomial for large n. They may well implement it.

    Unless I've made a mistake, the polynomial indicates the sum of all the
    entries in a 46341 by 46341 multiplication table is 1152866771266955745.
    This is the largest solution that fits in a long variable. The answer is reported in less than 1 ms.
    --
    David Entwistle

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Tobin@21:1/5 to qnivq.ragjvfgyr@ogvagrearg.pbz on Mon Jun 9 16:32:37 2025
    In article <1026gbt$gsd0$1@dont-email.me>,
    David Entwistle <qnivq.ragjvfgyr@ogvagrearg.pbz> wrote:

    Given the sequence 0, 1, 9, 36, 100, 225, 441... it is possible to
    calculate the polynomial expression for the sum of the entries in a >multiplication table of n rows and n columns. 2025 is the 9th entry in
    this sequence as it is the sum for the entries in a 9 x 9 multiplication >table.

    Can you calculate that function?

    sum(x=1..n) sum(y=1..n) [xy]
    = sum(x=1..n) [x sum(y=1..n) y]
    = [sum(x=1..n) x] [sum(y=1..n) y]
    = [sum(x=1..n)]^2

    sum(x=1..n) is well known and easily seen geometrically.

    -- Richard

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Entwistle@21:1/5 to Richard Tobin on Tue Jun 10 06:49:53 2025
    On Mon, 9 Jun 2025 16:32:37 -0000 (UTC), Richard Tobin wrote:

    sum(x=1..n) sum(y=1..n) [xy]
    = sum(x=1..n) [x sum(y=1..n) y]
    = [sum(x=1..n) x] [sum(y=1..n) y]
    = [sum(x=1..n)]^2

    sum(x=1..n) is well known and easily seen geometrically.

    Well blow me down with a feather.

    SPOILER
    POILER
    OILER
    ILER
    LER
    ER
    R

    To calculate the sum of the numbers 1 through n:

    1, 2, 3 ... n-2, n-1, n

    We can write the series in reverse:

    n, n-1, n-2 ... 3, 2, 1

    Adding the two rows together each element provides the same sum, (n+1).
    so:

    2[sum(x=1..n)] = n(n+1)

    and

    [sum(x=1..n)] = n(n+1)/2

    sum(x=1..n) sum(y=1..n) [xy]
    = sum(x=1..n) [x sum(y=1..n) y]
    = [sum(x=1..n) x] [sum(y=1..n) y]
    = [sum(x=1..n)]^2

    The value we are looking for, the sum of the elements in a n x n
    multiplication table, is given by

    [sum(x=1..n)]^2 = [n(n+1)/2]^2

    = (n^4 + 2n^3 + n^2)/4

    Thanks, that's brill.
    --
    David Entwistle

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)