OFFSET
1,2
COMMENTS
See A074915 for a bound on A048864(x) which allows the establishment of a search range for a(n). - Giovanni Resta, Feb 25 2020
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..10000
Abhijit A J, A. Satyanarayana Reddy, Number of non-primes in the set of units modulo n, arXiv:1907.09908 [math.GM], 2019.
FORMULA
a(n) = min{x; A048864(x)=n}; a(n)=0 if no such number exists.
EXAMPLE
n = 15: RRS(15) = {1,2,4,7,8,11,13,14} of which nonprimes = cRRS(15) = {1,4,8,14}, i.e., 4 terms; 15 is the smallest such number, so a(4) = 15. a(m) = 0 for m = {13, 31, 70, 119, 189, 210, 235, 236}.
MATHEMATICA
f[x_] := EulerPhi[x]-PrimePi[x]+Length[FactorInteger[x]] t=Table[0, {256}]; Do[s=f[n]; If[s<257&&t[[s]]==0, t[[s]]=n], {n, 3, 1000000}]; t
(* Second program: *)
With[{s = Table[Count[Range[n - 1], k_ /; And[CoprimeQ[k, n], ! PrimeQ@ k]], {n, 10^3}]}, Function[{t, u}, Take[#, 63] &@ Join[{1}, Rest@ ReplacePart[t, Map[# -> Lookup[u, #][[1]] &, Rest@ Keys@ u]]]] @@ {ConstantArray[0, Max@ s], KeySort@ PositionIndex@ s}] (* Michael De Vlieger, Jul 30 2017 *)
PROG
(PARI) f(n) = eulerphi(n) - (primepi(n) - omega(n)); \\ A048864
a(n) = {my(k=1); while (f(k) != n, k++); k; } \\ Michel Marcus, Aug 07 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Jun 06 2002
STATUS
approved