OFFSET
1,4
COMMENTS
An isolated totative, k, of n is a positive integer which is less than and coprime to n and is such that neither (k-1) nor (k+1) are coprime to n.
a(2n) = phi(2n), where phi(n) = A000010(n).
If k is an isolated totative so is n-k. - Robert G. Wilson v, Sep 13 2007
a(n)=0 for n's: A061345 "Odd prime powers". - Robert G. Wilson v, Sep 13 2007
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16384
Eric Weisstein's World of Mathematics, Totative.
Antti Karttunen, Data supplement: n, a(n) computed for n = 1..65537
EXAMPLE
The positive integers which are <= 15 and are coprime to 15 are 1,2,4,7,8,11,13,14. Of these, 1 and 2 are adjacent, 7 and 8 are adjacent and 13 and 14 are adjacent. So the isolated totatives of 15 are 4 and 11. There are 2 of these, so a(15) = 2.
MATHEMATICA
fQ[k_, n_] := GCD[k, n] == 1 && GCD[k - 1, n] > 1 && GCD[k + 1, n] > 1; f[n_] := Length@ Select[ Rest[ Range@n - 1], fQ[ #, n] &]; Array[f, 89] (* Robert G. Wilson v *)
PROG
(PARI) A132952(n) = { my(s=0, pg=0, g=1, ng); for(k=1, n-1, if((1!=(ng=gcd(n, k+1)))&&(1==g)&&(1!=pg), s++); pg = g; g = ng); (s); }; \\ Antti Karttunen, Nov 01 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Sep 05 2007
EXTENSIONS
Edited and extended by Robert G. Wilson v, Sep 13 2007
STATUS
approved