Out of all the years I've been making this challenge, 2017 is the first year that's been a prime number. So the question will be about prime numbers and their properties.
Your task is to produce a program or function that will take an arbitrarily large positive integer as input, and output or return whether or not the number is 2,017-friable — that is, whether the largest prime factor in that number is 2,017 or less.
Some example inputs and their outputs:
1 (has no prime factors)
true
2 (= 2)
true
80 (= 2 x 2 x 2 x 2 x 5)
true
2017 (= 2017)
true
2019 (= 3 x 673)
true
2027 (= 2027)
false
11111 (= 41 x 271)
true
45183 (= 3 x 15061)
false
102349 (= 13 x 7873)
false
999999 (= 3 x 3 x 3 x 7 x 11 x 13 x 37)
true
1234567 (= 127 x 9721)
false
4068289 (= 2017 x 2017)
true
Your program does not have to literally output true
and false
— any truthy or falsy values, and in fact any two different outputs that are consistent across true and false cases are fine.
However, you may not use any primes in your source code. Primes come in two types:
Characters, or sequences of characters, that represent prime number literals.
The characters
2
,3
,5
, and7
are illegal in languages where numbers are valid tokens.The number
141
is illegal because it contains41
, even though1
and4
are otherwise valid.The characters
B
andD
(orb
andd
) are illegal in languages where they are typically used as 11 and 13, such as CJam or Befunge.
Characters that have prime-valued Unicode values, or contain prime-valued bytes in their encoding.
The characters
%)+/5;=CGIOSYaegkmq
are illegal in ASCII, as well as the carriage return character.The character
ó
is illegal in UTF-8 because its encoding has0xb3
in it. However, in ISO-8859-1, its encoding is simply0xf3
, which is composite and therefore okay.
The shortest code to do the above in any language wins.
=
rules out most standard languages... \$\endgroup\$