[go: up one dir, main page]

login
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

%I #24 Jan 01 2024 11:55:17

%S 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,

%T 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,

%U 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

%N 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.

%C 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.

%H Michael De Vlieger, <a href="/A365708/b365708.txt">Table of n, a(n) for n = 1..10000</a>

%e a(1) = 2, since 2 is the smallest m such that 1/m is not a square.

%e a(2) = 1, since 2/1 = 2 is not a square (likewise for all primes p, a(p) = 1).

%e a(4) = 2, since 4/1 = 4, a square, but 4/2 = 2, not a square, and so on.

%e If n is a square with lpf(n) = p, then a(n) = p, the least m such that n/m is not a square.

%t {2}~Join~Table[SelectFirst[Divisors[n], ! IntegerQ@ Sqrt[n/#] &], {n, 2, 120}] (* _Michael De Vlieger_, Sep 17 2023 *)

%o (PARI) a(n) = fordiv(n, d, if (!issquare(n/d), return(d))); n+1; \\ _Michel Marcus_, Sep 17 2023

%Y Cf. A007913, A008578, A020639.

%K nonn

%O 1,1

%A _David James Sycamore_, Sep 16 2023