[go: up one dir, main page]

login
A073461
Largest solution to phi(x) - pi(x) = n or 0 if no such solution exists.
4
30, 60, 90, 84, 210, 78, 72, 150, 126, 180, 132, 80, 168, 138, 240, 68, 330, 420, 174, 162, 300, 390, 92, 234, 294, 228, 360, 222, 116, 246, 118, 336, 630, 510, 312, 450, 378, 288, 480, 280, 318, 77, 660, 260, 324, 396, 546, 540, 840, 372, 504, 408, 350, 600
OFFSET
-2,1
COMMENTS
Although pi takes all values, solutions are not guaranteed since nontotient numbers exist.
a(63) does not exist since by bounds on phi and pi, phi(x) - pi(x) > 129 > 63 for x > 2000 and no smaller x yields a difference of 63. [Charles R Greathouse IV, Oct 31 2011]
FORMULA
a(n) = Max{x: A000010(x) - A000720(x) = n}
EXAMPLE
n=92: phi(92)=44, pi(92)=24, a(44-24)=a(20)=92; n=63: no solution was found at x<=1000000.
a(-2) = 30, since phi(30) - pi(30) = 8 - 10 = -2.
MATHEMATICA
Function[s, Function[t, Take[#, 54] &@ ReplacePart[t, Map[# + 3 -> Lookup[s, #][[-1]] &, Keys@ s]]]@ ConstantArray[0, Max@ Keys@ s + 3]]@ KeySort@ PositionIndex@ Array[EulerPhi@ # - PrimePi@ # &, 10^5] (* Michael De Vlieger, Jul 20 2017 *)
KEYWORD
nonn
AUTHOR
Labos Elemer, Aug 02 2002
EXTENSIONS
a(-2) added by Michael De Vlieger, Jul 21 2017
STATUS
approved