login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A071390
Least number m such that sigma(m) - phi(m) = n, or 0 if no such m exists.
3
0, 2, 0, 0, 4, 0, 9, 0, 0, 6, 8, 0, 0, 10, 49, 15, 0, 14, 0, 21, 0, 27, 16, 12, 0, 22, 169, 33, 0, 26, 0, 39, 18, 20, 289, 65, 0, 34, 361, 51, 0, 38, 0, 28, 0, 0, 32, 95, 0, 46, 0, 24, 0, 45, 0, 115, 0, 0, 841, 161, 0, 58, 961, 30, 0, 62, 81, 63, 0, 0, 0, 155, 50, 40, 1369, 217, 0, 74
OFFSET
1,2
COMMENTS
For n <> 2, a(n) < n^2/4. - Robert Israel, Apr 02 2020
LINKS
FORMULA
a(n) = Min{x; A000203(x)-A000010(x)=n} or a(n)=0 if no solution exists.
EXAMPLE
n=255: a(255) = 16129 = 127^2, sigma(16129) = 16257, phi(16129) = 16002, 16257 - 16002 = 255 = n. Squares of primes are often solutions (4, 9, 49, 169, 289, 361, etc.).
MAPLE
N:= 100: # for a(1)..a(N)
V:= Vector(N):
for m from 2 to N^2/4 do
v:= numtheory:-sigma(m)-numtheory:-phi(m);
if v <= N and V[v]=0 then V[v]:= m fi
od:
convert(V, list); # Robert Israel, Apr 02 2020
MATHEMATICA
f[x_] := DivisorSigma[1, x]-EulerPhi[x] t=Table[0, {100}]; Do[c=f[n]; If[c<101&&t[[c]]==0, t[[c]]=n], {n, 1, 1000}]; t
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, May 23 2002
STATUS
approved