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.

A009195 a(n) = gcd(n, phi(n)).

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 4, 3, 2, 1, 4, 1, 2, 1, 8, 1, 6, 1, 4, 3, 2, 1, 8, 5, 2, 9, 4, 1, 2, 1, 16, 1, 2, 1, 12, 1, 2, 3, 8, 1, 6, 1, 4, 3, 2, 1, 16, 7, 10, 1, 4, 1, 18, 5, 8, 3, 2, 1, 4, 1, 2, 9, 32, 1, 2, 1, 4, 1, 2, 1, 24, 1, 2, 5, 4, 1, 6, 1, 16, 27, 2, 1, 12, 1, 2, 1, 8, 1, 6, 1, 4, 3, 2, 1, 32, 1, 14, 3, 20
Offset: 1

Views

Author

Keywords

Comments

The inequality gcd(n, phi(n)) <= 2n exp(-sqrt(log 2 log n)) holds for all squarefree n >= 1 (Erdős, Luca, and Pomerance).
Erdős shows that for almost all n, a(n) ~ log log log log n. - Charles R Greathouse IV, Nov 23 2011

Crossrefs

Programs

  • Haskell
    a009195 n = n `gcd` a000010 n  -- Reinhard Zumkeller, Feb 27 2012
    
  • Magma
    [Gcd(n, EulerPhi(n)): n in [1..100]]; // Vincenzo Librandi, Dec 17 2015
  • Maple
    a009195 := n -> igcd(i,numtheory[phi](n));
  • Mathematica
    Table[GCD[n,EulerPhi[n]],{n,100}] (* Harvey P. Dale, Aug 11 2011 *)
  • PARI
    a(n)=gcd(n,eulerphi(n)) \\ Charles R Greathouse IV, Nov 23 2011
    
  • Python
    def a009195(n):
        from math import gcd
        phi = lambda x: len([i for i in range(x) if gcd(x,i) == 1])
        return gcd(n, phi(n))
    # Edward Minnix III, Dec 05 2015
    

Formula

a(n) = gcd(n, A051953(n)). - Labos Elemer
a(n) = n / A109395(n). - Antti Karttunen, May 04 2017 (corrected also typo in above formula).

A112038 The p values which produce new terms in A112037.

Original entry on oeis.org

3, 7, 11, 23, 29, 47, 53, 59, 83, 103, 107, 149, 167, 173, 179, 191, 227, 263, 269, 283, 293, 311, 317, 347, 359, 367, 383, 389, 467, 479, 503, 509, 557, 563, 569, 587, 607, 619, 643, 653, 709, 719, 773, 797, 823, 839, 863, 887, 907, 983, 1019, 1087, 1091
Offset: 1

Views

Author

Michel Dauchez (mdzdm(AT)yahoo.fr), Nov 28 2005

Keywords

Crossrefs

The p values which do not produce new terms in A112037 are given by A061303. - Ray Chandler, Nov 30 2005

Programs

  • Mathematica
    lst = {}; r[n_] := (len = Length@lst; lst = Flatten@ Join[lst, Select[First /@ FactorInteger[Prime@n - 1], ! MemberQ[lst, # ] &]]; If[l < Length@lst, 1, 0]); Prime /@ Select[Range@185, r[ # ] == 1 &] (* Robert G. Wilson v *)

Extensions

Better description from Jack Brennen, Nov 28 2005
Extended by Ray Chandler and Robert G. Wilson v, Nov 30 2005
Showing 1-2 of 2 results.