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.
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
Keywords
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.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
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
Comments