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-5 of 5 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

A340072 a(n) = phi(x) / gcd(x-1, phi(x)), where x = A003961(n), i.e., n with its prime factorization shifted one step towards larger primes.

Original entry on oeis.org

1, 1, 1, 3, 1, 4, 1, 9, 5, 3, 1, 6, 1, 5, 12, 27, 1, 20, 1, 18, 20, 12, 1, 36, 7, 16, 25, 30, 1, 6, 1, 81, 3, 9, 15, 15, 1, 11, 16, 27, 1, 20, 1, 18, 20, 28, 1, 54, 11, 42, 36, 12, 1, 100, 4, 45, 44, 15, 1, 72, 1, 36, 100, 243, 48, 48, 1, 54, 7, 12, 1, 180, 1, 40, 42, 66, 60, 64, 1, 162, 125, 21, 1, 120, 9, 23, 60, 108
Offset: 1

Views

Author

Antti Karttunen, Dec 28 2020

Keywords

Comments

Prime shifted analog of A160595.

Crossrefs

Cf. A000010, A003961, A003972, A160595, A253885, A340071, A340073, A340075 (gives the odd part).
Cf. also A340082.

Programs

  • Maple
    f:= proc(n) local F,x,p,t;
      F:= ifactors(n)[2];
      x:= mul(nextprime(t[1])^t[2],t=F);
      p:= numtheory:-phi(x);
      p/igcd(x-1,p)
    end proc:
    map(f,[$1..100]); # Robert Israel, Dec 28 2020
  • Mathematica
    a[n_] := Module[{x, p, e, phi}, x = Product[{p, e} = pe; NextPrime[p]^e, {pe, FactorInteger[n]}]; phi = EulerPhi[x]; phi/GCD[x-1, phi]];
    Array[a, 100] (* Jean-François Alcover, Jan 04 2022 *)
  • PARI
    A003961(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); };
    A340072(n) = { my(x=A003961(n), u=eulerphi(x)); u/gcd(x-1, u); };

Formula

a(n) = A160595(A003961(n)).
a(n) = A003972(n) / A340071(n).

A340081 a(n) = gcd(n-1, A003958(n)).

Original entry on oeis.org

1, 1, 2, 1, 4, 1, 6, 1, 4, 1, 10, 1, 12, 1, 2, 1, 16, 1, 18, 1, 4, 1, 22, 1, 8, 1, 2, 3, 28, 1, 30, 1, 4, 1, 2, 1, 36, 1, 2, 1, 40, 1, 42, 1, 4, 1, 46, 1, 12, 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, 16, 1, 82, 1, 4, 1, 2, 1, 88, 1, 18, 1, 4, 1, 2, 1, 96, 1, 2, 1, 100
Offset: 1

Views

Author

Antti Karttunen, Dec 28 2020

Keywords

Crossrefs

Programs

  • PARI
    A003958(n) = if(1==n,n,my(f=factor(n)); for(i=1,#f~,f[i,1]--); factorback(f));
    A340081(n) = gcd(n-1, A003958(n));

Formula

a(n) = gcd(n-1, A003958(n)).
a(n) = A003958(n) / A340082(n).
For n > 1, a(n) = (n-1) / A340083(n).

A340073 a(n) = (x-1) / gcd(x-1, phi(x)), where x = A003961(n), i.e., n with its prime factorization shifted one step towards larger primes.

Original entry on oeis.org

0, 1, 1, 4, 1, 7, 1, 13, 6, 5, 1, 11, 1, 8, 17, 40, 1, 37, 1, 31, 27, 19, 1, 67, 8, 25, 31, 49, 1, 13, 1, 121, 4, 14, 19, 28, 1, 17, 21, 47, 1, 41, 1, 29, 29, 43, 1, 101, 12, 73, 47, 19, 1, 187, 5, 74, 57, 23, 1, 157, 1, 55, 137, 364, 59, 97, 1, 85, 9, 23, 1, 337, 1, 61, 61, 103, 71, 127, 1, 283, 156, 32, 1, 247, 11
Offset: 1

Views

Author

Antti Karttunen, Dec 28 2020

Keywords

Comments

Prime shifted analog of A160596.

Crossrefs

Programs

  • PARI
    A003961(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); };
    A340073(n) = { my(x=A003961(n)); (x-1)/gcd(x-1, eulerphi(x)); };

Formula

a(n) = A160596(A003961(n)).
a(n) = A253885(n-1) / A340071(n) = (A003961(n)-1) / A340071(n).

A340074 a(n) = gcd(A003961(n)-1, A339904(n)).

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 5, 1, 1, 1, 3, 1, 1, 1, 1, 1, 9, 1, 11, 1, 1, 1, 7, 1, 3, 1, 1, 1, 15, 1, 9, 1, 1, 1, 1, 1, 5, 1, 1, 1, 21, 1, 23, 1, 3, 1, 13, 1, 5, 1, 1, 1, 29, 1, 9, 1, 1, 1, 15, 1, 33, 1, 1, 1, 1, 1, 35, 1, 1, 5, 9, 1, 39, 1, 1, 1, 1, 1, 41, 1, 1, 1, 11, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 25, 1, 3, 1, 51, 1, 53, 1, 3
Offset: 1

Views

Author

Antti Karttunen, Dec 29 2020

Keywords

Comments

Odd part of A340071(n).

Crossrefs

Programs

Formula

a(n) = gcd(A003961(n)-1, A339904(n)).
a(n) = A000265(A340071(n)).
a(n) = A339904(n) / A340075(n).
Showing 1-5 of 5 results.