In Project Euler 47, why is 2^2 considered a prime number distinct from 2?

primes

Solution

The first three consecutive numbers to have three distinct prime factors are:

644 = 2² × 7 × 23 645 = 3 × 5 × 43 646 = 2 × 17 × 19.

If you factorize 644 you get 2 × 2 × 7 × 23. 644 has four prime factors, but three distinct prime factors.

Problem

How would I get my code to reflect that? Should I just have it consider the number 4 to be prime? Project Euler: Problem 47

Original source