A219792 Least k such that phi(k) = lambda(n), or 0 if there is no such k.
1, 1, 3, 3, 5, 3, 7, 3, 7, 5, 11, 3, 13, 7, 5, 5, 17, 7, 19, 5, 7, 11, 23, 3, 25, 13, 19, 7, 29, 5, 31, 15, 11, 17, 13, 7, 37, 19, 13, 5, 41, 7, 43, 11, 13, 23, 47, 5, 43, 25, 17, 13, 53, 19, 25, 7, 19, 29, 59, 5, 61, 31, 7, 17, 13, 11, 67, 17, 23, 13, 71, 7
Offset: 1
Keywords
Examples
a(6) = 3 because phi(3) = lambda(6) = 2.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..16384
Programs
-
Maple
with(numtheory): for n from 1 to 100 do: ii:=0:for k from 1 to 10^6 while(ii=0) do:if phi(k)=lambda(n) then ii:=1: printf(`%d, `,k):else fi:od:if ii=0 then printf(`%d, `,0): else fi:od:
-
Mathematica
Table[k=0;While[!EulerPhi[k]==CarmichaelLambda[n],k++];k,{n,100}] Join[{1},Module[{nn=100,ep,lam},ep=Table[{k,EulerPhi[k]},{k,nn}];Table[ SelectFirst[ep,#[[2]]==CarmichaelLambda[n]&],{n,2,nn}]][[All,1]]] (* Harvey P. Dale, Dec 24 2021 *)
-
PARI
a(n)=my(t=lcm(znstar(n)[2]));if(t>2,for(k=t+1,solve(x=t,2*t^2,x/(exp(Euler)*log(log(x))+3/log(log(x)))-t),if(eulerphi(k)==t,return(k)));0,2*t-1) \\ Charles R Greathouse IV, Nov 28 2012
-
PARI
A014197(n, m=1) = { n==1 && return(1+(m<2)); my(p, q); sumdiv(n, d, if( d>=m && isprime(d+1), sum( i=0, valuation(q=n\d, p=d+1), A014197(q\p^i, p))))} \\ This function from M. F. Hasler, Oct 05 2009 A219792(n) = { my(x=lcm(znstar(n)[2])); if(0==A014197(x),0,for(k=1,oo,if(eulerphi(k)==x,return(k)))); }; \\ Antti Karttunen, Dec 05 2017
Comments