login
A336344
Number of k's, 1 <= k <= n where gcd(n,k) = 1, such that the continued fraction for n^2/k^2 has twice as many elements as the continued fraction for n/k.
1
0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1, 0, 2, 3, 1, 2, 2, 2, 2, 5, 1, 3, 0, 2, 1, 3, 1, 3, 3, 2, 5, 2, 2, 3, 4, 2, 2, 6, 3, 2, 2, 4, 1, 7, 2, 4, 0, 4, 5, 8, 3, 4, 5, 4, 4, 6, 1, 5, 4, 6, 4, 3, 0, 8, 5, 8, 0, 10, 4, 11, 3, 1, 6, 7, 2, 8, 6, 5, 3, 9, 1, 6, 10, 10, 2, 11, 3, 5, 7, 8, 6, 10, 4, 12, 3, 10, 2
OFFSET
1,13
COMMENTS
Conjecture: a(n) >= 1 for n >= 71.
FORMULA
Conjecture: a(n) << n/log(n).
MATHEMATICA
c[x_] := Length @ ContinuedFraction[x]; a[n_] := Count[Range[n], _?(CoprimeQ[n, #] && c[(n/#)^2] == 2*c[n/#] &)]; Array[a, 100] (* Amiram Eldar, Oct 04 2020 *)
PROG
(PARI) L(n, q)=length(contfrac(n/q));
a(n)=sum(k=1, n, if(L(n, k)*2-L(n^2, k^2), 0, if(gcd(n, k)-1, 0, 1)))
CROSSREFS
Cf. A336090.
Sequence in context: A073200 A307765 A308077 * A352609 A198345 A104416
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Oct 04 2020
STATUS
approved