|
|
A206350
|
|
Position of 1/n in the canonical bijection from the positive integers to the positive rational numbers.
|
|
5
|
|
|
1, 2, 4, 8, 12, 20, 24, 36, 44, 56, 64, 84, 92, 116, 128, 144, 160, 192, 204, 240, 256, 280, 300, 344, 360, 400, 424, 460, 484, 540, 556, 616, 648, 688, 720, 768, 792, 864, 900, 948, 980, 1060, 1084, 1168, 1208, 1256, 1300, 1392, 1424, 1508, 1548
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
The canonical bijection from the positive integers to the positive rational numbers is given by A038568(n)/A038569(n).
|
|
LINKS
|
|
|
FORMULA
|
a(1) = 1, a(n+1) = Sum_{k=1..n} mu(k) * floor(n/k) * floor(1 + n/k), where mu(k) is the Moebius function A008683. - Daniel Suteu, May 28 2018
|
|
EXAMPLE
|
The canonical bijection starts with 1/1, 1/2, 2/1, 1/3, 3/1, 2/3, 3/2, 1/4, 4/1, 3/4, 4/3, 1/5, 5/1, so that A206297 starts with 1,3,5,9,13 and this sequence starts with 1,2,4,8,12.
|
|
MAPLE
|
1, op(2*ListTools:-PartialSums(map(numtheory:-phi, [$1..100]))); # Robert Israel, Apr 24 2015
|
|
MATHEMATICA
|
a[n_]:= Module[{s=1, k=2, j=1},
While[s<=n, s= s + 2*EulerPhi[k]; k= k+1];
s = s - 2*EulerPhi[k-1];
While[s<=n, If[GCD[j, k-1] == 1,
s = s+2]; j = j+1];
If[s>n+1, j-1, k-1]];
t = Table[a[n], {n, 0, 3000}]; (* A038568 *)
ReplacePart[Flatten[Position[t, 1]], 1, 1] (* A206350 *)
(* Second program *)
a[n_]:= If[n==1, 1, 2*Sum[EulerPhi[k], {k, n-1}]];;
|
|
PROG
|
(Magma) [1] cat [2*(&+[EulerPhi(k): k in [1..n-1]]): n in [2..80]]; // G. C. Greubel, Mar 29 2023
(SageMath)
def A206350(n): return 1 if (n==1) else 2*sum(euler_phi(k) for k in range(1, n))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|