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.

A365708 a(n) for n >= 2 is the smallest term of A008578 m dividing n such that n/m is not a square, a(1) = 2.

Original entry on oeis.org

2, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2
Offset: 1

Views

Author

David James Sycamore, Sep 16 2023

Keywords

Comments

In other words, a(n) is the least prime divisor of n for n = m^2, (m > 1), otherwise a(n) = 1. (Every term is 1 or a prime.) Compare with A007913.

Examples

			a(1) = 2, since 2 is the smallest m such that 1/m is not a square.
a(2) = 1, since 2/1 = 2 is not a square (likewise for all primes p, a(p) = 1).
a(4) = 2, since 4/1 = 4, a square, but 4/2 = 2, not a square, and so on.
If n is a square with lpf(n) = p, then a(n) = p, the least m such that n/m is not a square.
		

Crossrefs

Programs

  • Mathematica
    {2}~Join~Table[SelectFirst[Divisors[n], ! IntegerQ@ Sqrt[n/#] &], {n, 2, 120}] (* Michael De Vlieger, Sep 17 2023 *)
  • PARI
    a(n) = fordiv(n, d, if (!issquare(n/d), return(d))); n+1; \\ Michel Marcus, Sep 17 2023