OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..82
FORMULA
a(n) = Min{x; A077099(x) = n}.
EXAMPLE
For n = 10, a(10) = 328, sigma(328) = 630, phi(328) = 160, sigma(328) + phi(328) = 790, sigma(328) - phi(328) = 470, GCD(790,470) = 10.
For n = odd number, a(n) should be either a square or twice a square and so faster search for large values is possible, like e.g., for n = 97: a(97) = 435979^2 is the smallest solution.
MATHEMATICA
f[x_] := Apply[GCD, {DivisorSigma[1, x]+EulerPhi[x], DivisorSigma[1, x]-EulerPhi[x]}]; t=Table[0, {100}]; Do[s=f[n]; If[s<101&&t[[s]]==0, t[[s]]=n], {n, 1, 10^13}]; t
PROG
(PARI) lista(len) = {my(v = vector(len), c = 0, k = 1, a, b, i); while(c < len, f = factor(k); a = sigma(f); b = eulerphi(f); i = gcd(a+b, a-b); if(i <= len && v[i] == 0, c++; v[i] = k); k++); v; } \\ Amiram Eldar, Nov 14 2024
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Labos Elemer, Nov 12 2002
STATUS
approved