This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A098006 #21 Feb 16 2022 23:22:02 %S A098006 0,0,1,1,2,0,3,1,2,7,6,4,9,1,2,1,14,13,11,12,15,1,4,16,10,19,1,18,8, %T A098006 27,17,4,25,2,35,30,27,1,2,1,42,23,32,14,39,57,39,1,42,4,23,56,25,0,1, %U A098006 2,63,50,44,49,2,57,35,60,2,85,72,1,62,16,1,63,66,81,1,2,78,40,76,29,114,47 %N A098006 (p-1)/2 - phi(p-1) as p runs through the odd primes. %C A098006 In the Luca-Walsh paper it is shown that there are infinitely many numbers not in this sequence. See A098047. %C A098006 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 %D A098006 J. Browkin and A. Schinzel, On integers not of the form n-phi(n), Colloq. Math., 68 (1995), 55-58. %D A098006 F. Luca and P. G. Walsh, On the number of nonquadratic residues which are not primitive roots, Colloq. Math., 100 (2004), 91-93. %H A098006 T. D. Noe, <a href="/A098006/b098006.txt">Table of n, a(n) for n = 2..10000</a> %H A098006 T. D. Noe, <a href="http://www.sspectra.com/math/A098006.pdf">Finding primes p for which (p-1)/2 - phi(p-1) = k</a> %F A098006 a(n) = A005097(n-1) - A000010(A006093(n)); a(A159611(n)) = 0. - _Reinhard Zumkeller_, Mar 26 2013 %p A098006 A098006 := proc(n) %p A098006 local p; %p A098006 p := ithprime(n+1) ; %p A098006 (p-1)/2-numtheory[phi](p-1) ; %p A098006 end proc: %p A098006 seq(A098006(n),n=1..30) ; # _R. J. Mathar_, Jan 09 2017 %t A098006 Table[(Prime[n] - 1)/2 - EulerPhi[Prime[n] - 1], {n, 2, 85}] (* _Robert G. Wilson v_, Sep 09 2004 *) %t A098006 Table[(n-1)/2-EulerPhi[n-1],{n,Prime[Range[2,100]]}] (* _Harvey P. Dale_, Oct 23 2016 *) %o A098006 (PARI) forprime(p=3,1e3,print1(p\2-eulerphi(p-1)", ")) \\ _Charles R Greathouse IV_, Feb 04 2013 %o A098006 (Haskell) %o A098006 a098006 n = a005097 (n-1) - a000010 (a006093 n) %o A098006 -- _Reinhard Zumkeller_, Mar 26 2013 %o A098006 (Magma) [(NthPrime(n)-1)/2 - EulerPhi(NthPrime(n)-1): n in [2..100]]; // _Vincenzo Librandi_, Jan 10 2017 %Y A098006 Cf. A000010, A051953, A098047, A176095 (p runs through the odd numbers). %K A098006 nonn,nice %O A098006 2,5 %A A098006 _N. J. A. Sloane_, Sep 08 2004