[go: up one dir, main page]

login
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.
1
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,1
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.
LINKS
EXAMPLE
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.
MATHEMATICA
{2}~Join~Table[SelectFirst[Divisors[n], ! IntegerQ@ Sqrt[n/#] &], {n, 2, 120}] (* Michael De Vlieger, Sep 17 2023 *)
PROG
(PARI) a(n) = fordiv(n, d, if (!issquare(n/d), return(d))); n+1; \\ Michel Marcus, Sep 17 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved