OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..200
Henry L. Alder, A Generalization of the Euler phi-Function, The American Mathematical Monthly, Vol. 65, No. 9 (Nov., 1958), pp. 690-692.
EXAMPLE
phi(9, 2) = phi(10, 2) = 3, thus 9 is in the sequence.
MATHEMATICA
seq = {}; a[n_] := If[Head[r = Reduce[GCD[x, n] == 1 && GCD[x + 2, n] == 1 && 1 <= x <= n, x, Integers]] === Or, Length[r], 1]; a0 = a[1]; Do[
a1 = a[k + 1]; If[a1 == a0, AppendTo[seq, k]]; a0 = a1, {k, 1, 1000}]; seq (* after Jean-François Alcover at A002472 *)
PROG
(PARI) f(n) = sum(x=1, n, (gcd(n, x) == 1) && (gcd(n, x+2) == 1));
isok(n) = f(n) == f(n+1); \\ Michel Marcus, Apr 09 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Amiram Eldar, Mar 28 2018
EXTENSIONS
a(20)-a(29) from Robert Price, May 18 2018
More terms from Amiram Eldar, Mar 26 2023
STATUS
approved