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.

A093803 Greatest odd proper divisor of n; a(1)=1.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 1, 1, 3, 5, 1, 3, 1, 7, 5, 1, 1, 9, 1, 5, 7, 11, 1, 3, 5, 13, 9, 7, 1, 15, 1, 1, 11, 17, 7, 9, 1, 19, 13, 5, 1, 21, 1, 11, 15, 23, 1, 3, 7, 25, 17, 13, 1, 27, 11, 7, 19, 29, 1, 15, 1, 31, 21, 1, 13, 33, 1, 17, 23, 35, 1, 9, 1, 37, 25, 19, 11, 39, 1, 5, 27, 41, 1, 21, 17
Offset: 1

Views

Author

Reinhard Zumkeller, May 19 2004

Keywords

Crossrefs

Programs

  • Maple
    with(numtheory): a := n -> max(1,op(select(k->type(k,odd),divisors(n) minus {n}))): seq(a(n),n=1..85); # Peter Luschny, Feb 02 2015
  • Mathematica
    Join[{1},Table[Max[Select[Most[Divisors[n]],OddQ]],{n,2,90}]] (* Harvey P. Dale, Apr 10 2012 *)
    odd[n_] := n/2^IntegerExponent[n, 2]; a[n_] := odd[n/FactorInteger[n][[1, 1]]]; Array[a, 100] (* Amiram Eldar, Jul 04 2022 *)
  • PARI
    a(n)= my(x=if(n==1, 1, n/factor(n)[1, 1])); x >> valuation(x, 2); \\ Michel Marcus, Oct 26 2022
    
  • Python
    from math import prod
    from sympy import factorint
    def A093803(n):
        if n == 1: return 1
        f = factorint(n)
        m = min(f)
        return prod(p**(0 if p == 2 else e-1 if p == m else e) for p,e in f.items()) # Chai Wah Wu, Oct 27 2022
  • Scheme
    (define (A093803 n) (/ n (if (odd? n) (A020639 n) (A006519 n)))) ;; Antti Karttunen, Aug 12 2017
    

Formula

a(n) <= A000265(n);
a(n) = n / (A020639(n)*(n mod 2) + A006519(n)*(1 - n mod 2)).
a(n) = A000265(A032742(n)). - Antti Karttunen, Aug 12 2017