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

%I #24 Mar 08 2020 11:37:07

%S 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,

%T 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,

%U 2,4,1,3,6,4,6,3,5,2,1,3,1,5,1,1,4,1,2

%N Number of integers 1<=k<=n such that phi(n)=phi(n+k) where phi is Euler's totient function A000010.

%C If n is odd, then phi(n) = phi(2n) so that a(n)>=1.

%C If n is a member of A043343, then a(n)=0.

%C It seems that every nonnegative integer appears in this sequence.

%H Chai Wah Wu, <a href="/A272328/b272328.txt">Table of n, a(n) for n = 1..10000</a>

%e For n=2: phi(2) = 1; whereas phi(2+1) = 2 and phi(2+2) = 2. Thus a(2) = 0.

%e 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.

%t Table[Count[Range@ n, k_ /; EulerPhi@ n == EulerPhi[n + k]], {n, 120}] (* _Michael De Vlieger_, Apr 25 2016 *)

%o (Sage) [sum([1 for k in [1..n] if euler_phi(n)==euler_phi(n+k)]) for n in [1..1000]]

%o (Python)

%o from sympy import totient

%o nmax = 10**4

%o philist = [totient(i) for i in range(1,2*nmax+1)]

%o A272328_list = [philist[i+1:2*(i+1)].count(philist[i]) for i in range(nmax)] # _Chai Wah Wu_, Apr 26 2016

%o (PARI) a(n) = my(x=eulerphi(n)); sum(k=1, n, eulerphi(n+k) == x); \\ _Michel Marcus_, Mar 08 2020

%Y Cf. A043343, A066659, A081373.

%K nonn

%O 1,3

%A _Tom Edgar_, Apr 25 2016

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 April 24 19:06 EDT 2024. Contains 371962 sequences. (Running on oeis4.)