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.

A277708 a(n) = Least prime divisor of n with an odd exponent, or 1 if n is a perfect square.

Original entry on oeis.org

1, 2, 3, 1, 5, 2, 7, 2, 1, 2, 11, 3, 13, 2, 3, 1, 17, 2, 19, 5, 3, 2, 23, 2, 1, 2, 3, 7, 29, 2, 31, 2, 3, 2, 5, 1, 37, 2, 3, 2, 41, 2, 43, 11, 5, 2, 47, 3, 1, 2, 3, 13, 53, 2, 5, 2, 3, 2, 59, 3, 61, 2, 7, 1, 5, 2, 67, 17, 3, 2, 71, 2, 73, 2, 3, 19, 7, 2, 79, 5, 1, 2, 83, 3, 5, 2, 3, 2, 89, 2, 7, 23, 3, 2, 5, 2, 97, 2, 11, 1, 101, 2, 103, 2, 3
Offset: 1

Views

Author

Antti Karttunen, Oct 28 2016

Keywords

Crossrefs

Cf. A000290 (after its initial zero-term gives the positions of ones in this sequence).
Cf. also A277698.

Programs

  • PARI
    a(n) = my(f = factor(core(n))); if (!#f~, 1, vecmin(f[,1])); \\ Michel Marcus, Oct 30 2016
    
  • Python
    from sympy import primefactors
    from sympy.ntheory.factor_ import core
    def lpf(n): return 1 if n==1 else primefactors(n)[0]
    def a(n): return lpf(core(n)) # Indranil Ghosh, May 17 2017

Formula

a(n) = A008578(1+A277707(n)).
a(n) = A020639(A007913(n)).