• Re: The "Strand" puzzle --- ( Continued Fractions using Lisp or =?UTF-8

    From IlanMayer@21:1/5 to HenHanna on Tue Jul 30 21:38:49 2024
    On Mon, 29 Jul 2024 18:58:21 +0000, HenHanna wrote:



    On 7/26/2024 5:37 AM, IlanMayer wrote:
    On Thu, 25 Jul 2024 19:07:56 +0000, HenHanna wrote:


    e.g. -------- For the (street)  Numbers (1,2,3,4,5,6,7,8)

                             (1,2,3,4,5)  and  (7,8)  both add up to 15.



    “In a given street of houses with consecutive numbers between 50 and
    500, find the house number, for which, the sum of numbers on the left is >>> equal to the sum of numbers on the right”



      Ramanujan and Strand Puzzle

                this was a very interesting puzzle tackled by the genius
    Srinivasa Ramanujan.        In the year 1914, P.C. Mahalanobis, a Kings
    college student in England, got hold of a puzzle from the Strand
    magazine.

    Solution found at:
    https://ubpdqnmathematica.wordpress.com/2021/12/05/ramanujan-and-strand-puzzle/


    thanks!



    So the solutions to the Strand puzzle can be found from the
    continued fraction of \sqrt{2}, which _is_ satisfying simple.


    Using Mathematica to look at the first 10 convergents


    ---------- is this (also) easy to do using Lisp or Python???

    This can be done with Python:

    N = 10
    a = 1
    b = 1
    print(str(a) + "/" + str(b))
    for n in range(N):
    temp = a + 2 * b
    b = a + b
    a = temp
    print(str(a) + "/" + str(b))

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From HenHanna@21:1/5 to IlanMayer on Tue Jul 30 22:27:23 2024
    XPost: sci.lang, sci.math

    On 7/30/2024 2:38 PM, IlanMayer wrote:
    On Mon, 29 Jul 2024 18:58:21 +0000, HenHanna wrote:



    On 7/26/2024 5:37 AM, IlanMayer wrote:
    On Thu, 25 Jul 2024 19:07:56 +0000, HenHanna wrote:


    e.g. -------- For the (street)  Numbers (1,2,3,4,5,6,7,8)

                             (1,2,3,4,5)  and  (7,8)  both add up to 15.



    “In a given street of houses with consecutive numbers between 50 and >>>> 500, find the house number, for which, the sum of numbers on the
    left is
    equal to the sum of numbers on the right”



      Ramanujan and Strand Puzzle

                this was a very interesting puzzle tackled by the genius
    Srinivasa Ramanujan.        In the year 1914, P.C. Mahalanobis, a Kings
    college student in England, got hold of a puzzle from the Strand
    magazine.

    Solution found at:
    https://ubpdqnmathematica.wordpress.com/2021/12/05/ramanujan-and-
    strand-puzzle/


    thanks!



    ;    So the solutions to the Strand puzzle can be found from the
    continued fraction of \sqrt{2}, which  _is_  satisfying simple.


    ;   Using Mathematica to look at the first 10 convergents


    ---------- is this (also) easy to do using Lisp or Python???

    This can be done with Python:

    N = 10
    a = 1
    b = 1
    print(str(a) + "/" + str(b))
    for n in range(N):
       temp = a + 2 * b
       b = a + b
       a = temp
       print(str(a) + "/" + str(b))


    thanks! i've been reading about Ramanujan for 30+ years
    and a few days ago, i watched a clip by Cindy Pom that
    taught me a few new key things... like ...
    He was married to a young girl when he moved to England.

    He didn't want to travel to England because...........

    ______________
    in Ramanujan's 1st letter to Hardy

    1-2+3-4+5-6= ............

    Are there just 4 formulas like this? Or are there dozens more?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Phil Carmody@21:1/5 to IlanMayer on Tue Aug 20 23:30:57 2024
    ilan_no_spew@hotmail.com (IlanMayer) writes:
    On Mon, 29 Jul 2024 18:58:21 +0000, HenHanna wrote:
    On 7/26/2024 5:37 AM, IlanMayer wrote:
    So the solutions to the Strand puzzle can be found from the
    continued fraction of \sqrt{2}, which _is_ satisfying simple.
    Using Mathematica to look at the first 10 convergents

    ---------- is this (also) easy to do using Lisp or Python???

    This can be done with Python:

    N = 10
    a = 1
    b = 1
    print(str(a) + "/" + str(b))
    for n in range(N):
    temp = a + 2 * b
    b = a + b
    a = temp
    print(str(a) + "/" + str(b))

    Let's play golf!

    There's no need for temp:

    b = b + a
    a = 2 * b - a

    Pre:
    $ perl -e '$a=1;$b=1;$n=0;while($n++<10){print("$a/$b\n");$t=$a+2*$b;$b=$a+$b;$a=$t;}'
    1/1
    3/2
    7/5
    17/12
    41/29
    99/70
    239/169
    577/408
    1393/985
    3363/2378

    Post:
    $ perl -e '$a=1;$b=1;$n=0;while($n++<10){print("$a/$b\n");$b+=$a;$a=2*$b-$a;}' 1/1
    3/2
    7/5
    17/12
    41/29
    99/70
    239/169
    577/408
    1393/985
    3363/2378

    Phil
    --
    We are no longer hunters and nomads. No longer awed and frightened, as we have gained some understanding of the world in which we live. As such, we can cast aside childish remnants from the dawn of our civilization.
    -- NotSanguine on SoylentNews, after Eugen Weber in /The Western Tradition/

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