OFFSET
2,5
COMMENTS
In the Luca-Walsh paper it is shown that there are infinitely many numbers not in this sequence. See A098047.
a(n)=0 for Fermat primes (A019434). a(n)=1 for safe primes (A005385). a(n)=2 for A090866. The least prime p for which (p-1)/2-phi(p-1)=n or 0 if there is no such prime is given by A134765(n). Sequence A134854(k) gives the least prime for which a(n)=2^(k-1). For k not a power of 2, it can be shown that if k is in this sequence, then it appears for a prime p <= 1+k^2. - T. D. Noe, Nov 13 2007
REFERENCES
J. Browkin and A. Schinzel, On integers not of the form n-phi(n), Colloq. Math., 68 (1995), 55-58.
F. Luca and P. G. Walsh, On the number of nonquadratic residues which are not primitive roots, Colloq. Math., 100 (2004), 91-93.
LINKS
T. D. Noe, Table of n, a(n) for n = 2..10000
FORMULA
MAPLE
A098006 := proc(n)
local p;
p := ithprime(n+1) ;
(p-1)/2-numtheory[phi](p-1) ;
end proc:
seq(A098006(n), n=1..30) ; # R. J. Mathar, Jan 09 2017
MATHEMATICA
Table[(Prime[n] - 1)/2 - EulerPhi[Prime[n] - 1], {n, 2, 85}] (* Robert G. Wilson v, Sep 09 2004 *)
Table[(n-1)/2-EulerPhi[n-1], {n, Prime[Range[2, 100]]}] (* Harvey P. Dale, Oct 23 2016 *)
PROG
(PARI) forprime(p=3, 1e3, print1(p\2-eulerphi(p-1)", ")) \\ Charles R Greathouse IV, Feb 04 2013
(Haskell)
a098006 n = a005097 (n-1) - a000010 (a006093 n)
-- Reinhard Zumkeller, Mar 26 2013
(Magma) [(NthPrime(n)-1)/2 - EulerPhi(NthPrime(n)-1): n in [2..100]]; // Vincenzo Librandi, Jan 10 2017
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
N. J. A. Sloane, Sep 08 2004
STATUS
approved