[Question]
  [
Given a *positive* integer as input, your task is to output a truthy value if the number is [divisible](https://en.wikipedia.org/wiki/Divisor) by the double of the sum of its digits, and a falsy value otherwise ([OEIS A134516](https://oeis.org/A134516)). In other words:
```
(sum_of_digits)*2 | number
```
* Instead of truthy / falsy values for the true and false cases, you may instead specify any finite set of values for the true/false case, and their complement the other values. For a simple example, you may use `0` for the true case and all other numbers for the false case (or vice versa, if you like).
* Standard input and output rules apply. Default Loopholes also apply.
* You can take input as an integer or as the string representation of that integer.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), hence the shortest code in bytes wins!
* I am new to PPCG, so I would like you to post an explanation if it's possible.
---
# Test Cases
```
Input - Output - (Reason)
80  - Truthy - (16 divides 80)
100 - Truthy - (2 divides 100)
60  - Truthy - (12 divides 60)
18 - Truthy - (18 divides 18)
12 - Truthy - (6 divides 12)
4 - Falsy - (8 does not divide 4)
8 - Falsy - (16 does not divide 8)
16  - Falsy  - (14 does not divide 16)
21 - Falsy - (6 does not divide 21)
78  - Falsy  - (30 does not divide 78)
110 - Falsy - (4 does not dide 110)
111 - Falsy - (6 does not divide 111)
390 - Falsy  - (24 does not divide 390)
```
  
[Answer]
## JavaScript (ES6), ~~31~~ ~~29~~ 27 bytes
Takes input as a string. Returns zero for truthy and non-zero for falsy.
```
n=>n%eval([...n+n].join`+`)
```
### Commented
```
n => n % eval([...n + n].join`+`)
n =>                                   // take input string n  -> e.g. "80"
                  n + n                // double the input     -> "8080"
              [...     ]               // split                -> ["8", "0", "8", "0"]
                        .join`+`       // join with '+'        -> "8+0+8+0"
         eval(                  )      // evaluate as JS       -> 16
     n %                               // compute n % result   -> 80 % 16 -> 0
```
### Test cases
```
let f =
n=>n%eval([...n+n].join`+`)
console.log('[Truthy]');
console.log(f("80"))
console.log(f("100"))
console.log(f("60"))
console.log(f("18"))
console.log(f("12"))
console.log('[Falsy]');
console.log(f("4"))
console.log(f("8"))
console.log(f("16"))
console.log(f("21"))
console.log(f("78"))
console.log(f("110"))
console.log(f("111"))
console.log(f("390"))
```
[Answer]
# [Neim](https://github.com/okx-code/Neim), 3 [bytes](https://github.com/okx-code/Neim/wiki/Code-Page)
```
ùê¨·ö´ùïû
```
Explanation:
```
ùê¨      Implicitly convert to int array and sum the digits
 ·ö´     Double
  ùïû   Is it a divisor of the input?
```
[Try it online!](https://tio.run/##ARUA6v9uZWlt///wnZCs4Zqr8J2Vnv//MTY "Neim ‚Äì Try It Online")
[Detailed version](https://tio.run/##y0vNzP3//8PcCWsezlr9Ye7Uef/PzQvWUEjJLMtMSS1W0HQKhsopg0TzgUJ5@SVQaSTZ/4ZmAA "Neim ‚Äì Try It Online")
[Answer]
# C#, 46 bytes
```
using System.Linq;n=>n%(n+"").Sum(c=>c-48)*2<1
```
Full/Formatted version:
```
using System;
using System.Linq;
class P
{
    static void Main()
    {
        Func<int, bool> f = n => n % (n + "").Sum(c => c - 48) * 2 < 1;
        Console.WriteLine(f(80));
        Console.WriteLine(f(100));
        Console.WriteLine(f(60));
        Console.WriteLine();
        Console.WriteLine(f(16));
        Console.WriteLine(f(78));
        Console.WriteLine(f(390));
        Console.ReadLine();
    }
}
```
[Answer]
# [Retina](https://github.com/m-ender/retina), ~~38~~ 27 bytes
-11 bytes and fixed an error with the code thanks to @MartinEnder
```
$
$_¬∂$_
.+$|.
$*
^(.+)¬∂\1+$
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7wX4VLJf7QNpV4Lj1tlRo9LhUtrjgNPW3NQ9tiDLVV/v@3MOAyNDDgMgNSZlzmFlzGlkCWIRBbAAA "Retina ‚Äì Try It Online")
Prints 1 if divisible, 0 otherwise
### Explanation (hope I got this right)
```
$
$_¬∂$_
```
Appends the entire input, plus a newline, plus the input again
```
.+$|.
$*
```
Converts each match to unary (either the entire second line which is the original input, or each digit in the first line)
```
^(.+)¬∂\1+$
```
Check if the first line (the doubled digit sum) is a divisor of the second line
[Answer]
# x86-64 Machine Code, 24 bytes
```
6A 0A 5E 31 C9 89 F8 99 F7 F6 01 D1 85 C0 75 F7 8D 04 09 99 F7 F7 92 C3
```
The above code defines a function in 64-bit x86 machine code that determines whether the input value is divisible by double the sum of its digits. The function conforms to the System V AMD64 calling convention, so that it is callable from virtually any language, just as if it were a C function.
It takes a single parameter as input via the `EDI` register, as per the calling convention, which is the integer to test. (This is assumed to be a *positive* integer, consistent with the challenge rules, and is required for the `CDQ` instruction we use to work correctly.)
It returns its result in the `EAX` register, again, as per the calling convention. The result will be 0 if the input value *was* divisible by the sum of its digits, and non-zero otherwise. (Basically, an inverse Boolean, exactly like the example given in the challenge rules.)
Its C prototype would be:
```
int DivisibleByDoubleSumOfDigits(int value);
```
Here are the ungolfed assembly language instructions, annotated with a brief explanation of the purpose of each instruction:
```
; EDI == input value
DivisibleByDoubleSumOfDigits:
   push 10
   pop  rsi             ; ESI <= 10
   xor  ecx, ecx        ; ECX <= 0
   mov  eax, edi        ; EAX <= EDI (make copy of input)
SumDigits:
   cdq                  ; EDX <= 0
   div  esi             ; EDX:EAX / 10
   add  ecx, edx        ; ECX += remainder (EDX)
   test eax, eax
   jnz  SumDigits       ; loop while EAX != 0
   
   lea  eax, [rcx+rcx]  ; EAX <= (ECX * 2)
   cdq                  ; EDX <= 0
   div  edi             ; EDX:EAX / input
   xchg edx, eax        ; put remainder (EDX) in EAX
   ret                  ; return, with result in EAX
```
In the first block, we do some preliminary initialization of registers:
* `PUSH`+`POP` instructions are used as a slow but short way to initialize `ESI` to 10. This is necessary because the `DIV` instruction on x86 requires a register operand. (There is no form that divides by an immediate value of, say, 10.)
* `XOR` is used as a short and fast way to clear the `ECX` register. This register will serve as the "accumulator" inside of the upcoming loop.
* Finally, a copy of the input value (from `EDI`) is made, and stored in `EAX`, which will be clobbered as we go through the loop.
Then, we start looping and summing the digits in the input value. This is based on the x86 `DIV` instruction, which divides `EDX:EAX` by its operand, and returns the quotient in `EAX` and the remainder in `EDX`. What we'll do here is divide the input value by 10, such that the remainder is the digit in the last place (which we'll add to our accumulator register, `ECX`), and the quotient is the remaining digits.
* The `CDQ` instruction is a short way of setting `EDX` to 0. It actually *sign-extends* the value in `EAX` to `EDX:EAX`, which is what `DIV` uses as the dividend. We don't actually need sign-extension here, because the input value is unsigned, but `CDQ` is 1 byte, as opposed to using `XOR` to clear `EDX`, which would be 2 bytes.
* Then we `DIV`ide `EDX:EAX` by `ESI` (10).
* The remainder (`EDX`) is added to the accumulator (`ECX`).
* The `EAX` register (the quotient) is tested to see if it is equal to 0. If so, we have made it through all of the digits and we fall through. If not, we still have more digits to sum, so we go back to the top of the loop.
Finally, after the loop is finished, we implement `number % ((sum_of_digits)*2)`:
* The `LEA` instruction is used as a short way to multiply `ECX` by 2 (or, equivalently, add `ECX` to itself), and store the result in a different register (in this case, `EAX`).
(We could also have done `add ecx, ecx`+`xchg ecx, eax`; both are 3 bytes, but the `LEA` instruction is faster and more typical.)
* Then, we do a `CDQ` again to prepare for division. Because `EAX` will be positive (i.e., unsigned), this has the effect of zeroing `EDX`, just as before.
* Next is the division, this time dividing `EDX:EAX` by the input value (an unmolested copy of which still resides in `EDI`). This is equivalent to modulo, with the remainder in `EDX`. (The quotient is also put in `EAX`, but we don't need it.)
* Finally, we `XCHG` (exchange) the contents of `EAX` and `EDX`. Normally, you would do a `MOV` here, but `XCHG` is only 1 byte (albeit slower). Because `EDX` contains the remainder after the division, it will be 0 if the value was evenly divisible or non-zero otherwise. Thus, when we `RET`urn, `EAX` (the result) is 0 if the input value was divisible by double the sum of its digits, or non-zero otherwise.
Hopefully that suffices for an explanation.  
This isn't the shortest entry, but hey, it looks like it beats almost all of the non-golfing languages! :-)
[Answer]
# [MATL](https://github.com/lmendo/MATL), 7 bytes
```
tV!UsE\
```
Outputs `0` if divisible, positive integer otherwise. Specifically, it outputs the remainder of dividing the number by twice the sum of its digits.
[**Try it online!**](https://tio.run/##y00syfmf8L8kTDG02DXmv0vIfwsDLkMDAy4zIGXBZWjEZcIFpMy4jAy5zIEMQ6CwoSGXsaUBAA "MATL ‚Äì Try It Online")
### Explanation
```
t   % Implicit input. Duplicate
V!U % Convert to string, transpose, convert to number: gives column vector of digits
s   % Sum
E   % Times 2
\   % Modulus. Implicit display
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~5~~ 4 bytes
-1 byte thanks to [Okx](https://codegolf.stackexchange.com/users/26600/okx)
```
SO¬∑√ñ
```
[Try it online!](https://tio.run/##MzBNTDJM/f8/2P/Q9sPT/v@3MAAA "05AB1E ‚Äì Try It Online")
You can also remove the last √ñ to get 0 for truthy and something else for falsy resulting in only 3 bytes but to me that just doesn't seem to appropriately fit the definition.
### Explanation
```
SO¬∑√ñ
SO    # Separate the digits and sum them
  ¬∑   # Multiply the result by two
   √ñ  # Is the input divisible by the result?
```
[Answer]
# [K (ngn/k)](https://gitlab.com/n9n/k), ~~15~~ 14 bytes
```
{(2*+/10\x)!x}
```
[Try it online!](https://tio.run/##y9bNS8/7/z/NqlrDSEtb39AgpkJTsaL2f5qChcF/AA "K (ngn/k) ‚Äì Try It Online")
---
0 is truthy
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~7~~ 4 bytes
Takes input as a string. Outputs `0` for `true` or a number greater than `0` for `false`, which, from other solutions, would appear to be valid. If not, let me know and I'll rollback.
```
%¬≤¬¨x
```
[Test it](http://ethproductions.github.io/japt/?v=1.4.5&code=JbKseA==&input=IjM5MCI=)
---
## Explanation
Implicit input of string `U`.  
`"390"`
```
¬≤
```
Repeat `U` twice.  
`"390390"`
```
¬¨
```
Split to array of individual characters.  
`["3","9","0","3","9","0"]`
```
x
```
Reduce by summing, automatically casting each character to an integer in the process.  
`24`
```
%
```
Get the remainder of dividing `U` by the result, also automatically casting `U` to an integer in the process. Implicitly output the resulting integer.  
`6 (=false)`
[Answer]
# C89, 55 53 bytes
(Thanks to Steadybox!
```
s,t;f(x){for(t=x,s=0;t;t/=10)s+=t%10;return x%(s*2);}
```
It takes a single input, `x`, which is the value to test. It returns 0 if `x` is evenly divisible by double the sum of its digits, or non-zero otherwise.
[Try it online!](https://tio.run/##jdLNTsMwDAfwc/MUVlGlBArEYeoKITtx5gl6gX5ApJFOjTtVmvbspc2QuAVOvvzkvx2nvv2o63n2OemOT@LU9QMnM@XeSE2a7g1K4W8MZSj10NI4OJgy7q@V0Of5yrp6PzYtPHtqbH/3uWPMOoKvN@v4sbeNYCcGAMlhJM/TF3u03r7v26dUaJYchsV2PM2aisyuoqW6NAcoZQ4dL6WIIJQBLSWmoAiqiCMsQ6syjlRAakW/G1XutSf4516wWVtsojEQZvljlCKMUkSRwhUpjKJtSNtG4xAvL43xeyBeVDTw4TH0WsqqWPLzoaRm5/kb "C (gcc) ‚Äì Try It Online")
**Ungolfed:**
```
/* int */ s, t;
/*int */ f(/* int */ x)
{
    for (t = x, s = 0; t /* != 0 */; t /= 10)
        s += (t % 10);
    return x % (s * 2);
}
```
As you can see, this takes advantage of C89's implicit-int rules. The global variables `s` and `t` are implicitly declared as `int`s. (They're also implicitly initialized to 0 because they are globals, but we can't take advantage of this if we want the function to be callable multiple times.)
Similarly, the function, `f`, takes a single parameter, `x,` which is implicitly an `int`, and it returns an `int`.
The code inside of the function is fairly straightforward, although the `for` loop will look awfully strange if you're unfamiliar with the syntax. Basically, a `for` loop header in C contains three parts:
```
for (initialization; loop condition; increment)
```
In the "initialization" section, we've initialized our global variables. This will run once, before the loop is entered.
In the "loop condition" section, we've specified on what condition the loop should continue. This much should be obvious.
In the "increment" section, we've basically put arbitrary code, since this will run at the end of every loop.
The larger purpose of the loop is to iterate through each digit in the input value, adding them to `s`. Finally, after the loop has finished, `s` is doubled and taken modulo `x` to see if it is evenly divisible. (A better, more detailed explanation of the logic here can be found in [my other answer](https://codegolf.stackexchange.com/a/129740/58518), on which this one is based.)
**Human-readable version:**
```
int f(int x)
{
    int temp = x;
    int sum  = 0;
    while (temp > 0)
    {
        sum  += temp % 10;
        temp /= 10;
    }
    return x % (sum * 2);
}
```
[Answer]
# APL, 13 bytes
```
{‚çµ|‚ç®2√ó+/‚çé¬®‚çï‚çµ}
```
Outputs `0` as a truthy value, and any other as falsy.
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 8 bytes
```
·∫π+√ó‚ÇÇ;I√ó?
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r//@GundqHpz9qarL2PDzd/v9/Q7P/AA "Brachylog ‚Äì Try It Online")
### Explanation
```
·∫π+           Sum the digits
  √ó‚ÇÇ         Double
    ;I√ó?     There is an integer I such that I√ó(double of the sum) = Input
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~34~~ 32 bytes
*-2 bytes thanks to @Rod*
```
lambda n:n%sum(map(int,`n`)*2)<1
```
[Try it online!](https://tio.run/##FctBCsIwEEbhvaf4N9JERkkr1FqqF1GhEQkONNNQ04WUnj3GzeNtvvCN71Gq5C73NFj/fFlIK9vP7JW3QbFE6qXXu0p3ZXLjBAYLbo0hlCan/k9NODWE49k82g0QpsxQLCv2VyxrccjO26iY4BRrnX4 "Python 2 ‚Äì Try It Online")
[Answer]
## Mathematica, 26 bytes
```
(2Tr@IntegerDigits@#)‚à£#&
```
No clue why `‚à£` has a higher precedence than multiplication...
[Answer]
# [PHP](https://php.net/), 41 bytes
prints zero if divisible, positive integer otherwise.
```
<?=$argn%(2*array_sum(str_split($argn)));
```
[Try it online!](https://tio.run/##K8go@G9jX5BRwKWSWJSeZ6tkaKBkzWVvBxS0BYuoahhpJRYVJVbGF5fmahSXFMUXF@RklmiAJTU1Na3//wcA "PHP ‚Äì Try It Online")
[Answer]
# Excel, 63 bytes
```
=MOD(A1,2*SUMPRODUCT(--MID(A1,ROW(OFFSET(A$1,,,LEN(A1))),1)))=0
```
Summing digits is the lengthy bit.
[Answer]
# [Perl 6](http://perl6.org/), 19 bytes
```
{$_%%(2*.comb.sum)}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/WiVeVVXDSEsvOT83Sa@4NFez9r@1QnFipUJ6UWoBUI2OQpyhgcF/AA "Perl 6 ‚Äì Try It Online")
[Answer]
## [Husk](https://github.com/barbuz/Husk), ~~9~~ 8 bytes
*Thanks to Leo for saving 1 byte.*
```
·π†¬¶»Ø*2·πÅis
```
[Try it online!](https://tio.run/##yygtzv6vkPuoqfH/w50LDi07sV7L6OHOxszi////Rxsa6Rha6JgZ6FgY6BgaGOiY6FjoGJrpGBnqmAMZhkBBQ0MdY0uDWAA "Husk ‚Äì Try It Online")
### Explanation
```
·π†¬¶»Ø         Test whether f(x) divides x, where f is the function obtained by
            composing the next 4 functions.
       s    Convert x to a string.
     ·πÅi     Convert each character to an integer and sum the result.
   *2       Double the result.
```
[Answer]
## [Haskell](https://www.haskell.org/), ~~38~~ ~~37~~ 42 bytes
*Thanks to Zgarb for golfing off 1 byte*
```
f x=read x`mod`foldr((+).(*2).read.pure)0x
```
[Try it online!](https://tio.run/##dcyxDoMgAATQ3a@4EAeQlGgHZbHfIgkQTVEMasrfU12c8Ma7lxvV9jXOpWQR@2CURhxmrwfrnQ6UciZo9WbiWsR6BMPqmGY1LeihPdYwLTtKEFnj9QEB56Db6H9nZ6@WsAJ3bt3InG7kg26zus3rLvvdnd/pDw "Haskell ‚Äì Try It Online")
Takes input as a string; returns 0 if divisible and nonzero otherwise.
[Answer]
## Python 3, 35 bytes
```
lambda a:a%(sum(map(int,str(a)))*2)
```
[Answer]
# TI-BASIC, ~~27~~ ~~26~~ 21 [bytes](http://tibasicdev.wikidot.com/one-byte-tokens)
-5 thanks to [@Oki](https://codegolf.stackexchange.com/users/60026/oki)
```
:fPart(Ans/sum(2int(10fPart(Ans10^(~randIntNoRep(1,1+int(log(Ans
```
This is made trickier by the fact that there is no concise way to sum integer digits in **TI-BASIC**. Returns `0` for `True`, and a different number for `False`.
Explanation:
```
:fPart(Ans/sum(2int(10fPart(Ans10^(-randIntNoRep(1,1+int(log(Ans
                               10^(-randIntNoRep(1,1+int(log(Ans #Create a list of negative powers of ten, based off the length of the input, i.e. {1,0.1,0.01}
                            Ans                                  #Scalar multiply the input into the list
                    10fPart(                                     #Remove everything left of the decimal point and multiply by 10
               2int(                                             #Remove everything right of the decimal point and multiply by 2
           sum(                                                  #Sum the resulting list
       Ans/                                                      #Divide the input by the sum
:fPart(                                                          #Remove everything left of the decimal, implicit print
```
[Answer]
# [Java (OpenJDK 8)](http://openjdk.java.net/), 40 bytes
```
i->i%(i+"").chars().map(k->k*2-96).sum()
```
[Try it online!](https://tio.run/##pY9NT8MwDIbv@xXWJKQE2qgtqGxD7MaBA@JQcUIcTNZu6UcSJe6kCe23lwQ2ThyQeKU4r53Yj9ziHlNja91uusmO772SIHv0Hp5QafiYQdCp7gkpXHujNjCEV1aRU3r7@gbotp6fPke1YaoYSfWiGbUkZbR41PSi0R2ebe2QjAML95NK1@qCqav5nAu5Q@cZFwNa1qXr7rJIlyUXfhwYn86D735BeHI1DhFQfTvTsEWWQJ6FUEazCKfgP61nfaEsF41xDyh3rDp4qkP7SKuVDZtRr/lfgTcJREqZQJEncBt9HtF5yK6X2X/gx9lx@gQ "Java (OpenJDK 8) ‚Äì Try It Online")
Returns 0 as truthy value and a value greater than 0 as falsy value.
[Answer]
# [Add++](https://github.com/cairdcoinheringaahing/AddPlusPlus), 11 bytes
```
L,EDEs;A@%!
```
[Try it online!](https://tio.run/##S0xJKSj4/99Hx9XFtdja0UFV8f///4YWAA "Add++ ‚Äì Try It Online")
First time I've used either a `L`ambda or `;` in an Add++ answer
## How it works
```
L,   - Create a lambda function. Example argument; 172
  ED - Push the digits;   STACK = [[1 7 2]]
  Es - Stack-clean sum;   STACK = [10]
  ;  - Double;            STACK = [20]
  A  - Push the argument; STACK = [20 172] 
  @% - Modulo;            STACK = [12]
  !  - Logical NOT;       STACK = [0]
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~6~~ 5 bytes
```
¬¶DŒ£d¬π
```
[Try it online!](https://tio.run/##yygtzv6f@6ip8f@hZS7nFqcc2vn///9oCwMdQwMDHTMgZaFjaKRjogOkzHSMDHXMgQxDoLChoY6xpUEsAA "Husk ‚Äì Try It Online")
-1 byte from Dominic Van Essen.
The existing answer doesn't use enough builtins, and Martin Ender is inactive, so I decided to post this.
[Answer]
# [Zsh](https://www.zsh.org/), 37 bytes
```
for ((;i++<19;a+=2*s[i]))s=$1;((s%a))
```
[Try it online!](https://tio.run/##DYi9CsMgEID3e4obLNzVxbMlTThDH6R0EKJEKA3EIaEvb52@n19dWyamlrcdibRYG2TSaGd/ra/yZq6zESWql8jcGI61fBLuKS546rJhRnNqCME8e31TGx2IczB0jCAe7tAxgBd4dJG@ReA2ufYH "Zsh ‚Äì Try It Online")
Outputs by exit code - 0 is falsey, 1 is truthy.
Explanation:
```
for ((;i++<19;a+=2*s[i]))s=$1;((s%a))    # i implicitly starts at 0
                         s=$1;           # set s to the input
for ((;                ))                # loop
          <19;                           #  while i is less than 19 (*)
       i++                               #  increment i
                   s[i]                  #  take the i'th character of s
                 2*                      #  doubled
              a+=                        #  add to a
                                s%a      # remainder of s divided by a
                              ((   ))    # output 0 if it's non-zero, 1 if it's zero
```
*(\*19 is the length of the maximum integer zsh can handle)*
[Answer]
# Swift, ~~53~~ 46 bytes
Takes in a `String` or [`Substring`](https://developer.apple.com/documentation/swift/substring) representing an integer in [1, 255].
```
{UInt8($0)!%($0.utf8.reduce(0){$0+$1-48}*2)<1}
```
[Try it online!](https://tio.run/##Ky7PTCsx@Z@TWqKQZqWgEVxSlJmXrqmga6fglJ@fo2D7vzrUM6/EQkPFQFNRFUjqlZakWegVpaaUJqdqGGhWqxhoqxjqmljUahlp2hjW/k/LL1LIVMjMUzDU09MzMjVVqOZSAIICoLElGkoxGpmaVgoxGmlQi4BcTU0lTa7a/wA)
Type information not included, since it could be either:
```
let f: (String) -> Bool = {UInt8($0)!%($0.utf8.reduce(0){$0+$1-48}*2)<1}
let g: (Substring) -> Bool = {UInt8($0)!%($0.utf8.reduce(0){$0+$1-48}*2)<1}
```
Swift [`Character`](https://developer.apple.com/documentation/swift/character) is... weird. It's not a single byte, like in C (that's [`CChar`](https://developer.apple.com/documentation/swift/cchar)), but it's also not a single Unicode codepoint (that's [`Unicode.Scalar`](https://developer.apple.com/documentation/swift/unicode/scalar)). Rather, it represents an [extended grapheme cluster](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries). This makes certain oprations substantially more painful, but others substantially easier. For this reason, I access the string's `utf8` property (which is a collection of `UInt8`).
`String` and `Substring` are collections of `Character`; however, they also have a lot more shared functionality than e.g. `[Character]` because they conform to [`StringProtocol`](https://developer.apple.com/documentation/swift/stringprotocol), and are in fact the only types that conform to it. I thought `StringProtocol` would work as the input type, but then the type checker times out.
For 49 bytes, here's a version that accepts integers in [1, 2^31 - 1] or [1, 2^63 - 1] depending on the machine:
```
{Int($0)!%($0.utf8.reduce(0){$0+Int($1)-48}*2)<1}
```
### Explanation/Ungolfed
```
{ (number: String) -> Bool in
    return
        UInt8(number)! // Convert String to UInt8, force-unwrap optional
            % (
                number.utf8 // Convert String to byte array
                    .reduce(0) { (prevResult: UInt8, nextChar: Character) -> UInt8 in
                        return prevResult + nextChar - 48
                        // Convert ASCII to number by subtracting 48; sum the results
                    } * 2
            ) == 0 // convert number to boolean
}
```
[Answer]
# [Braingolf](https://github.com/gunnerwolf/braingolf), ~~13~~ 12 bytes
```
VR.Mvd&+2*c%
```
[Try it online!](https://tio.run/##SypKzMxLz89J@/8/LEjPtyxFTdtIK1k17////xYGAA "Braingolf ‚Äì Try It Online")
Outputs 0 for truthy, any other number for falsey.
## Explanation
```
VR.Mvd&+2*c%  Implicit input from command-line args
VR            Create stack2, return to stack1
  .M          Duplicate input to stack2
    vd        Switch to stack2, split into digits
      &+      Sum up all digits
        2*    Double
          c   Collapse stack2 back into stack1
           %  Modulus
              Implicit output of last item on stack
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 7 bytes
```
vU√¨ x*2
```
Returns `1` for `true`, `0` for `false`
[Try it online!](https://tio.run/##y0osKPn/vyz08BqFCi2j//8NDQwA "Japt ‚Äì Try It Online")
## Explanation
```
vU√¨ x*2
v        // Return 1 if the input is divisible by:
 U√¨      //   Input split into a base-10 array
    x    //   Sum the array
     *2  //   While mapped by *2
```
[Answer]
# [Haskell](https://www.haskell.org/), 49 Bytes
```
f x=(==) 0.mod x.(*)2.sum.map(read.return).show$x
```
**Usage**
```
f 80
```
[Try it online!](https://tio.run/##ZcohDoAgGAbQ7im@YADDPySohcOwAZMp4EAnt8eO9e3tuhz2PFtzqIopxSEoJINKbOKSyhMo6Itlqw1lez85cip7esfagvYRCiYNwJV9vEFwGLEJdDKLHy3/tPQi517WDUP7AA)
[Answer]
# [Java](http://openjdk.java.net/), 66 bytes
-1 byte thanks to Olivier
```
a->{int i=0;for(int b:(""+a).getBytes())i+=b-48;return a%(i*2)<1;}
```
Ungolfed & explanation:
```
a -> {
    int i = 0;
    for(int b : (""+a).getBytes()) { // Loop through each byte of the input converted to a string
        i += b-48; // Subtract 48 from the byte and add it to i
    }
    return a % (i*2) < 1 // Check if a % (i*2) is equal to one
    // I use <1 here for golfing, as the result of a modulus operation should never be less than 0
}
```
]