cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A007614 All values attained by the phi(n) function, in ascending order.

This page as a plain text file.
%I A007614 #40 Nov 15 2024 05:24:30
%S A007614 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,
%T A007614 16,16,16,18,18,18,18,20,20,20,20,20,22,22,24,24,24,24,24,24,24,24,24,
%U A007614 24,28,28,30,30,32,32,32,32,32,32,32,36,36,36,36,36,36,36,36
%N A007614 All values attained by the phi(n) function, in ascending order.
%C A007614 Write down phi(1), phi(2), phi(3), ..., then sort this list. Of course the list before sorting is simply sequence A000010.
%C A007614 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
%C A007614 A002202(n) occurs A058277(n) times. - _Reinhard Zumkeller_, Nov 22 2015
%H A007614 Zak Seidov, <a href="/A007614/b007614.txt">Table of n, a(n) for n=1..9999</a> (values up to 5152)
%H A007614 Max Alekseyev, <a href="https://oeis.org/wiki/User:Max_Alekseyev/gpscripts">PARI/GP Scripts for Miscellaneous Math Problems</a> (invphi.gp).
%t A007614 Cases[Sort[Table[EulerPhi[n],{n,1,36^2}]], n_ /; n<=36 ]  (* _Jean-François Alcover_, Mar 22 2011 *)
%t A007614 A007614[m_]:=Select[Sort[Table[EulerPhi[n],{n,Prime[m]}]],#≤m&]; A007614[1000] (* _Zak Seidov_, Mar 22 2011 *)
%t A007614 primorial = Times @@ Prime[Range[4]]; phi = EulerPhi[primorial]; Sort[Select[EulerPhi[Range[primorial]], # <= phi &]] (* _T. D. Noe_, Mar 22 2011 *)
%o A007614 (PARI)  (See A032447).
%o A007614 (PARI) lista(nmax) = {my(m); for(n = 1, nmax, m = invphiNum(n); for(i = 1, m, print1(n, ", ")));} \\ _Amiram Eldar_, Nov 15 2024 using _Max Alekseyev_'s invphi.gp
%o A007614 (Haskell)
%o A007614 import Data.List.Ordered (insertBag)
%o A007614 a007614 n = a007614_list !! (n-1)
%o A007614 a007614_list = f [1..] a002110_list [] where
%o A007614    f xs'@(x:xs) ps'@(p:ps) us
%o A007614      | x < p = f xs ps' $ insertBag (a000010' x) us
%o A007614      | otherwise = vs ++ f xs' ps ws
%o A007614      where (vs, ws) = span (<= a000010' x) us
%o A007614 -- _Reinhard Zumkeller_, Nov 22 2015
%Y A007614 Corresponding values of n are given by A032447.
%Y A007614 Cf. A000010. A002110, A002202, A058277 (run lengths).
%K A007614 nonn,easy,nice
%O A007614 1,3
%A A007614 _Walter Nissen_