login
a(n) is the least m such that 2*n*m is a nontotient value; that is, 2*n*a(n) is in A005277.
5

%I #19 Nov 02 2019 06:53:47

%S 7,17,15,19,5,43,1,19,5,17,7,167,1,11,3,19,1,67,1,17,17,7,5,211,1,7,

%T 11,13,3,139,1,31,9,1,5,109,1,1,3,85,3,61,1,11,1,7,1,211,1,11,5,7,3,

%U 31,5,31,1,13,1,353,1,1,9,31,3,71,1,5,3,19,1,317,1,5,3,1,1,31,1,167,7,7,5

%N a(n) is the least m such that 2*n*m is a nontotient value; that is, 2*n*a(n) is in A005277.

%H Amiram Eldar, <a href="/A071615/b071615.txt">Table of n, a(n) for n = 1..10000</a>

%e n=5: number of terms in invphi(10k) is 2,5,2,9,0,9,... for k=1,2,3,...; a(5)=5 because 0 appears at 5th position.

%p with(numtheory); a := proc(n) local m; for m from 1 do if (invphi(2*n*m)=[]) then return m end end end

%t invphi[n_, plist_] := Module[{i, p, e, pe, val}, If[plist=={}, Return[If[n==1, {1}, {}]]]; val={}; p=Last[plist]; For[e=0; pe=1, e==0||Mod[n, (p-1)pe/p]==0, e++; pe*=p, val=Join[val, pe*invphi[If[e==0, n, n*p/pe/(p-1)], Drop[plist, -1]]]]; Sort[val]]; invphi[n_] := invphi[n, Select[1+Divisors[n], PrimeQ]]; a[n_] := For[m=1, True, m++, If[invphi[2n*m]=={}, Return[m]]] (* invphi[n, plist] is list of x with phi(x)=n and all prime divisors of x in plist. *)

%Y Cf. A000010, A005277, A002202, A071616.

%K nonn

%O 1,1

%A _Labos Elemer_, May 27 2002

%E Edited and extended by _Robert G. Wilson v_, May 28 2002

%E Edited and extended by _Dean Hickerson_, Jun 04 2002