On 09/01/2026 11:22, Davide Rotondo wrote:
> A309585
> Numbers k with 4 zeros in a fundamental period of A000129 mod k.
> 5, 13, 25, 29, 37, 53, 61, 65, 101, 109, 125, 137, 145, 149, 157, 169,
> 173, 181, 185, 197, 229, ...
>
> A064848
> Period of the continued fraction for sqrt(2)*n.
> 1, 2, 2, 4, 1, 2, 4, 4, 10, 2, 10, 2, 5, 4, 8, 12, 2, 6, 14, 8, 8, 6,
> 16, 4, 13, 10, 26, 8, 1, 8, 24, 24, 6, 2, 2, 6, 15, 18, 16, 20, 4, 8,
> 30, 6, 10, 16, 28, 8, 36, 22, 2, 20, 19, 30, 10, 12, 14, 2, 14, 8, 25,
> 20, 4, 48, 13, 6, 54, 2, 32, 2, 52, 16, 30, 26, 40, 10, 6, 16, 20, 36,
> 78, 4,...
>
> You can see that the values in the sequence A309585 correspond to
> the n values of A0684848 such that A0684848(n) is odd.
Davide's conjecture is true.
The comments for A309585 say that the sequence also consists of "numbers
k such that A214028(k) is odd", which is to say numbers k such that the
first n for which k | A000129(n) is odd.
In turn, A000129(n) can be described as the denominator of the nth
convergent to the continued fraction of sqrt(2), so (assuming that
comment is correct; it doesn't come with an explanation or a reference)
A309585 consists of numbers k such that the first n for which k divides
the denominator of the n'th convergent to the continued fraction for
sqrt(2) is odd.
So Davide's conjecture is this: let the convergents to the continued
fraction for sqrt(2) be p(n)/q(n); then the first n such that k|q(n) is
odd iff the period of the continued fraction for k.sqrt(2) is odd.
It's also well known that the period of the continued fraction for
sqrt(D) is odd iff the equation x^2-Dy2=-1 has integer solutions. So the
continued fraction for k sqrt(2) has odd period iff x^2-(2k^2)y^2 can be
-1, or equivalently if x^2-2y^2 can be -1 _with y being a multiple of k_.
So Davide's conjecture is this: the first n such that k|q(n) is odd iff
there are solutions to x^2-2y^2=-1 for which k|y.
But now remember the following: if we write (1+sqrt(2))^m =
A(m)+B(m)sqrt(2) then (1) these correspond precisely to the c.f.
convergents for sqrt(2) so A(m)=p(m) and B(m)=q(m), and (2) they also
correspond precisely to the solutions to |x^2-2y^2|=1, and more
specifically A(m)^2-2B(m)^2 is +1 when m is even and -1 when m is odd.
And so we're pretty much done. There are solutions to x^2-2y^2=-1 for
which k|y <=> there are odd m for which k|B(m) <=> the _first_ m for
which k|B(m) is odd <=> the first n for which k|q(n) is odd. The only
thing there that we haven't proved yet is that if _some_ m with k|B(m)
is odd then _the first_ m with k|B(m) is odd. But this is
straightforward because in fact a|b => B(a)|B(b). (A similar
relationship for the Fibonacci numbers is well known, and this one for
the Pell numbers is true for similar reasons.)
--
g