OFFSET
1,2
COMMENTS
The canonical bijection from the positive integers to the positive rational numbers is given by A038568(n)/A038569(n).
Appears to be a variant of A049696. - R. J. Mathar, Feb 11 2012
Apparently numbers m such that A071912(m) = 1. - Bill McEachen, Aug 01 2023
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
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
a(n) = 2*Sum_{k=1..n-1} A000010(k), a(1) = 1. - Robert Israel, Apr 24 2015
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}]];;
Table[a[n], {n, 80}] (* G. C. Greubel, Mar 29 2023 *)
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))
[A206350(n) for n in range(1, 80)] # G. C. Greubel, Mar 29 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Feb 06 2012
STATUS
approved