[Question]
  [
Given a non-negative integer input, write a program that converts the number to hexadecimal and returns a truthy value if the hexadecimal form of the number contains only the characters `A` through `F` and a falsey value otherwise.
---
Test cases
```
10
==> True (A in hexadecimal)
100
==> False (64 in hexadecimal)
161
==> False (A1 in hexadecimal)
11259375
==> True (ABCDEF in hexadecimal)
0
==> False (0 in hexadecimal)
```
---
Bonus: **-40 bytes** if your program prints `Only letters` for the challenge described above, `Only numbers` if the hexadecimal version of the number only contains the digits `0-9` and `Mix` if the hexadecimal number contains at least one number and at least one letter.
---
This is code golf. Standard rules apply. Shortest code in bytes wins. Either functions or full programs are allowed.
  
[Answer]
# Pyth, 43 - 40 = 3 bytes
```
?&[[email protected]](/cdn-cgi/l/email-protection)"Mix"%"Only %sers"?K"lett""numb
```
[Test suite](https://pyth.herokuapp.com/?code=%3F%26K%40J.HQG-JG%22Mix%22%25%22Only+%25sers%22%3FK%22lett%22%22numb&test_suite=1&test_suite_input=10%0A100%0A161%0A11259375%0A0&debug=0)
This achieves the bonus. `Only numbers` and `Only letters` fortunately only differ by 4 letters. printf-style formatting is used with `%`.
The selection system is done by both taking the intersection of the hex with `G`, the alphabet, and subtracting out `G`. If neither ends up falsy, it's a mix, while if the intersection is falsy, it's numbers, and if the subtraction is falsy, it's letters.
[Answer]
# Pyth, 6 bytes
```
!-.HQG
  .HQ   # Converts the input to hexadecimal
 -   G  # Deletes all letters
!       # If empty, output True, else False
```
Test it [here](https://pyth.herokuapp.com/?code=%21-.HQG&debug=0)
[Answer]
# [Jelly](http://github.com/DennisMitchell/jelly), 6 bytes
```
b16>9P
```
[Try it online!](http://jelly.tryitonline.net/#code=YjE2PjlQ&input=&args=MTEyNTkzNzU)
### How it works
```
b16>9P  Input: z
b16     Convert the input to base 16.
   >9   Compare each resulting digit with 9; return 1 iff greater.
     P  Take the product of the resulting Booleans.
```
[Answer]
## Python, 24 bytes
```
lambda n:min('%x'%n)>'9'
```
Converts the input a hex string (without `0x` prefix) with `'%x'%n`. Sees if all its chars are greater than `'9'` (which letters are) by seeing if the `min` is above `'9'`.
[Answer]
# [TeaScript](https://github.com/vihanb/TeaScript), 11 bytes ~~13 15 16~~
```
xT(16)O(Sz)
```
Pretty simple. This uses TeaScript 2.0. You can get this version from the Github
## Explanation
```
        // Implicit: x = input, Sz = alphabet
xT(16)  // input -> hex
O(Sz)   // Only letters?
```
[Try it online](http://vihanserver.tk/p/TeaScript/#?code=%22xT(16)O(Sz,1)%22&inputs=%5B%2210%22%5D&opts=%7B%22int%22:true,%22ar%22:false,%22debug%22:false,%22chars%22:false,%22html%22:false%7D) (slightly modified version that works on web)
[Answer]
# [MATL](https://esolangs.org/wiki/MATL), 10
```
i16YA1Y2mA
```
### Examples
```
>> matl i16YA1Y2mA
> 240
0
>> matl i16YA1Y2mA
> 255
1
```
### Explanation
```
i       % input                         
16YA    % convert to string representation in base 16
1Y2     % predefined literal: 'A':'Z'
m       % true for set member             
A       % all
```
---
# Bonus challenge: 53−40 = 13
```
i16YA1Y2mXKA?'Only letters'}Ka?'Mix'}'Only numbers']]
```
### Examples
```
>> matl
 > i16YA1Y2mXKA?'Only letters'}Ka?'Mix'}'Only numbers']]
 > 
> 255
Only letters
>> matl
 > i16YA1Y2mXKA?'Only letters'}Ka?'Mix'}'Only numbers']]
 > 
> 100
Only numbers
>> matl
 > i16YA1Y2mXKA?'Only letters'}Ka?'Mix'}'Only numbers']]
 > 
> 240
Mix
```
### Explanation
```
i                       % input                                                 
16YA                    % convert integer to string representation in base 16
1Y2                     % predefined literal: 'A':'Z'
m                       % true for set member       
XK                      % copy to clipboard K                 
A                       % all                                   
?                       % if (top of the stack)                 
  'Only letters'        % string literal                                        
}                       % else                 
  K                     % paste from clipboard K      
  a                     % any                
  ?                     % if (top of the stack)      
    'Mix'               % string literal    
  }                     % else                                                  
    'Only numbers'      % string literal           
  ]                     % end             
]                       % end          
```
[Answer]
# LabVIEW, 52-40 = 12 [LabVIEW Primitives](http://meta.codegolf.stackexchange.com/a/7589/39490)
Praise the built-ins!
[![enter image description here](https://i.stack.imgur.com/IEQHv.gif)](https://i.stack.imgur.com/IEQHv.gif)
[Answer]
# C, ~~46~~ ~~43~~ 37 bytes
Now with more recursion! (Thanks Dennis):
```
F(x){return(x%16>9)*(x<16?:F(x/16));}
```
Bonus: even shorter (33 bytes), but fails for `x = 0`:
```
F(x){return!x?:(x%16>9)*F(x/16);}
```
---
```
b;F(x){for(b=x;x;x/=16)b*=x%16>9;return b;}
```
`F()` takes an `int` and returns either `0` (false) or non-zero (true).
I didn't even try to achieve the bonus, `"MixOnly lettersnumbers"` takes 23 bytes alone, tracking the new condition would have required 9 additional bytes, `printf()` is 8 bytes, which adds up to 40, nullifying the effort.
Test main:
```
#include <stdio.h>
int main() {
  int testdata[] = {10, 100, 161, 11259375, 0};
  for (int i = 0; i < 5; ++i) {
    int d = testdata[i];
    printf("%d (0x%x) -> %s\n", d, d, F(d)?"yep":"nope");
  }
}
```
[Answer]
# Python 3, ~~30~~ 29 bytes
1 byte stripped thanks to [sysreq](https://codegolf.stackexchange.com/users/46231/sysreq) and Python 3.
```
lambda n:hex(n)[2:].isalpha()
```
Simple `lambda` and slicing.
[Answer]
# [Perl 6](http://perl6.org), 18 bytes
```
{.base(16)!~~/\d/} # 18 bytes
```
usage:
```
# give it a name
my &code = {.base(16)!~~/\d/}
for 10, 100, 161, 11259375, 0 {
  printf "%8s %6s %s\n", $_, .base(16), .&code
}
      10      A True
     100     64 False
     161     A1 False
11259375 ABCDEF True
       0      0 False
```
[Answer]
## Mathematica, 32 bytes
```
Tr@DigitCount[#,16,0~Range~9]<1&
```
Explanation:
```
                               &   A function returning whether
Tr@                                 the sum of elements of
   DigitCount[ ,  ,         ]        the numbers of
                   0~Range~9          zeros, ones, ..., nines in
                16                    the hexadecimal expansion of
              #                       the first argument
                             <1     is less than one.
```
[Answer]
# Javascript, ES6, no regexp, 28 bytes
```
F=n=>n%16>9&&(n<16||F(n>>4))
```
There's also this 27-byte version but it returns the inverse value. 
```
F=n=>n%16<10||n>15&&F(n>>4)
```
[Answer]
# Julia, 18 bytes
```
n->isalpha(hex(n))
```
This is an anonymous function that accepts an integer and returns a boolean. To call it, give it a name, e.g. `f=n->...`.
The input is converted to a hexadecimal string using `hex`, then we check whether its entirely comprised of alphabetic characters using `isalpha`.
[Answer]
# JavaScript ES6, 29
No bonus
```
n=>!/\d/.test(n.toString(16))
```
With the new value of **-40** the bonus is nearer now ... but not enough. Bonus score 70 ~~71~~ - 40 => **30 ~~31~~**
```
n=>/\d/.test(n=n.toString(16))?1/n?'Only numbers':'Mix':'Only letters'
```
Test snippet (type a number inside the input box)
```
#I { width:50%}
```
```
<input id=I oninput="test()"/><br>
Hex <span id=H></span><br>
Result <span id=R></span>
```
[Answer]
# [GS2](http://github.com/nooodl/gs2), 6 bytes
```
V↔i/◙s
```
The source code uses the CP437 encoding. [Try it online!](http://gs2.tryitonline.net/#code=VuKGlGkv4peZcw&input=MTEyNTkzNzU)
### How it works
```
V       Evaluate the input.
 ↔      Push 16.
  i     Perform base conversion.
   /    Sort.
    ◙   Push [10].
     s  Perform greater-or-equal comparison.
```
[Answer]
# Octave, 22 bytes
```
@(n)all(dec2hex(n)>64)
```
[Answer]
# Ruby, 19 bytes
```
->n{!('%x'%n)[/\d/]}
```
**Ungolfed:**
```
-> n {
  !('%x'%n)[/\d/]
}
```
**Usage:**
```
f=->n{!('%x'%n)[/\d/]} # Assigning it to a variable
f[0]
=> false
f[10]
=> true
f[100]
=> false
f[161]
=> false
f[11259375]
=> true
```
**With bonus, 70 - 40 = 30 bytes**
```
->n{'%x'%n=~/^(\d+)|(\D+)$/;$1?'Only numbers':$2?'Only letters':'Mix'}
```
**Usage:**
```
f=->n{'%x'%n=~/^(\d+)|(\D+)$/;$1?'Only numbers':$2?'Only letters':'Mix'}
f[10]
=> Only letters
f[100]
=> Only numbers
f[161]
=> Mix
```
[Answer]
# Java, ~~46~~ ~~44~~ 38 bytes
```
i->i.toHexString(i).matches("[a-f]+");
```
Pretty simple one-liner that converts the integer to a hexadecimal string and uses regex to determine if all characters are letters.
-2 bytes thanks to @Eng.Fouad.
[Answer]
## CJam (9 8 bytes)
```
{GbA,&!}
```
[Online demo](http://cjam.aditsu.net/#code=%7BGbA%2C%26!%7D%0A%0A%5B10%20100%20161%2011259375%200%5D%25%60)
[Answer]
## Perl, 69 - 40 = 29 bytes
```
$_=sprintf"%X",<>;print s/\d//?$_?"Mix":"Only numbers":"Only letters"
```
[Answer]
## Ceylon, 55 bytes
```
Boolean l(Integer n)=>!any(formatInteger(n,16)*.digit);
```
Straightforward ... we format `n` as a hexadecimal number (which produces a string), call on each character of that string the `.digit` number (which returns true if it is a digit), then check whether any of them are true, then negate this.
The version with bonus has a lot higher score of **119 - 25 = 94**:
```
String c(Integer n)=>let(s=formatInteger(n),d=s*.digit)(every(d)then"Only numbers"else(any(d)then"Mix"else"Only letters"));
```
I'm not sure how anyone could make a bonus version short enough to be better than the no-bonus version, even those strings alone have length 28 together. Maybe a language which makes it really hard to produce a truthy/falsey value.
Here is a formatted version:
```
String c(Integer n) =>
        let (d = formatInteger(n,16)*.digit)
    (every(d) then "Only numbers"
                else (any(d) then "Mix"
                    else "Only letters"));
```
[Answer]
## Rust, 70 bytes
```
fn f(n:i32)->bool{format!("{:x}",n).chars().all(|c|c.is_alphabetic())}
```
Because, ya know, ~~Java~~ Rust.
It's actually quite elegant, though:
```
format!("{:x}", n)         // format n as hex (:x)
  .chars()                 // get an Iter over the characters
  .all(                    // do all Iter elements satisfy the closure?
    |c| c.is_alphabetic()  // self-explanatory
  )
```
But it's a shame the function definition boilerplate is so long.... :P
[Answer]
# CJam, 44 bytes - 40 bonus = 4 bytes
```
2,riGbAf/&:-"Only numbersOnly lettersMix"C/=
```
[Try it here~](http://cjam.aditsu.net/#code=2%2CriGbAf%2F%26%3A-%22Only%20numbersOnly%20lettersMix%22C%2F%3D&input=10)
[Answer]
## Seriously, 12 bytes
```
4ª,¡OkúOkd-Y
```
Hex Dump:
```
34a62cad4f6b
a34f6b642d59
```
[Try It Online](http://seriouslylang.herokuapp.com/link/code=34a62cad4f6ba34f6b642d59&input=255)
It's the same as the other stack language answers. It would be only 7 bytes if Seriously supported string subtraction yet. 
EDIT: Seriously now supports string subtraction and the following 7 byte solution now works:
```
ú4╙,¡-Y
```
Hex Dump:
```
a334d32cad2d59
```
[Try It Online](http://seriouslylang.herokuapp.com/link/code=a334d32cad2d59&input=100)
[Answer]
# Python 3, 28 bytes
```
lambda x:min(hex(x)[1:])>'@'
```
[Answer]
# Common Lisp, 40 bytes
```
(every'alpha-char-p(format()"~x"(read)))
```
[Try it online!](https://tio.run/##S87JLC74r1FQlJmX/F8jtSy1qFI9MacgI1E3OSOxSLdAIy2/KDexRENTqa5CSaMoNTFFU1Pzv@Z/QzNDAA)
[Answer]
# SmileBASIC 3.2.1, 78 bytes
```
INPUT V FOR I=0 TO 9
IF INSTR(HEX$(V),STR$(I))>-1 THEN ?"FALSE"END
NEXT?"TRUE"
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 2 bytes
Code:
```
ha
```
Ha! That is two bytes! ~~Sadly non-competing because this language postdates the challenge :(~~
Explanation:
```
h   # Convert input to hexadecimal
 a  # is_alpha, checks if the value only contains letters
```
[Try it online!](http://05ab1e.tryitonline.net/#code=aGE&input=MTEyNTkzNzU) or [Verify all test cases!](http://05ab1e.tryitonline.net/#code=W0lExb0KCj8iIHlpZWxkcyAiP2hhLAoKXQ&input=MTAKMTAwCjE2MQoxMTI1OTM3NQow)
[Answer]
# Japt, 12 bytes
```
!UsG r"[a-f]
```
[Try it online!](http://ethproductions.github.io/japt?v=master&code=IVVzRyByIlthLWZd&input=MTEyNTkzNzU=)
### How it works
```
!UsG r"[a-f] // Implicit: U = input integer, G = 16
 UsG         // Convert U to a base-16 string.
     r"[a-f] // Replace all lowercase letters with an empty string.
!            // Take the logical NOT of the result.
             // This returns true for an empty string; false for anything else.
```
[Answer]
# Gema, 41 characters
```
*=@c{@radix{10;16;*}}
c:<D>=f@end;?=;\Z=t
```
There is no boolean in Gema, so it simply outputs “t” or “f”.
Sample run:
```
bash-4.3$ echo -n '11259375' | gema '*=@c{@radix{10;16;*}};c:<D>=f@end;?=;\Z=t'
t
```
]