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.

A072211 a(n) = p-1 if n=p, p if n=p^e and e<>1, 1 otherwise; p a prime.

Original entry on oeis.org

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

Views

Author

Vladeta Jovovic, Jul 03 2002

Keywords

Comments

Product_{d divides n} a(d) = phi(n).

Crossrefs

Cf. A000010.

Programs

  • Haskell
    a072211 n = a072211_list !! (n-1)
    a072211_list = 1 : zipWith div (tail a217863_list) a217863_list
    -- Reinhard Zumkeller, Nov 24 2012
    
  • Maple
    f:= proc(n)
      local P;
      P:= numtheory:-factorset(n);
      if nops(P) > 1 then 1
      elif n = P[1] then P[1]-1
      else P[1]
      fi
    end proc:
    1, seq(f(n),n=2..100); # Robert Israel, Aug 25 2015
  • Mathematica
    Table[Which[PrimeQ@ n, n - 1, ! PrimeQ@ n && PrimePowerQ@ n,
    First @@ FactorInteger@ n, True, 1], {n, 88}] (* Michael De Vlieger, Aug 25 2015 *)
  • PARI
    a(n) = pp = isprimepower(n, &p); if (pp==1, n-1, if (pp, p, 1)); \\ Michel Marcus, Aug 25 2015

Formula

a(n) = Product_{d divides n} phi(n/d)^mu(d). - Vladeta Jovovic, Mar 08 2004
a(n) = A217863(n)/A217863(n-1) for n > 1. - Eric Desbiaux, Nov 23 2012; corrected by Thomas Ordowski, Aug 25 2015
D.g.f.: zeta(s) + Sum_{p prime} (p-2+p^(-s))/(p^s-1), - Robert Israel, Aug 25 2015