[seqfan] Re: How to generate A000047?

Richard Mathar mathar at strw.leidenuniv.nl
Mon Jan 19 20:39:16 CET 2009


The key observation is on page 559 of the reference: if we want
to search for the fundamental solutions of u^2-2v^2=n, it is sufficient
so search through the interval v^2 <= n/2. All the other solutions can
then be bootstrapped noting that a fundamental solution to x^2-2y^2=1
is 3+2*sqrt(2)... 
So operationally speaking, one only must figure out whether there is a
fundamental solution or not to create the sequence.
x<=0, y<=0 solutions up to 2^6=64 look as follows

                           "x=", 1, "y=", 0, "n=", 1
                        "log2=", 0, "n=", 1, "s0ls=", 1
                           "x=", 2, "y=", 1, "n=", 2
                        "log2=", 1, "n=", 2, "s0ls=", 2
                           "x=", 2, "y=", 0, "n=", 4
                        "log2=", 2, "n=", 4, "s0ls=", 3
                           "x=", 3, "y=", 1, "n=", 7
                           "x=", 4, "y=", 2, "n=", 8
                        "log2=", 3, "n=", 8, "s0ls=", 5
                           "x=", 3, "y=", 0, "n=", 9
                           "x=", 4, "y=", 1, "n=", 14
                           "x=", 4, "y=", 0, "n=", 16
                        "log2=", 4, "n=", 16, "s0ls=", 8
                           "x=", 5, "y=", 2, "n=", 17
                           "x=", 6, "y=", 3, "n=", 18
                           "x=", 5, "y=", 1, "n=", 23
                           "x=", 5, "y=", 0, "n=", 25
                           "x=", 6, "y=", 2, "n=", 28
                           "x=", 7, "y=", 3, "n=", 31
                           "x=", 8, "y=", 4, "n=", 32
                       "log2=", 5, "n=", 32, "s0ls=", 15
                           "x=", 6, "y=", 1, "n=", 34
                           "x=", 6, "y=", 0, "n=", 36
                           "x=", 7, "y=", 2, "n=", 41
                           "x=", 8, "y=", 3, "n=", 46
                           "x=", 7, "y=", 1, "n=", 47
49 counted twice  by my program , because there are 2 solutions:
                           "x=", 7, "y=", 0, "n=", 49
                           "x=", 9, "y=", 4, "n=", 49
                          "x=", 10, "y=", 5, "n=", 50
                           "x=", 8, "y=", 2, "n=", 56
                           "x=", 8, "y=", 1, "n=", 62
                           "x=", 9, "y=", 3, "n=", 63
                           "x=", 8, "y=", 0, "n=", 64
                       "log2=", 6, "n=", 64, "s0ls=", 27
                                         ^ 26, as in A006982 if n=49 counted only once

Richard J. Mathar, www.strw.leidenuniv.nl/~mathar





More information about the SeqFan mailing list