31875000
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
t <- expand.grid(a = 1:1000, b = 1:1000)
answer <- t %>%
mutate(sum = a + b) %>%
filter(sum < 1000) %>%
select(-sum) %>%
mutate(c = sqrt(a^2 + b^2)) %>%
mutate(sum = a + b + c) %>%
filter(sum == 1000) %>%
slice(1) %>%
transmute(answer = a*b*c)
Man bør nok generere de der tripler.