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.

A220096 a(1)=0, n-1 if n is prime, else largest proper divisor of n.

Original entry on oeis.org

0, 1, 2, 2, 4, 3, 6, 4, 3, 5, 10, 6, 12, 7, 5, 8, 16, 9, 18, 10, 7, 11, 22, 12, 5, 13, 9, 14, 28, 15, 30, 16, 11, 17, 7, 18, 36, 19, 13, 20, 40, 21, 42, 22, 15, 23, 46, 24, 7, 25, 17, 26, 52, 27, 11, 28, 19, 29, 58, 30, 60, 31, 21, 32, 13, 33, 66, 34, 23, 35, 70
Offset: 1

Views

Author

Jon Perry, Dec 04 2012

Keywords

Comments

On the dual isomorphism [n, n*] this function represents n* - see A091934.

Crossrefs

Programs

  • Haskell
    a220096 n = if z == 1 then n - 1 else z  where z = a032742 n
    -- Reinhard Zumkeller, Nov 23 2014
    
  • Mathematica
    Join[{0}, Table[If[PrimeQ[n], n - 1, Divisors[n][[-2]]], {n, 2, 100}]] (* T. D. Noe, Dec 04 2012 *)
  • PARI
    a(n) = if (n==1, 0, isprime(n), n-1, my(d=divisors(n)); d[#d-1]); \\ Michel Marcus, Dec 24 2017

Formula

a(n) = if A220096(n) = 1 then n - 1 else A220096(n). - Reinhard Zumkeller, Nov 23 2014