login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A272328
Number of integers 1<=k<=n such that phi(n)=phi(n+k) where phi is Euler's totient function A000010.
2
1, 0, 2, 1, 2, 0, 2, 2, 2, 1, 1, 0, 2, 1, 4, 3, 2, 0, 2, 2, 4, 0, 1, 1, 3, 3, 2, 2, 1, 0, 1, 4, 3, 3, 5, 1, 3, 1, 6, 2, 3, 0, 2, 2, 7, 0, 1, 1, 2, 1, 5, 6, 1, 0, 5, 5, 5, 0, 1, 0, 4, 0, 5, 5, 4, 0, 1, 4, 2, 4, 1, 3, 6, 4, 6, 3, 5, 2, 1, 3, 1, 5, 1, 1, 4, 1, 2
OFFSET
1,3
COMMENTS
If n is odd, then phi(n) = phi(2n) so that a(n)>=1.
If n is a member of A043343, then a(n)=0.
It seems that every nonnegative integer appears in this sequence.
EXAMPLE
For n=2: phi(2) = 1; whereas phi(2+1) = 2 and phi(2+2) = 2. Thus a(2) = 0.
For n=5: phi(5) = 4, phi(5+1)=2, phi(5+2)=6, phi(5+3) = 4, phi(5+4) = 6, and phi(5+5) = 4. Since phi(5) = phi(5+3) = phi(5+5), a(5) = 2.
MATHEMATICA
Table[Count[Range@ n, k_ /; EulerPhi@ n == EulerPhi[n + k]], {n, 120}] (* Michael De Vlieger, Apr 25 2016 *)
PROG
(Sage) [sum([1 for k in [1..n] if euler_phi(n)==euler_phi(n+k)]) for n in [1..1000]]
(Python)
from sympy import totient
nmax = 10**4
philist = [totient(i) for i in range(1, 2*nmax+1)]
A272328_list = [philist[i+1:2*(i+1)].count(philist[i]) for i in range(nmax)] # Chai Wah Wu, Apr 26 2016
(PARI) a(n) = my(x=eulerphi(n)); sum(k=1, n, eulerphi(n+k) == x); \\ Michel Marcus, Mar 08 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Tom Edgar, Apr 25 2016
STATUS
approved