Sum of squares of prime numbers in the interval
JavaScript
Medium
math
Task «Sum of squares of prime numbers in the interval»
Write a function that takes two integers a and b (a ≤ b). It is necessary to find all prime numbers in the interval [a, b] and calculate the sum of their squares. If there are no prime numbers in the interval, output 0. Constraints: -10^6 ≤ a ≤ b ≤ 10^6.
Input Format
Two integers a and b, separated by a space.
Output Format
One integer — the sum of squares of prime numbers in the interval.
Examples
Example 1
INPUT
20 30
OUTPUT
1370
main.js