(Translated by https://www.hiragana.jp/)
A007614 - OEIS
login
A007614
All values attained by the phi(n) function, in ascending order.
14
1, 1, 2, 2, 2, 4, 4, 4, 4, 6, 6, 6, 6, 8, 8, 8, 8, 8, 10, 10, 12, 12, 12, 12, 12, 12, 16, 16, 16, 16, 16, 16, 18, 18, 18, 18, 20, 20, 20, 20, 20, 22, 22, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 28, 28, 30, 30, 32, 32, 32, 32, 32, 32, 32, 36, 36, 36, 36, 36, 36, 36, 36
OFFSET
1,3
COMMENTS
Write down phi(1), phi(2), phi(3), ..., then sort this list. Of course the list before sorting is simply sequence A000010.
To ensure that all terms are found, the values of phi(n) should be computed for all n up to a primorial p# -- which are the local minima of the phi function. Selecting and sorting the values of phi(n) <= phi(p#) produces the terms of this sequence. - T. D. Noe, Mar 22 2011
A002202(n) occurs A058277(n) times. - Reinhard Zumkeller, Nov 22 2015
LINKS
Zak Seidov, Table of n, a(n) for n=1..9999 (values up to 5152)
MATHEMATICA
Cases[Sort[Table[EulerPhi[n], {n, 1, 36^2}]], n_ /; n<=36 ] (* Jean-François Alcover, Mar 22 2011 *)
A007614[m_]:=Select[Sort[Table[EulerPhi[n], {n, Prime[m]}]], #≤m&]; A007614[1000] (* Zak Seidov, Mar 22 2011 *)
primorial = Times @@ Prime[Range[4]]; phi = EulerPhi[primorial]; Sort[Select[EulerPhi[Range[primorial]], # <= phi &]] (* T. D. Noe, Mar 22 2011 *)
PROG
(PARI) (See A032447).
(Haskell)
import Data.List.Ordered (insertBag)
a007614 n = a007614_list !! (n-1)
a007614_list = f [1..] a002110_list [] where
f xs'@(x:xs) ps'@(p:ps) us
| x < p = f xs ps' $ insertBag (a000010' x) us
| otherwise = vs ++ f xs' ps ws
where (vs, ws) = span (<= a000010' x) us
-- Reinhard Zumkeller, Nov 22 2015
CROSSREFS
Corresponding values of n are given by A032447. Cf. A000010.
Cf. A002110, A002202, A058277 (run lengths).
Sequence in context: A372057 A340743 A317841 * A289256 A287155 A287654
KEYWORD
nonn,easy,nice
AUTHOR
STATUS
approved