[Question]
  [
# It's all in the title...
Take as input a positive integer `n>=12` and... do what the title says.
Yes, this is on OEIS [A187924](https://oeis.org/A187924).
**Some test cases**
```
12 -> 912  
13 -> 11713  
14 -> 6314  
15 -> 915  
16 -> 3616  
17 -> 15317  
18 -> 918  
19 -> 17119 
20 -> 9920  
40 -> 1999840   
100-> 99999999999100
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"). Shortest code in bytes wins!
  
[Answer]
# Befunge, 81 bytes
```
&>00p0v<!%g0<
v%"d":_>1+:0^
>00g->#^_:0v
0g10g-#^_.@1>
>0p:55+/\:v>
^1+g01%+55_$^
```
[Try it online!](http://befunge.tryitonline.net/#code=Jj4wMHAwdjwhJWcwPAp2JSJkIjpfPjErOjBeCj4wMGctPiNeXzowdgowZzEwZy0jXl8uQDE+Cj4wcDo1NSsvXDp2PgpeMStnMDElKzU1XyRe&input=NDA)
Can handle up to *n* = 70 at least, after which some values will start overflowing the stack cell size on most implementations, and on those that don't, it'll take so long that it's not worth waiting to find out.
Given those constraints, we don't even bother trying to handle values of *n* greater than 99, which means we can more easily test if the value ends in *n* with by simply comparing the value modulo 100 with *n*.
Below is more detailed breakdown of the code.
![Source code with execution paths highlighted](https://i.stack.imgur.com/n3yFY.png)
![*](https://i.stack.imgur.com/jmV4j.png) Read *n* from stdin and save in memory.  
![*](https://i.stack.imgur.com/z4eIY.png) Initialize the test value *v* to 0 and start the main loop, incrementing *v* up front.  
![*](https://i.stack.imgur.com/RFUim.png) Test if `v%n == 0`, and if not return to the start of the main loop.  
![*](https://i.stack.imgur.com/BX1CZ.png) Test if `v%100 == n`, and if not return to the start of the main loop.  
![*](https://i.stack.imgur.com/aZli8.png) Sum the digits in *v* by repeatedly adding *v* modulo 10 and dividing *v* by 10.  
![*](https://i.stack.imgur.com/xap31.png)
[Answer]
## JavaScript (ES6), ~~55~~ 54 bytes
```
f=(s,p=0,a=p+s)=>a%s|eval([...a].join`+`)-s?f(s,p+1):a
```
```
<input type=number min=12 oninput=o.textContent=f(this.value)><pre id=o>
```
Takes input as a string. Needs a browser with tail recursion support for the larger results. Edit: Saved 1 byte thanks to @Arnauld.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 14 bytes
```
[NI«ÐIÖsSOIQ*#
```
[Try it online!](https://tio.run/##MzBNTDJM/f8/2s/z0OrDEzwPTysO9vcM1FL@/9/EAAA "05AB1E – Try It Online")
**Explanation**
Solutions requiring large prefixes will time out on TIO
```
[                # start a loop
 NI«             # append input to current iteration number
    Ð            # triplicate
     IÖ          # is the first copy evenly divisible by input?
       sSOIQ     # is the digit sum of the second copy equal to the input?
            *    # multiply
             #   # if true, break loop
                 # output the third copy
```
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog) v2, ~~12~~ 10 bytes
```
a₁.;A×?≜ẹ+
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/pf96htw6Omxoe7Ov8nAmk9a8fD0@0fdc55uGun9v//hpYA "Brachylog – Try It Online")
This is a function submission that takes input via `.` and produces output via `?` (the opposite of the normal convention; all Brachylog functions have exactly two arguments, which can be input or output arguments, but the language doesn't enforce any particular argument usage). We [don't normally consider conventions for argument usage to be relevant at PPCG](https://codegolf.meta.stackexchange.com/a/11909).
## Explanation
A previous version of this solution had a special case (`Ḋ|`, i.e. "return digits literally") for single digits, but the question apparently states that you don't have to check for that (thanks @DLosc for catching this), so I removed it. (The solution as written won't work on single digits as Brachylog won't consider 1 as a possibility for an unknown in a multiplication, to prevent infinite loops; its multiplications are arbitrary-arity.)
So this answer now goes for a pretty much direct translation of the specification. Starting with `?` (the output / number we're trying to find; a Brachylog predicate always implicitly starts with `?`) we use `a₁.` to assert that it has `.` (the input) as a suffix. Then `;A×?` means that we can multiply (`×`) the result by something (`;A`) to produce `?` (the output). Finally, `ẹ+` sums (`+`) the digits (`ẹ`) of `?`, and there's by default an implicit assertion at the end of every Brachylog program that the final result produces `.`. So in other words, this program is "`.` is a suffix of `?`, `.` multiplied by something is `?`, `.` is the digit sum of `?`", which is very close to a literal translation of the original program.
The `≜` is necessary for the digit sum requirement to be enforced. I assume something about `ẹ` doesn't like unknowns, so the `≜` tells Brachylog to use a brute-force approach for that part of the program rather than algebra.
[Answer]
# [Haskell](https://www.haskell.org/), 72 bytes
```
f n=[x|x<-[n,n+lcm n(10^length(show n))..],sum[read[j]|j<-show x]==n]!!0
```
[Try it online!](https://tio.run/##HclBDoMgEADAr6xJDxCUoOlRntAXbLYJabFoYTViUw7@nSad6wSX3z7GWidgi@UsY4fcsoqPBCx6c4@eX0cQOaxfYCm1pjZ/Eu7ePXGhcxm7fxWylqlpTE1uZrCQ3HYDse0zH6BhknAB7AetB0OgFODVUP0B "Haskell – Try It Online")
Note that the found number minus n must be a multiple of both n and 10^length(n).
Inspired by Laikoni and totallyhuman
[Answer]
## [Alice](https://github.com/m-ender/alice), 35 bytes
```
/o
\i@/!w?+.?~\ & /-$K..?\ L z $ /K
```
[Try it online!](https://tio.run/##S8zJTE79/18/nysm00FfsdxeW8@@LkZBTUFfV8VbT88@RsFHoUpBRUHf@/9/Q0sA "Alice – Try It Online")
### Explanation
This program has a really nice mix and interaction between Cardinal (integer-processing) and Ordinal (string-processing) mode.
The usual framework for challenges with decimal I/O which operate largely in Cardinal mode:
```
/o 
\i@/...
```
And the actual program:
```
!     Store the input N on the tape.
      We'll use an implicit zero on top of the stack as our iterator variable X,
      which searches for the first valid result.
w     Store the current IP position on the return address stack. This marks
      the beginning of the main search loop. We can avoid the divisibility
      test by going up in increments of N. To check the other two 
      conditions, we'll use individual conditional loop ends that skip to 
      the next iteration. Only if both checks pass and all loop ends are 
      skipped will the search terminate.
  ?+    Increment the iterator X by N.
  .     Duplicate X.
  ?~    Put a copy of N underneath.
  \     Switch to Ordinal mode.
  &     Implicitly convert X to a string, then fold the next command over its
        characters, i.e. its digits. Here, "fold" means that each character
        is pushed to the stack in turn, followed by one execution of that
        next command.
  /     Switch back to Cardinal mode (this is not a command).
  -     Fold subtraction over the digits. This implicitly converts each 
        digit back to its numerical value and subtracts it from N. If the
        digit sum of X is equal to N, this will result in 0.
  $K    Jump back to the w if the digit sum of X isn't N.
  ..    Duplicate X twice.
  ?     Get a copy of N.
  \     Switch to Ordinal mode.
  L     Shortest common superstring. Implicitly converts X and N to strings
        and gives the shortest string that starts with X and ends with N. 
        This will be equal to X iff X already ends with N. Call this Y.
  z     Drop. If X contains Y, this deletes everything up to and including
        Y from X. This can only happen if they are equal, i.e. if X ended
        with N. Otherwise X remains unchanged.
  $     Skip the next command if the string is empty, i.e. if X ended with N.
  /     Switch back to Cardinal mode.
  K     Jump back to w if X didn't end with N.
```
[Answer]
# [Java (OpenJDK 8)](http://openjdk.java.net/), ~~136~~ ~~110~~ ~~103~~ 92 bytes
*-26 thanks to JollyJoker*
*-7 again thanks to JollyJoker*
*-11 thanks to Oliver Grégoire*
```
a->{for(int i=a;!(""+a).endsWith(""+i)|i!=(""+a).chars().map(x->x-48).sum();a+=i);return a;}
```
[Try it online!](https://tio.run/##hc7NbsIwDAfwe5/CcEqEGj5WGFNU3gAuHHaYdvDaMMzatEpSxMT67F3a9TpysWT7J/t/wSvGVa30Jf/qsgKthT2SvkcApJ0yJ8wUHPp2GIBifUUu/aSNfLEOHWVwAA0pdBjv7qfKDIhSlBM2nc6QC6Vz@0ru3LfEf2iSjovsjMYyLkqs2S3e3eJky4VtSsYlzlLi0ijXGA0o205GdfNR@Gfjz2tFOZQ@LTs6Q/rz7d0H@4t6/LZOlaJqnKj9yhWaaaHYcsWH5P@DpxBIQmAdApsQeA6BbQi8BMBqEQDJAObzR08W45E2artf "Java (OpenJDK 8) – Try It Online")
Gotta love Java! It could well be that I am using an inefficient approach, but not having a built in checksum function and the double conversion to String to check for the end of the number costs bytes...
Ungolfed:
```
  a->{                                                       //input n (as integer)
      for (int i = a;                                        //initiate loop
           !("" + a).endsWith("" + i)                        //check if the calculated number ends with the input
           | i != ("" + a).chars().map(x -> x - 48).sum();   //check if the checksum is equal to the input
           a += i)                                           //for every iteration, increase i by the input to save checking for divisibility
        ;                                                    //empty loop body, as everything is calculated in the header
    return a;                                                //return number
}
```
[Answer]
# Mathematica, 72 bytes
```
(t=#;While[Mod[t,10^IntegerLength@#]!=#||Tr@IntegerDigits@t!=#,t+=#];t)&  
```
*-18 bytes from @MartinEnder*
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b7X6PEVtk6PCMzJzXaNz8lukTH0CDOM68kNT21yCc1L70kw0E5VtFWuaYmpMgBKu6SmZ5ZUuxQAhTWKdG2VY61LtFU@x9QlJlX4pAWbWgUywVnmyPYxgYItrlp7H8A "Wolfram Language (Mathematica) – Try It Online")
Here is another version from Martin Ender  
This approach can go up to `n=40` (41 exceeds the default iteration limit)
# Mathematica, 65 bytes
```
#//.t_/;Mod[t,10^IntegerLength@#]!=#||Tr@IntegerDigits@t!=#:>t+#&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b7X1lfX68kXt/aNz8lukTH0CDOM68kNT21yCc1L70kw0E5VtFWuaYmpMgBKu6SmZ5ZUuxQAhS2sivRVlb7H1CUmVfikBZtYhD7HwA "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~20 19~~ 17 bytes
```
ḟȯ=⁰Σdfȯ€d⁰ṫdm*⁰N
```
Thanks @Zgarb for -2 bytes!
[Try it online!](https://tio.run/##yygtzv7//@GO@SfW2z5q3HBucUraifWPmtakADkPd65OydUCMvz@//9vaAQA "Husk – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 74 bytes
This solution assumes that `n <= sys.maxint`.
```
n=x=input()
while sum(map(int,str(x)))-n*str(x).endswith(`n`):x+=n
print x
```
**[Try it online!](https://tio.run/##JcpLCoAgEADQvadwOdMPql3gXQoSFHIadEQ7vQXt3uLxI@6mpTUy1XjiLICqOH9ZnXKAcDB4kiFJhIqII3U/J0tnKl4c7LTjVntDiuNXdW1tXl8 "Python 2 – Try It Online")**
[Answer]
# C (gcc) ~~71~~ 69 bytes , fails on 100
I tried with long and %1000 but times out
-2 bytes thanks to steadybox
```
s,i,j;f(n){for(j=0;s^n|j%100!=n;)for(s=0,i=j+=n;i;i/=10)s+=i%10;j=j;}
```
[Try it online](https://tio.run/##HY3LCsIwEEX38xW1EGloiplaXwzxS0QoKZUJOErjTuuvx8blPRzO9c3N@5SiYRNorES/x8dUBWcpXuUTFFq7ckI60@isYRfqZTPxxqHVsXa8OBRcoDnde5acgGzTN/pexqpUQ2nWoknDc2J5/UnRnAs1XKQ0YvKrJpgTtoBbwA5wB7gHPAAeAU/Q2gI6@wM)
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), 90 84 83 + 18 = 101 bytes
```
using System.Linq;
n=>{for(int i=n;!(""+n).EndsWith(""+i)|n%i>0|(""+n).Sum(c=>c-48)!=i;n++);return n;}
```
[Try it online!](https://tio.run/##lVBNSwMxEL3nV0wXhIS1S1sKVtIsiOhJQeihB/EQ0mwN7E40yQrS9revs26x7dE5TGYm7735MHFsfLBdGx1uYfUdk22KJ4efkjHUjY0f2li4my5ubmdztmNAZmodI7wEvw26@a0M9d5i0skZ@PJuA8/aIY8pkPLrG@iwjeIPd2L0duz72KJZOkzXQK6EChRgW9fyAlupDlW5q3zghAKnUI54luUoigfcxLVL733qxB6vXDnZH/9WbcONKs14vhAj5STmuZDBpjYgoDx0tO9FFx9g0KchpjNJ71LBbEIBES@gZwvce4y@tsU6uGTpipZnx9PxDHLSyCETJNgnFXdCSPY/lfnkRKf4jH9ggz@w7gc "C# (.NET Core) – Try It Online")
* 6 bytes saved thanks to Emigna and my uncanny ability to write `(""+n)` in some places and `n.ToString()` in others.
[Answer]
# [Ohm v2](https://github.com/nickbclifford/Ohm), 16 bytes
```
£^›u³↔ξ³¥s}Σ³E*‽
```
[Try it online!](https://tio.run/##AScA2P9vaG0y///Co17igLp1wrPihpTOvsKzwqVzfc6jwrNFKuKAvf//MTM "Ohm v2 – Try It Online")
[Answer]
# JavaScript REPL (ES5), ~~60~~ 59 bytes
```
for(n=prompt(i=0);eval([].join.call(t=++i+n,'+'))-n|t%n;);t
```
[Answer]
# [Thunno 2](https://github.com/Thunno/Thunno2), 12 [bytes](https://github.com/Thunno/Thunno2/blob/main/docs/codepage.md)
```
ƘS=n$Ḋn$ø>&&
```
[Try it online!](https://Not-Thonnu.github.io/run#aGVhZGVyPSZjb2RlPSVDNiU5OFMlM0RuJTI0JUUxJUI4JThBbiUyNCVDMyVCOCUzRSUyNiUyNiZmb290ZXI9JmlucHV0PTEyJTIwLSUzRSUyMDkxMiUwQTEzJTIwLSUzRSUyMDExNzEzJTBBMTQlMjAtJTNFJTIwNjMxNCUwQTE1JTIwLSUzRSUyMDkxNSUwQTE2JTIwLSUzRSUyMDM2MTYlMEExNyUyMC0lM0UlMjAxNTMxNyUwQTE4JTIwLSUzRSUyMDkxOCUwQTE5JTIwLSUzRSUyMDE3MTE5JTBBMjAlMjAtJTNFJTIwOTkyMCZmbGFncz1D)
#### Explanation
```
ƘS=n$Ḋn$ø>&&  # Implicit input
Ƙ             # First positive integer where:
 S=           #  Digit sum equals input
   n$      &  #   AND
     Ḋ        #  Divisible by input
      n$  &   #   AND
        ø>    #  Ends with input
              # Implicit output
```
[Answer]
# Julia, 70 bytes
```
f(x)=(n=x;while(sum(digits(n))!=x||x!=n%(10^length("$x")));n+=x;end;n)
```
[Answer]
# [Pip](https://github.com/dloscutoff/pip), 18 bytes
```
T!y%a&$+y=aY++i.ay
```
Algorithm inspired by [Emigna's answer](https://codegolf.stackexchange.com/a/149204/16766). [Try it online!](https://tio.run/##K8gs@O@mkKhgaKQQo6NgZKBQzaUQoJCoV6ynUf0/RLFSNVFNRbvSNjFSWztTL7Hyv0KtQqIml0KmgpWCAZdCpIKSElftfwA "Pip – Try It Online")
### How it works
```
                    a is 1st cmdline arg, i is 0, y is "" (implicit)
T                   Loop until
 !y%a&              y%a is 0 and
      $+y=a         sum of y is a:
            ++i      Increment i
           Y   .a    and yank (i concat a) into y
                 y  After the loop exits, autoprint y
```
[Answer]
## Scala, 120 bytes
```
def a(n:Int)={val b=math.pow(10,math.ceil(math.log10(n))).##;var c=b+n;while(c%n!=0||(0/:c.toString)(_+_-'0')!=n)c+=b;c}
```
This works until `n = 70`, after which integers overflow. For one extra character, the `Int` can change to a `Long` and allow values for `n > 100` to be computed. 
Here is the slightly longer ungolfed version:
```
def golfSourceLong(n: Long): Long = {
  val delta = math.pow(10, math.ceil(math.log10(n))).toInt
  var current = delta + n
  while (current % n != 0 || current.toString.foldLeft(0)(_ + _ - '0') != n) {
    current += delta
  }
  current
}
```
[Answer]
# [Python 2](https://docs.python.org/2/), 70 bytes
```
f=lambda n,x=0:x*(x%n<sum(map(int,`x`))==n==x%10**len(`n`))or f(n,x+n)
```
[Try it online!](https://tio.run/##DYtBCoAgEAC/0kVYrYN2K9q/aJQU6CpmsL3ePM4wk796JZpb8xhc3A830MSoV1bAgrbnjRBdhpvqZNlKiUiILIxWKpwElrpLZfDQt5Fky6WnHc0i2w8 "Python 2 – Try It Online")
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 16 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
è}╘⌐ƒw┴L≤⌂IÑ═eαü
```
[Run and debug it](https://staxlang.xyz/#p=8a7dd4a99f77c14cf37f49a5cd65e081&i=12)
[Answer]
# [Haskell](https://www.haskell.org/), 75 bytes
```
f n=[x|x<-[0,n..],sum[read[d]|d<-show x]==n,mod x(10^length(show n))==n]!!0
```
[Try it online!](https://tio.run/##PYtbCoMwFET/s4or9EPBSOI7YLoRsSCoVaqxqKWB2rXbmwjNz5yTmdvX66Mdx@PoQMlS77qgJfNVEFT@@prKpa2bsqn2pqBrP79BV1Iqf5ob0C5nt7FV9613baU8D7vKcdgx1YMCCc9lUBtcoIOYkQ8lPAR6BYEBhEeGOc8Q0GJjaYSJkpyzxHBqOEoxUTJ7k0QIaPk5yw0L22QcgYTMFgITSGyFCyFyRDNlzLb/hx@Efo8f "Haskell – Try It Online")
**Explanation:**
```
f n=[x|                                      ]!!0 -- Given input n, take the first x
       x<-[0,n..],                                -- which is a multiple of n,
                  sum[read[d]|d<-show x]==n,      -- has a digital sum of n
                  mod x(10^length(show n))==n     -- and ends in n.
```
I wonder whether the "ends in `n`" part can be shortened. I also tried `show n`elem`scanr(:)""(show x)`, but it's longer.
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~65 63 54~~ 53 bytes
```
->n{a=n;a+=n until/#{n}$/=~a.to_s&&a.digits.sum==n;a}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y6vOtE2zzpR2zZPoTSvJDNHX7k6r1ZF37YuUa8kP75YTS1RLyUzPbOkWK@4NNcWpLT2f0FpSbFCWrShUSwXjGkOZxobwJkmBrH/AQ "Ruby – Try It Online")
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), ~~22~~ 21 bytes
```
fq2-/,%T^;l`QsjT;Q%TQ
```
**[Try it here!](https://pyth.herokuapp.com/?code=fq2-%2F%2C%25T%5E%3Bl%60QsjT%3BQ%25TQ&input=13&debug=0)**
[Answer]
# [Haskell](https://www.haskell.org/), 75 bytes
```
f n=[i|i<-[n,n+10^length(show$n)..],i`mod`n<1,sum[read[j]|j<-show$i]==n]!!0
```
[Try it online!](https://tio.run/##HcpBDoMgEADAr6yJBw1IwPQIT/AFGxpJxIKF1YhNL/6dJp3zBFfePqVaVyCD8Y56QOLElHwmT68rdCXs35Z6ISyPc96XmbTi5ZPx9G7Bzd6bHv4nWmPINo2s2UUCA9kdE3THGekCAWsPLaAahRilBcYAH9LWHw "Haskell – Try It Online")
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 84 bytes
```
for($n=$i=$args[0];$i%$n-or$i-notmatch"$n$"-or([char[]]"$i"-join'+'|iex)-$n){$i++}$i
```
[Try it online!](https://tio.run/##DchBCoMwEAXQu4RfVEKggrviSUIWQWIzojNlFCy0PfvUt3wvOYvutayr2SzagkfQiKzPPd7TA3QDB1FQYDm2fEzVgeGuauNUs8aUHMiFRYgb33ypvLsA7j4g738gM@uHPw "PowerShell – Try It Online")
Simple construction but lengthy commands. Times out on TIO for `n=100`, but if we explicitly set `i` to be close, [it outputs correctly.](https://tio.run/##RchBCoMwEAXQu4RfVEIgXQbxJCGLIGkzxc6UKFhoe/bRXd/yvWQvba1lWVRBU/jzIYw3aT14Qm73Nfo0gi5gJw3kWLZn3uZqwDBn9XGuucWUDMi4hxB3tvtSeQ8OPHxA1v5Aqnr1/gA "PowerShell – Try It Online")
This is just a simple `for` loop that keeps going so long as any one of the conditions is true. The three conditions are 1) `$i%$n`, i.e., we have a remainder; 2) `$i-notmatch"$n$"`, i.e., it doesn't regex match the last couple of digits; and 3) `([char[]]"$i"-join'+'|iex)-$n`, i.e., the digits summed together is not equal to `$n` (here checked by simple subtraction, since nonzero values are truthy). Inside the loop we're simply incrementing `$i`.
Thus, if we don't have a remainder, the regex matches, and the numbers are equal, all three conditions are `$false` and we exit the loop. As a result, we just can leave `$i` on the pipeline, and output is implicit.
[Answer]
# PHP, 73+1 bytes
```
while(array_sum(str_split($i+=$n=$argn))-$n|$i%10**strlen($n)-$n);echo$i;
```
Run as pipe with `-R`.
loops `$i` through multiples of `<input>` until `sum_of_digits-<input>` and `tail_of_i-$n` are falsy;
then prints `i`.
[Answer]
# m4, 210 bytes
```
define(d,define)d(i,ifelse)d(s,`i($1,,0,`eval(substr($1,0,1)+s(substr($1,1)))')')d(k,`r($1,eval($2+1))')d(r,`i(s($2),$1,i(regexp($2,$1$),-1,`k($1,$2)',i(eval($2%$1),0,$2,`k($1,$2)')),`k($1,$2)')')d(f,`r($1,1)')
```
Defines a macro `f` which computes the answer. It's a bit slow—unusably so—but I promise it works.
I thought m4 would be nice because it treats integers as strings by default, but this is pretty bad.
[Answer]
# [R](https://www.r-project.org/), 115 bytes
```
function(n,d=nchar(n):1){while(sum(D<-F%/%10^((k=nchar(F)):1-1)%%10)-n|any(D[k-d+1]-n%/%10^(d-1)%%10)|F%%n)F=F+n
F}
```
[Try it online!](https://tio.run/##NcrBCoJAEAbgu0/hZWAGHXKhU@hN5iWiQFwXxfoFSyKyZ9882PXjm2NIS41hQfscJjByX6Htm5khJyefVz/cOn4sd65LNTqQK67M435MtqROaGNRrA3eXJ9H9Zm7KPbt/2E1IohVliGxbwx8LCT@AA "R – Try It Online")
Terrible R function. Increments `F` (starts at `0`) by `n` until a value is found that satisfies the required properties, which it then returns. The use of `any` on a `double` expression sends out a warning for each iteration of the loop, but does not affect the correctness.
Times out on TIO for large enough inputs (n=55 or higher) but should correctly compute the solution given enough time/space.
[Answer]
# Perl 5, ~~46~~ 44 + 1 ( -p ) = 45 bytes
2 bytes saved thanks to Xcali, couldn't find better
```
($\=++$t.$_)%$_|$_-eval$\=~s//+/gr.0&&redo}{
```
first answer
```
$\=++$x.$_;eval$\=~s//+/gr."-$_"|$\%$_&&redo}{
```
[Try it online](https://tio.run/##K0gtyjH9/19DJcZWW1ulRE8lXlNVJb5GJV43tSwxByhaV6yvr62fXqRnoKZWlJqSX1v9/7@h8b/8gpLM/Lzi/7oFAA)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~22~~ 21 bytes
```
DS=³a³ḍaDṫ³DLC¤Ḍ=³ø1#
```
[Try it online!](https://tio.run/##y0rNyan8/98l2PbQ5sRDmx/u6E10ebhz9aHNLj7Oh5Y83NEDFD@8w1D5////hkYA "Jelly – Try It Online")
Edit: compressed to a single line
**Explanation**
```
DS=³a³ḍaDṫ³DLC¤Ḍ=³ø1#
                  ø1#  Evaluate the condition before this and increment a counter until it is met then output the counter                     
D                      Digits of incremented variable as a list
 S                     Sum
  =³                   Equals argument of program?
    a                  Logical and
     ³ḍ                Does arg divide incremented variable?
       a               Logical and
        Dṫ     Ḍ       Last n digits of inc. var. where n is number of digits in program input
          ³DLC         1 - (number of digits of program input)
              ¤        Book ends above nilad
                =³     Equals program input?
```
This took me many hours to write because I'm learning Jelly but now that I'm done I'm so satisfied. For a long time I didn't realize I needed the `¤` and I just couldn't get it to work. Looking at [this][1] well explained code helped me seal the deal. Lots of other Jelly answers in PPCG guided me too.
]