The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
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.
LINKS
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
Sequence in context: A327274 A055378 A217921 * A334956 A335881 A239703
KEYWORD
nonn
AUTHOR
Tom Edgar, Apr 25 2016
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 16 16:26 EDT 2024. Contains 372554 sequences. (Running on oeis4.)