login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Sum of mass(k/n) for all k, 1 <= k <= n, that are relatively prime to n.
2

%I #26 Dec 13 2024 10:25:21

%S 1,2,6,8,18,12,34,26,42,32,74,36,98,56,80,78,150,64,178,92,140,116,

%T 238,100,238,148,222,160,338,112,374,214,280,220,348,180,486,260,356,

%U 248,562,192,602,316,388,344,682,264,662,328,528,404,810,308,688,424

%N Sum of mass(k/n) for all k, 1 <= k <= n, that are relatively prime to n.

%C The mass of a rational k/n is the sum of the partial quotients in the continued fraction for k/n. Alternatively, it is the number of steps in the "subtractive algorithm" to compute gcd(k,n).

%H Amiram Eldar, <a href="/A360264/b360264.txt">Table of n, a(n) for n = 1..10000</a>

%H Christoph Aistleitner, Bence Borda, and Manuel Hauke, <a href="https://arxiv.org/abs/2210.14095">On the distribution of partial quotients of reduced fractions with fixed denominator</a>, ArXiv preprint arXiv:2210.14095 [math.NT], 2022-2023.

%H Bernhard Liehl, <a href="https://doi.org/10.1007/BF01192762">Über die Teilnenner endlicher Kettenbrüche</a>, Arch. Math. (Basel), 40 (1983), 139-147.

%H A. A. Panov, <a href="https://www.mathnet.ru/php/archive.phtml?wshow=paper&amp;jrnid=mzm&amp;paperid=5989&amp;option_lang=eng">The mean for a sum of elements in a class of finite continued fractions</a> (in Russian), Mat. Zametki 32 (1982), 593-600, 747; <a href="https://doi.org/10.1007/BF01358470">English version</a>, Mathematical Notes of the Academy of Sciences of the USSR 32 (1982), 781-785.

%H Maurice Shrader-Frechette, <a href="https://www.jstor.org/stable/2690435">Modified Farey sequences and continued fractions</a>, Math. Mag., 54 (1981), 60-63.

%F Panov (1982) and Liehl (1983) independently proved that a(n) is asymptotically (6/Pi)^2*n*(log n)^2.

%e For n = 4 the two numbers relatively prime to n are 1 and 3; 1/4 = [0,4] and 3/4 = [0,1,3]. So the sum of all these is a(3) = 8.

%p a:= n-> add(`if`(igcd(n, k)=1, add(i, i=convert(k/n, confrac)), 0), k=1..n):

%p seq(a(n), n=1..60); # _Alois P. Heinz_, Jan 31 2023

%t a[n_] := Total@ Flatten@ (ContinuedFraction[#/n] & /@ Select[Range[n], CoprimeQ[#, n] &]); Array[a, 100] (* _Amiram Eldar_, Dec 13 2024 *)

%Y Cf. A000010, A049835.

%K nonn

%O 1,2

%A _Jeffrey Shallit_, Jan 31 2023