OFFSET
1,3
COMMENTS
If n is a prime or a power of a prime, a(n) = n-1. Similar to A056737, which does not have the gcd(x,y)=1 condition.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000 (terms 2..10000 from Ivan Neretin)
Antti Karttunen, Data supplement: n, a(n) computed for n = 1..100000
FORMULA
EXAMPLE
a(12) = 1 because of the possible (x,y) pairs, (1,12), (2,6), (3,4), the pair (3,4) yields the minimum difference and satisfies gcd(x,y)=1.
MATHEMATICA
nMax = 100; Table[dvs = Divisors[n]; i = 1; j = 1; While[n/dvs[[i]] > dvs[[i]], If[GCD[n/dvs[[i]], dvs[[i]]] == 1, j = i]; i++ ]; n/dvs[[j]] - dvs[[j]], {n, 2, nMax}]
PROG
(PARI) A076388(n) = fordiv(n, d, if((d>=(n/d)) && 1==gcd(d, n/d), return(d-(n/d)))); \\ Antti Karttunen, Jun 16 2022
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
T. D. Noe, Oct 11 2002
EXTENSIONS
Definition formally changed from x < y to x <= y, to accommodate the prepended term a(1)=0 - Antti Karttunen, Jun 16 2022
STATUS
approved