JB7LY3AJRMOS4OUV3ADFEH3U3GKC7FXXBRSRZORN6AK2VXZNDKAQC
// Package prime is for prime factor handling.
package prime
// Factors prints prime factors for input number.
func Factors(num int64) []int64 {
out := []int64{}
for num%2 == 0 {
num /= 2
out = append(out, 2)
}
for i := 3; i*i <= int(num); i += 2 {
for num%int64(i) == 0 {
out = append(out, int64(i))
num /= int64(i)
}
}
if num > 2 {
out = append(out, num)
}
return out
}