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-3 of 3 results.

A049559 a(n) = gcd(n - 1, phi(n)).

Original entry on oeis.org

1, 1, 2, 1, 4, 1, 6, 1, 2, 1, 10, 1, 12, 1, 2, 1, 16, 1, 18, 1, 4, 1, 22, 1, 4, 1, 2, 3, 28, 1, 30, 1, 4, 1, 2, 1, 36, 1, 2, 1, 40, 1, 42, 1, 4, 1, 46, 1, 6, 1, 2, 3, 52, 1, 2, 1, 4, 1, 58, 1, 60, 1, 2, 1, 16, 5, 66, 1, 4, 3, 70, 1, 72, 1, 2, 3, 4, 1, 78, 1, 2, 1, 82, 1, 4, 1, 2, 1, 88, 1, 18, 1, 4
Offset: 1

Views

Author

Labos Elemer, Dec 28 2000

Keywords

Comments

For prime n, a(n) = n - 1. Question: do nonprimes exist with this property?
Answer: No. If n is composite then a(n) < n - 1. - Charles R Greathouse IV, Dec 09 2013
Lehmer's totient problem (1932): are there composite numbers n such that a(n) = phi(n)? - Thomas Ordowski, Nov 08 2015
a(n) = 1 for n in A209211. - Robert Israel, Nov 09 2015

Examples

			a(9) = 2 because phi(9) = 6 and gcd(8, 6) = 2.
a(10) = 1 because phi(10) = 4 and gcd(9, 4) = 1.
		

References

  • Richard K. Guy, Unsolved Problems in Number Theory, B37.

Crossrefs

Programs

  • Magma
    [Gcd(n-1, EulerPhi(n)): n in [1..80]]; // Vincenzo Librandi, Oct 13 2018
  • Maple
    seq(igcd(n-1, numtheory:-phi(n)), n=1..100); # Robert Israel, Nov 09 2015
  • Mathematica
    Table[GCD[n - 1, EulerPhi[n]], {n, 93}] (* Michael De Vlieger, Nov 09 2015 *)
  • PARI
    a(n)=gcd(eulerphi(n),n-1) \\ Charles R Greathouse IV, Dec 09 2013
    
  • Python
    from sympy import totient, gcd
    print([gcd(totient(n), n - 1) for n in range(1, 101)]) # Indranil Ghosh, Mar 27 2017
    

Formula

a(p^m) = a(p) = p - 1 for prime p and m > 0. - Thomas Ordowski, Dec 10 2013
From Antti Karttunen, Sep 09 2018: (Start)
a(n) = A000010(n) / A160595(n) = A063994(n) / A318829(n).
a(n) = n - A318827(n) = A000010(n) - A318830(n).
(End)
a(n) = gcd(A000010(n), A219428(n)) = gcd(A000010(n), A318830(n)). - Antti Karttunen, Jan 05 2021

A330756 Number of values of k, 1 <= k <= n, with A063994(k) = A063994(n), where A063994(n) = Product_{primes p dividing n} gcd(p-1, n-1).

Original entry on oeis.org

1, 2, 1, 3, 1, 4, 1, 5, 2, 6, 1, 7, 1, 8, 2, 9, 1, 10, 1, 11, 3, 12, 1, 13, 4, 14, 3, 1, 1, 15, 1, 16, 5, 17, 6, 18, 1, 19, 7, 20, 1, 21, 1, 22, 1, 23, 1, 24, 2, 25, 8, 2, 1, 26, 9, 27, 10, 28, 1, 29, 1, 30, 11, 31, 2, 1, 1, 32, 12, 3, 1, 33, 1, 34, 13, 4, 14, 35, 1, 36, 4, 37, 1, 38, 3, 39, 15, 40, 1, 41, 2, 42, 16
Offset: 1

Views

Author

Antti Karttunen, Dec 30 2019

Keywords

Comments

Ordinal transform of A063994.

Crossrefs

Programs

  • Mathematica
    A063994[n_] := If[n==1, 1, Times @@ GCD[n-1, First /@ FactorInteger[n]-1]];
    Module[{b}, b[_] = 0;
    a[n_] := With[{t = A063994[n]}, b[t] = b[t]+1]];
    Array[a, 105] (* Jean-François Alcover, Jan 12 2022 *)
  • PARI
    up_to = 65537;
    A063994(n) = { my(f=factor(n)[, 1]); prod(i=1, #f, gcd(f[i]-1, n-1)); }; \\ From A063994
    ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om,invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om,invec[i],(1+pt))); outvec; };
    v330756 = ordinal_transform(vector(up_to, n, A063994(n)));
    A330756(n) = v330756[n];

A344774 Number of divisors d of n for which A049559(d) = A049559(n), where A049559(n) = gcd(n-1, phi(n)).

Original entry on oeis.org

1, 2, 1, 3, 1, 3, 1, 4, 2, 3, 1, 5, 1, 3, 2, 5, 1, 4, 1, 5, 1, 3, 1, 7, 2, 3, 3, 1, 1, 5, 1, 6, 1, 3, 1, 7, 1, 3, 2, 7, 1, 5, 1, 5, 2, 3, 1, 9, 2, 4, 2, 1, 1, 5, 1, 6, 1, 3, 1, 9, 1, 3, 3, 7, 1, 1, 1, 5, 1, 1, 1, 10, 1, 3, 3, 1, 1, 5, 1, 9, 4, 3, 1, 8, 2, 3, 2, 7, 1, 7, 1, 5, 1, 3, 1, 11, 1, 4, 3, 7, 1, 5, 1, 6, 1
Offset: 1

Views

Author

Antti Karttunen, May 31 2021

Keywords

Crossrefs

Cf. also A344773.

Programs

Formula

a(n) = Sum_{d|n} [A049559(d) = A049559(n)], where [ ] is the Iverson bracket.
a(n) <= A330747(n).
Showing 1-3 of 3 results.