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.

Showing 1-2 of 2 results.

A032447 Inverse function of phi( ).

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 8, 10, 12, 7, 9, 14, 18, 15, 16, 20, 24, 30, 11, 22, 13, 21, 26, 28, 36, 42, 17, 32, 34, 40, 48, 60, 19, 27, 38, 54, 25, 33, 44, 50, 66, 23, 46, 35, 39, 45, 52, 56, 70, 72, 78, 84, 90, 29, 58, 31, 62, 51, 64, 68, 80, 96, 102, 120, 37, 57, 63, 74, 76, 108, 114, 126
Offset: 1

Views

Author

Ursula Gagelmann (gagelmann(AT)altavista.net)

Keywords

Comments

Arrange integers in order of increasing phi value; the phi values themselves form A007614.
Inverse of sequence A064275 considered as a permutation of the positive integers. - Howard A. Landman, Sep 25 2001
In the array shown in the example section row no. n gives exactly the N values for which the cyclotomic polynomials cyclotomic(N,x) have degree A002202(n). - Wolfdieter Lang, Feb 19 2012.

Examples

			phi(1)=phi(2)=1, phi(3)=phi(4)=phi(6)=2, phi(5)=phi(8)=...=4, ...
From _Wolfdieter Lang_, Feb 19 2012: (Start)
Read as array a(n,m) with row length l(n):=A058277(v(n)) with v(n):= A002202(n), n>=1. a(n,m) = m-th element of the set {m from positive integers: phi(m)=v(n)} when read as an increasingly ordered list.
  l(n): 2, 3, 4, 4, 5, 2, 6, 6, 4, 5, ...
   n, v(n)\m 1  2  3  4  5  6  7  8  9  10 11  12  13  14
   1,  1:    1  2
   2,  2:    3  4  6
   3,  4:    5  8 10 12
   4,  6:    7  9 14 18
   5,  8:   15 16 20 24 30
   6, 10:   11 22
   7, 12:   13 21 26 28 36 42
   8, 16:   17 32 34 40 48 60
   9, 18:   19 27 38 54
  10, 20:   25 33 44 50 66
  ...
Row no. n=4: The cyclotomic polynomials cyclotomic(N,x) with values N = 7,9,14, and 18 have degree 6, and only these.
(End)
		

References

  • Sivaramakrishnan, The many facets of Euler's Totient, I. Nieuw Arch. Wisk. 4 (1986), 175-190.

Crossrefs

Programs

  • Haskell
    import Data.List.Ordered (insertBag)
    a032447 n = a032447_list !! (n-1)
    a032447_list = f [1..] a002110_list [] where
       f xs'@(x:xs) ps'@(p:ps) us
         | x < p = f xs ps' $ insertBag (a000010' x, x) us
         | otherwise = map snd vs ++ f xs' ps ws
         where (vs, ws) = span ((<= a000010' x) . fst) us
    -- Reinhard Zumkeller, Nov 22 2015
    
  • Mathematica
    Needs["CNT`"]; Flatten[Table[PhiInverse[n], {n, 40}]] (* T. D. Noe, Oct 15 2012 *)
    Take[Values@ PositionIndex@ Array[EulerPhi, 10^3], 15] // Flatten (* Michael De Vlieger, Dec 29 2017 *)
    SortBy[Table[{n,EulerPhi[n]},{n,150}],Last][[All,1]] (* Harvey P. Dale, Oct 11 2019 *)
  • PARI
    M = 9660; /* choose a term of A036913 */
    v = vector(M, n, [eulerphi(n),n] );
    v = vecsort(v, (x, y)-> if( x[1]-y[1]!=0, sign(x[1]-y[1]), sign(x[2]-y[2]) ) );
    P=eulerphi(M);
    v = select( x->(x[1]<=P), v );
    /* A007614 = vector(#v,n, v[n][1] ) */
    A032447 = vector(#v,n, v[n][2] )
    /* for (n=1,#v, print(n," ", A032447[n]) ); */ /* b-file */
    /* Joerg Arndt, Oct 06 2012 */
    
  • Perl
    use ntheory ":all"; my($n,$k,$i,@v)=(10000,1,0); push @v,inverse_totient($k++) while @v<$n; $#v=$n-1; say ++$i," $" for @v; # _Dana Jacobsen, Mar 04 2019

Extensions

Example corrected, more terms and program from Olivier Gérard, Feb 1999

A085713 Consider numbers k such that phi(x) = k has exactly 3 solutions and they are (3*p, 4*p, 6*p) where p is 1 or a prime. Sequence gives values of p.

Original entry on oeis.org

1, 23, 29, 47, 53, 59, 71, 83, 103, 107, 131, 149, 167, 173, 179, 191, 197, 223, 227, 239, 263, 269, 283, 293, 311, 317, 347, 359, 373, 383, 389, 419, 431, 443, 467, 479, 491, 503, 509, 557, 563, 569, 587, 599, 643, 647, 653, 659, 677, 683, 709, 719
Offset: 1

Views

Author

Alford Arnold, Jul 19 2003

Keywords

Comments

Prime numbers in this sequence are called prime replicators of 2, by Stolarski and Greenbaum, (3, 4, 6) being the solutions of phi(x)=2. - Michel Marcus, Oct 20 2012
Prime numbers in this sequence when multiplied by 2 equal k + 2. For example, 83 * 2 = 164 + 2. - Torlach Rush, Jun 16 2018

Examples

			83 is a term because the three solutions (249,332,498) to phi(x) = 164 can be written as (3*83, 4*83, 6*83).
		

Crossrefs

Programs

  • Haskell
    import Data.List.Ordered (insertBag)
    import Data.List (groupBy); import Data.Function (on)
    a085713 n = a085713_list !! (n-1)
    a085713_list = 1 : r yx3ss where
       r (ps:pss) | a010051' cd == 1 &&
                    map (flip div cd) ps == [3, 4, 6] = cd : r pss
                  | otherwise = r pss  where cd = foldl1 gcd ps
       yx3ss = filter ((== 3) . length) $
           map (map snd) $ groupBy ((==) `on` fst) $
           f [1..] a002110_list []
           where f is'@(i:is) ps'@(p:ps) yxs
                  | i < p = f is ps' $ insertBag (a000010' i, i) yxs
                  | otherwise = yxs' ++ f is' ps yxs''
                  where (yxs', yxs'') = span ((<= a000010' i) . fst) yxs
    -- Reinhard Zumkeller, Nov 25 2015
    
  • Mathematica
    t = Table[ EulerPhi[n], {n, 1, 5000}]; u = Union[ Select[t, Count[t, # ] == 3 &]]; a = {}; Do[k = 1; While[ EulerPhi[3k] != u[[n]], k++ ]; AppendTo[a, k], {n, 1, 60}]; Sort[a]
  • PARI
    is(p) = if(p > 1 && !isprime(p), 0, invphi(eulerphi(3*p)) == [3*p, 4*p, 6*p]); \\ Amiram Eldar, Nov 19 2024, using Max Alekseyev's invphi.gp

Extensions

Edited and extended by Robert G. Wilson v, Jul 19 2003
Nonprimes 343=7^3 and 361=19^2 deleted by Reinhard Zumkeller, Nov 25 2015
Showing 1-2 of 2 results.