[Question]
  [
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`, and `7` are illegal in languages where numbers are valid tokens.
	+ The number `141` is illegal because it contains `41`, even though `1` and `4` are otherwise valid.
	+ The characters `B` and `D` (or `b` and `d`) 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 has `0xb3` in it. However, in ISO-8859-1, its encoding is simply `0xf3`, which is composite and therefore okay.
The shortest code to do the above in any language wins.
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 8 bytes
```
44‚Äò¬≤!*·∏ç@
```
[Try it online!](https://tio.run/nexus/jelly#@29i8qhhxqFNiloPd/Q6/P//38jAyBwA "Jelly ‚Äì TIO Nexus") Note that test cases **11111** and above are a bit too much for TIO.
### Verification
```
$ source="34,34,fc,82,21,2a,d5,40"
$ xxd -ps -r > 2017.jelly <<< $source
$ xxd -g 1 2017.jelly
0000000: 34 34 fc 82 21 2a d5 40                          44..!*.@
$ eval printf '"%d "' 0x{$source}; echo # Code points in decimal
52 52 252 130 33 42 213 64
$ test_cases="1 2 80 2017 2019 2027 11111 45183 102349 999999 1234567 4068289"
$ for n in $test_cases; do printf "%11d: %d\n" $n $(jelly f 2017.jelly $n); done
      1: 1
      2: 1
     80: 1
   2017: 1
   2019: 1
   2027: 0
  11111: 1
  45183: 0
 102349: 0
```
Test case **999999** has been running for 13 hours. I'm pessimistic about computing **2025!4068289**...
### How it works
```
44‚Äò¬≤!*·∏ç@  Main link. Argument: n
44        Yield 44.
  ‚Äò       Increment to yield 45.
   ¬≤      Square to yield 2025.
          Note that no integers in [2018, ..., 2025] are prime numbers.
    !     Take the factorial of 2025.
     *    Raise it to the n-th power.
          This repeats all prime factors in 2025! at least n times, so the result
          will be divisible by n if (and only if) all of its prime factors fall
          in the range [1, ..., 2025].
      ·∏ç@  Test the result for divisibility by n.
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 8 characters, 14 bytes of UTF-8
```
√Üf¬Ω·πÄ·∏§<90
```
[Try it online!](https://tio.run/nexus/jelly#@3@4Le3Q3oc7Gx7uWGJjafD//38jA0NzAA "Jelly ‚Äì TIO Nexus")
Jelly normally uses its own codepage for programs. However, most of its prime-related builtins start with `√Ü`, which is codepoint 13; not very helpful. Luckily, the interpreter also supports UTF-8, which has a friendlier encoding.
## Verification
This program, in UTF-8, hexdumps like this:
```
00000000: c386 66c2 bde1 b980 e1b8 a43c 3930  ..f........<90
```
Verification that all the bytes are composite:
```
$ for x in c3 86 66 c2 bd e1 b9 80 e1 b8 a4 3c 39 30; do factor $((0x$x)); done
195: 3 5 13
134: 2 67
102: 2 3 17
194: 2 97
189: 3 3 3 7
225: 3 3 5 5
185: 5 37
128: 2 2 2 2 2 2 2
225: 3 3 5 5
184: 2 2 2 23
164: 2 2 41
60: 2 2 3 5
57: 3 19
48: 2 2 2 2 3
```
Verification that all the Unicode codepoints are composite:
```
$ perl -Mutf8 -E '$a = ord, print `factor $a` for split //, "√Üf¬Ω·πÄ·∏§<90"'
198: 2 3 3 11
102: 2 3 17
189: 3 3 3 7
7744: 2 2 2 2 2 2 11 11
7716: 2 2 3 643
60: 2 2 3 5
57: 3 19
48: 2 2 2 2 3
```
The only token parsed as a number is `90`. None of `9`, `0`, and `90` are prime.
## Explanation
The main mathematical insight here is that 45¬≤ is 2025, which neatly falls between 2017 (the current year) and 2027 (the next prime). Thus, we can take the square root of every prime factor of the number, and see if any exceeds 45. Unfortunately, we can't write `45` due to the literal `5`, so we have to double it and compare to 90 instead.
```
√Üf¬Ω·πÄ·∏§<90
√Üf        In the list of prime factors,
  ¬Ω       taking the square root of each element
   ·πÄ      then taking the largest element
    ·∏§     and doubling it
     <90  produces a result less than 90.
```
[Answer]
# Mathematica, ~~62~~ ~~58~~ 55 bytes
*The last three bytes saved are totally due to Martin Ender!*
```
#4<4||#<44*46&&#6[#^-1#4]&[Divisors[#][[6-4]],,,#,,#0]&
```
Unnamed function taking a positive integer argument and returning `True` or `False`.
Recursive algorithm, with `#4<4` being the truthy base case (we only need it to return `True` on the imput 1, but the extra base cases are fine). Otherwise, we compute the second-smallest divisor (which is necessarily prime) of the input with `Divisors[#][[6-4]]`; if it's greater than 2024 (`44*46`) then we exit with `False`, otherwise we call the function recursively (using `#6` set to `#0`) on the input divided by this small prime factor `#` (which we have to express as `#^-1` times the input `#4`, since `/` is disallowed).
Structurally, the first half `#4<4||#<44*46&&#6[#^-1#4]&` is an anonymous function of six arguments, being called with arguments `Divisors[#][[6-4]]`, `Null`, `Null`, `#`, `Null`, and `#0`; this is to get around the prohibition on the characters `2`, `3`, and `5`.
Previous version, which saved four bytes by replacing `8018-6000` with `44*46`, inspired by [ais523's Jelly answer](https://codegolf.stackexchange.com/a/105250/56178) (Martin Ender also seemed inspired by an ais523 comment):
```
#<4||Divisors[#][[6-4]]<44*46&&#0[Divisors[#][[6-4]]^-1#]&
```
This was pretty nasty: I still don't know a way to actually set a variable in Mathematica under these restrictions! Both `=` and the `e` in `Set` are disallowed. Avoiding `+` and `)` was also an issue, but not too hard to work around at the expense of more bytes.
[Answer]
# Haskell, ~~48~~ 47 bytes
```
\n->[snd$[product[1..44*46]^n]!!0`divMod`n]<[1]
```
Basically a translation of [Dennis‚Äô Jelly answer](https://codegolf.stackexchange.com/a/105253/3852). xnor saved a byte.
Uses `[‚Ä¶]!!0` as parentheses because `)` is banned, and `snd` + `divMod` because the `m` in `mod` and `rem` is banned.
[Answer]
## Pyke, ~~10~~ ~~8~~ ~~7~~ 9 bytes
```
P_Z|hwMX<
```
[Try it here!](http://pyke.catbus.co.uk/?code=P_Z%7ChwMX%3C&input=1)
Saved 1 byte by using Dennis's way of generating 2025
```
P         -     factors(input)
 _        -    reversed(^)
  Z|      -   ^ or 0
    h     -  ^[0] or 1
        < - ^ < V
     wM   -  ‚Å¥45 (ord("M")-32)
       X  -  ^**2
```
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), ~~9~~ 10 bytes
```
*$ph$r*<90
```
[Try it online!](https://tio.run/nexus/brachylog#@6@lUpChUqRlY2nw/78hAA)
Basically using the same algorithm as my other answer. `$ph` finds the first (`h`) prime factor (`$p`); this is the largest prime factor, as Brachylog's prime factor lists go from largest to smallest. Then I take the square root (`$r`), double (`*`), and test to see if it's less than 90 (`<90`).
I had to double the input first because 1 has no prime factors (and thus no first prime factor). This adds an extra prime factor of 2, which can't affect whether a number is 2017-friable, but prevents a failure when handling 1.
[Answer]
# [Actually](https://github.com/Mego/Seriously), 9 bytes
```
œÑyM:44u¬≤‚â•
```
Thanks to Dennis for lots of bytes!
[Try it online!](https://tio.run/nexus/actually#@3@@pdLXysSk9NCmR51L//83BAA "Actually ‚Äì TIO Nexus")
Explanation:
```
œÑyM:44u¬≤‚â•
œÑyM        largest prime factor of 2*input (doubled to deal with edge case of n = 1)
   :44u¬≤   2025 (2027 is the next prime after 2017, so any number in [2017, 2026] can be used here - 2025 is very convenient)
        ‚â•  is 2025 greater than or equal to largest prime factor?
```
[Answer]
## Mathematica, 66 74 bytes
*Thanks to Dennis for pointing out that `U+F4A1` is prohibited.*
```
Fold[Function[{x,d},And[x,Tr[Divisors@d^0]>6-4||d<44*46]],0<1,Divisors@#]&
```
Explanation:
`Divisors@#`: List of integer divisors of the first argument `#`.
`0<1`: Golf for `True` (also avoids the use of the letter `e`).
`Divisors@d^0`: List of the form `{1, 1, ..., 1}` with length equal to the number of divisors of `d`.
`Tr`: For a flat list, `Tr` returns the sum of that list. Thus `Tr[Divisors@d^0]` returns the number of divisors of `d`. 
`Function[{x,d},And[x,Tr[Divisors@d^0]>6-4||d<44*46]]`: Anonymous function with two arguments `x` and `d`. The idea is that `d` is a divisor of `#` and we test to see if it is either composite or less than or equal to `2017` (inclusive). `2017`-friability is equivalent to all the divisors satisfying this condition. As [ais523](https://codegolf.stackexchange.com/a/105250/61980) discovered, being a prime less than or equal to `2017` is equivalent to being a prime less than `2025`. As [Greg Martin](https://codegolf.stackexchange.com/a/105248/61980) pointed out, it suffices to test whether it is less than `2024=44*46`. The argument `x` acts as an accumulator for whether all of the divisors encountered so far satisfy this property. We then left [`Fold`](http://reference.wolfram.com/language/ref/Fold.html?q=Fold) this function through all of the divisors of `#` with starting value `True`, since we have access to neither `Map` nor `/@`.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 10 bytes
```
fŒ∏46n99-‚Ä∫√à
```
Returns 1 if true, 0 otherwise.
[Try it online!](https://tio.run/##MzBNTDJM/f8/7dwOE7M8S0vdRw27Dnf8/29kYGgOAA "05AB1E ‚Äì Try It Online")
**Explanation**
```
f          # Push the list of prime factors (ordered)
 Œ∏         # Get the last element
  46n99-   # Push 2017 (46¬≤ - 99)
        >  # Push 1 if the last prime factor is greater than 2017, 0 otherwise
         √à # Is the resulting number even ? Transforms 1 to 0 and 0 to 1.
           # Implicit display
```
[Answer]
# [MATL](https://github.com/lmendo/MATL), 15 bytes
```
t:\~ftZp*44QU<A
```
Outputs `0` for non-2017-friable or `1` for 2017-friable.
[Try it online!](https://tio.run/nexus/matl#@19iFVOXVhJVoGViEhhq4/j/v6GRsYmpmTkA "MATL ‚Äì TIO Nexus") Or [verify all test cases](https://tio.run/nexus/matl#U3L4X2IVU5dWElWgZWISGGrj@P9/tKGCkYKFgYKRgaE5iLAEEkbmCoYgoGBiamhhrGBoYGRsYqlgCQYKhkCOqZl5LAA).
[This program](https://tio.run/nexus/matl#@5@lAAKqCkGpiSkKOZl5qVxRBRARz2LdgqLM3FSFtNK85JLM/Lz//0usYurSSqIKtExMAkNtHAE) checks that all bytes are composite.
### Explanation
```
t       % Implicit input n. Duplicate
:       % Range [1 2 ... n]
\       % Modulo. Gives 0 for divisors of n
~f      % Indices of zero values
t       % Duplicate
Zp      % Is-prime. Gives 1 for primes, 0 for composites
*       % Multiply
44QU    % 44, add 1, square: 2025
<       % Less than, element-wise
A       % True (1) if all entries are nonzero
```
[Answer]
# Bash, 144 bytes
ASCII encoding:
```
{
printf '[ '
`tr D-Z _-z <<<KFH`tor $1|tr -d :|`tr B-Z _-z <<<JUH`p -o '[0-9]*$'
printf ' -lt $[24*86-46] ]'
}|tr \\n \ |`tr B-Z _-z <<<EDVK`
```
As usual for shell, the exit code indicates success (0) or failure (non-0).
This is effectively a different spelling of
```
[ factor $1|tr -d :|grep -o '[0-9]*$' -lt 2018 ]
```
We get the largest factor with `factor $1|grep -o '[0-9]*$'`; the `tr -d :` is to special-case for input = `1`.
The expression `$[6*6*69-466]` evaluates to 2018.
It was tricky to use `tr` for the command names and still use command substitution - I couldn't use the nesting form `$( )`, so I ended up piping into another Bash to evaluate the result.
Test results:
```
$ for i in 1 2 80 2017 2019 2027 11111 45183 102349 999999 1234567 4068289; do printf '%d %s\n' $i `./105241.sh $i  && echo true || echo false`; done
1 true
2 true
80 true
2017 true
2019 true
2027 false
11111 true
45183 false
102349 false
999999 true
1234567 false
4068289 true
```
Confirmation of character codes:
```
$ grep -v '^#' ./105241.sh | perl -n -Mutf8 -E '$a = ord, print `factor $a` for split //, $_' | grep -v ': .* ' | wc -l
0
```
[Answer]
# [Pyt](https://github.com/mudkip201/pyt), ~~21~~ 19 bytes
```
œº‚Üï1‚¶ã91+‚ÇÇ‚¨†1+ƒê1+‚¨†‚áπ‚ÇÇ->
```
[Try it online!](https://tio.run/##K6gs@f///J5HbVMNHy3rtjTUftTU9GjNAkPtIxOA7DULHrXvBIro2v3/bwoA "Pyt ‚Äì Try It Online")
This uses [Pyt's custom encoding](https://github.com/mudkip201/pyt/wiki/Codepage), in which all of the characters used are non-prime bytes. It returns `false` if the number IS 2017-friable, and `true` if it is not.
| code | action |
| --- | --- |
| `œº` | gets the unique prime factors of the input |
| `‚Üï1‚¶ã` | gets the largest of those |
| `91+‚ÇÇ‚¨†1+ƒê1+‚¨†‚áπ‚ÇÇ-` | pushes 2017 |
| `>` | is the largest prime factor greater than 2017?; implicit print |
 
[Answer]
# Pyth, 11 bytes
```
!s>R^h44h1P
```
[Try it online.](https://pyth.herokuapp.com/?code=%21s%3ER%5Eh44h1P&input=4068289&test_suite_input=1%0A2%0A80%0A2017%0A2019%0A2027%0A11111%0A45183%0A102349%0A999999%0A1234567%0A4068289&debug=0) [Test suite.](https://pyth.herokuapp.com/?code=%21s%3ER%5Eh44h1P&input=4068289&test_suite=1&test_suite_input=1%0A2%0A80%0A2017%0A2019%0A2027%0A11111%0A45183%0A102349%0A999999%0A1234567%0A4068289&debug=0)
Uses [Dennis's trick](https://codegolf.stackexchange.com/a/105253/30164) to get 2025, then checks if no prime factors of input are greater.
[Answer]
# [Julia 0.4](http://julialang.org/), ~~84~~ ~~38~~ 37 bytes
```
n->1^n:44*46|>prod|>t->t^n-t^n√∑n*n<1
```
Expects a *BigInt* as argument.
[Try it online!](https://tio.run/nexus/julia#FcRBCsIwFEXRsV3Fp1BIyg80IVoVDe5D7UBiSiavJWbYfbkAFxbbC/cEuhYopwecrW3tYXFzmvzisnJ5gFr/fdHiokuYEoEi6BVHcdds@Nix6XS/cVoxPeutp6x2tzlF5CDqZu9JOWo@D9RMYAoCUlZv@PIH "Julia 0.4 ‚Äì TIO Nexus") or [verify that no byte is prime](https://tio.run/nexus/julia#@5@bWKCRWVxQlJmbqqOQpJSna2cYl2dlYqJlYlZjV1CUn1JjV6JrVxKXpwvEh7fnaeXZGCppKtTYKRRn5Jf//w8A "Julia 0.4 ‚Äì TIO Nexus"). 
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 14 bytes
```
k √¶¬®44*46 ?0:1
```
Returns 1 if true, 0 if false.
Try it [here](http://ethproductions.github.io/japt/?v=1.4.3&code=ayDmqDQ0KjQ2ID8wOjE=&input=OTk5OTk5IA==).
[Answer]
# [Braingolf](https://github.com/gunnerwolf/braingolf), 11 bytes [very non-competing]
```
VRp#ﬂ¢-?0:1
```
[Try it online!](https://tio.run/##SypKzMxLz89J@/8/LKhA@f4iXXsDK8P///8bGoABAA "Braingolf ‚Äì Try It Online")
Unreadable due to the `ﬂ¢` which screws with the numbers, however still works in an interpreter.
I didn't even notice the character restrictions when I wrote this, but all I had to do was change the weird unicode character from 2017 to 2018.
Given 2018 is not a prime, any prime `<= 2018` is also `<= 2017`
### Explanation
```
VRp#ﬂ¢-?0:1  Implicit input from command-line args
VR            Create stack2, return to stack1
  p           Split last item into prime factors, push each one to stack in asc order
   #ﬂ¢         Push 2018
     -      Subtract last 2 items (highest prime factor - 2017)
      ?     If last item > 0..
       0    ..push 1
        :   Else..
         1  ..Push 1
            Implicit output of last item on stack
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt) [`-!`](https://codegolf.meta.stackexchange.com/a/14339/), 12 [bytes](https://en.wikipedia.org/wiki/UTF-8)
Japt gets jipped here 'cause `k` is our built-in for prime factors, and `#` converts characters to their codepoints.
```
√¢ fj d¬®44*46
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LSE&code=4iBmaiBkqDQ0KjQ2&input=NDA2ODI4OQ)
]