login
Least k > n such that phi(k) = phi(n), if such k exists; = 0 otherwise.
7

%I #20 Nov 14 2024 05:56:31

%S 2,0,4,6,8,0,9,10,14,12,22,0,21,18,16,20,32,0,27,24,26,0,46,30,33,28,

%T 38,36,58,0,62,34,44,40,39,42,57,54,45,48,55,0,49,50,52,0,94,60,86,66,

%U 64,56,106,0,75,70,63,0,118,0,77,0,74,68,104,0,134,80,92,72,142,78,91

%N Least k > n such that phi(k) = phi(n), if such k exists; = 0 otherwise.

%H Paul Tek, <a href="/A066659/b066659.txt">Table of n, a(n) for n = 1..10000</a>

%H Max Alekseyev, <a href="https://oeis.org/wiki/User:Max_Alekseyev/gpscripts">PARI/GP Scripts for Miscellaneous Math Problems</a> (invphi.gp).

%t Table[k = n + 1; While[And[k <= 2 n + 1, EulerPhi@ k != EulerPhi@ n], k++]; Boole[k < 2 n + 1] k, {n, 73}] (* _Michael De Vlieger_, Dec 31 2016 *)

%o (PARI) a(n) = {my(v = select(x -> x>n, invphi(eulerphi(n)))); if(#v == 0, 0, vecmin(v));} \\ _Amiram Eldar_, Nov 14 2024, using _Max Alekseyev_'s invphi.gp

%Y Cf. A000010, A043343.

%K nonn,changed

%O 1,1

%A _Joseph L. Pe_, Jan 10 2002

%E More terms from _Vladeta Jovovic_, Jan 12 2002

%E Typo in data fixed by _Paul Tek_, Sep 20 2015