[Question]
  [
**NOTE: Some terminology used in this challenge is fake.**
For two integers `n` and `k` both greater than or equal to 2 with `n > k`, `n` is *semidivisible* by `k` if and only if `n/k = r/10` for some integer `r`. However, `n` may not be divisible by `k`. Put more simply, the base 10 representation of `n/k` has exactly one digit after the decimal place. For example, 6 is semidivisible by 4 because 6/4=15/10, but 8 is not semidivisible by 4 because `8 % 4 == 0`.
Your task is to write a program which takes in two integers as input, in any convenient format, and outputs a truthy (respectively falsy) value if the first input is semidivisible by the second, and a falsey (respectively truthy) value otherwise. Standard loopholes are forbidden. You may assume that `n > k` and that both `n` and `k` are at least 2.
Test cases:
```
[8, 4] -> falsey
[8, 5] -> truthy
[9, 5] -> truthy
[7, 3] -> falsey
```
This question is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") therefore shortest answer in bytes wins.
  
[Answer]
# [Python 2](https://docs.python.org/2/), 24 bytes
```
lambda n,k:n*10%k==0<n%k
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUSFPJ9sqT8vQQDXb1tbAJk81@395RmZOqoKhFRcnUE7BViEzr6C0REOTi7OgKDOvRCFNAyis@T/aQkfBJJYLRJkCKUsIZa6jYBwLAA "Python 2 – Try It Online")
Checks that \$10n\$ is a multiple of \$k\$, but \$n\$ itself is not.
**24 bytes**
```
lambda n,k:n%k>>n*10%k*n
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUSFPJ9sqTzXbzi5Py9BANVsr7395RmZOqoKhFRcnUE7BViEzr6C0REOTi7OgKDOvRCFNAyis@T/aQkfBJJYLRJkCKUsIZa6jYAykDC0NDAx1FAwNgCAWAA "Python 2 – Try It Online")
The `*n` at the end can't be omitted, say for `n=19001, k=10000`.
[Answer]
# [R](https://www.r-project.org/), 31 bytes
```
function(x,y)nchar((x/y)%%1)==3
```
[Try it online!](https://tio.run/##K/qfoJpZHF@cmpuZklmWWZyZlJMan1SpmmD7P600L7kkMz9Po0KnUjMvOSOxSEOjQr9SU1XVUNPW1vi/mQJWnQomCsoKJUWlqVwWeBSkJeYU41ZhCjPCkpACcxwKjOF2/AcA "R – Try It Online")
Fractional part (`%%1`) of `x/y` must be 3 characters: so, `0.1`, `0.2` ... `0.9`, but not `0` or `0.3333`.
[Answer]
# [Python 2](https://docs.python.org/2/), 23 bytes
Saves 1 byte from [xnor's answer](https://codegolf.stackexchange.com/a/220283/88546) *(for the [bounty](https://codegolf.meta.stackexchange.com/a/18334/88546))*. Notice that the chained comparison forces `n*10%k = 0` and `n%k > 0` to both be true.
```
lambda n,k:1>n*10%k<n%k
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUSFPJ9vK0C5Py9BANdsmTzX7f3lGZk6qgqEVFydQSsFWITOvoLREQ5OLs6AoM69EIU0DKKz5P9pCR8EklgtEmQIpSwhlrqNgHAsA "Python 2 – Try It Online")
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), ~~12~~ 9 bytes
```
3=∘≢∘⍕1|÷
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///P@1R2wRj20cdMx51LgKRvVMNaw5v//@obypQwkIhTcFE4VHvXAVdO4W0xJziSi6EhClMoqSotCQDJmOJU8YcKGOMYth/AA "APL (Dyalog Unicode) – Try It Online")
The previous, obvious method.
```
'.'=∘⊃¯2↑∘⍕÷
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///P@1R2wR1PXXbRx0zHnU1H1pv9KhtIojdO/Xw9v@P@qYCpS0U0hRMFB71zlXQtVNIS8wpruRCSJjCJEqKSksyYDKWOGXMgTLGKIb9BwA "APL (Dyalog Unicode) – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 10 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
I think this is right; I'm quite drunk!
```
*A vV «UvV
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=KkEgdlYgq1V2Vg&input=NyAz)
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~25~~ ~~24~~ 23 bytes
Saved a byte thanks to [AZTECCO](https://codegolf.stackexchange.com/users/84844/aztecco)!!!  
Thanks to [dingledooper](https://codegolf.stackexchange.com/users/88546/dingledooper) who found and fixed a bug!!!
```
f(n,k){n=n%k>0>10*n%k;}
```
[Try it online!](https://tio.run/##bVDhaoMwEP7vU1wFQe3JdG3ZitM/Y08xZUiMnWRLixEmE1997mqi1LFwOS73fXeX@1hwYmwcK1ei8HqZSEekYRqFPgXxMH4WtXQ9q7eATi1baLlq3@RrDgn0jwhkR4QH7Yd4TROatkc4TLZDiEKE/Q2PdxfOWl5qJoHRZDoIDZG9F41PnjPBG820s@7lPuuOz3QPNsLte2ebuurcgHudUsuSd1QWxiZ8AlV/83PlzvO9O5Pwl0wM2@3E9kCvP/9ZUicjw4Tn8QoWMyz@hRXBWu11nlN@UeNv4aUhSuXaTonglBCkV@@oTNLqEkEgKFwE2mxUkvDc9B@sYfxh1UdxUmPw9Qs "C (gcc) – Try It Online")
Inputs integers \$n\$ and \$k\$ and returns a truthy iff \$10n\$ is divisible by \$k\$ and \$n\$ isn't divisible by \$k\$.
[Answer]
# [Husk](https://github.com/barbuz/Husk), 8 bytes
```
€tḊ10/¹⌉
```
[Try it online!](https://tio.run/##yygtzv6fG6zhpaSga6eglKqpUez2qKkxt6hc89C2/4@a1pQ83NFlaKB/aOejns7///@bKZhwWSiYclkCsbmCMZBtwmVoYKhgaGAAAA "Husk – Try It Online")
Uses a different approach from what I have seen in other answers, could be even shorter if I found a better way to check if a number is in [2,5,10]. (Any golfing language with a single-byte builtin for 10 could probably do it)
### Explanation
Taking 2 numbers \$a\$ and \$b\$, we compute: $$\frac{lcm(a,b)}{a}$$
This value will be equal to the smallest number you have to multiply \$a\$ by to make it divisible by \$b\$. Since we don't want \$a\$ to be divisible by \$b\$ we'll need this to be greater than 1, and since we want \$10\*a\$ to be divisible by \$b\$ we'll need this to be a divisor of 10. In the end we want the result to be one of [2,5,10].
```
€tḊ10/¹⌉
       ⌉    Least common multiplier of the two numbers
     /¹     divided by the first number
€           Find its position in the list: (returns 0 if missing)
  Ḋ10        divisors of ten: [1,2,5,10]
 t           except the first: [2,5,10]
```
[Answer]
# [Haskell](https://www.haskell.org/), 30 bytes
```
n#k=(10*n`mod`k<1)>(n`mod`k<1)
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P08521bD0EArLyE3PyUh28ZQ004Dwf6fm5iZp2CrUFCUmVeiEA1UXBOdp5Mda6MbHW2ho2ASqwOiTIGUJYQy11Ewjo2N/Q8A "Haskell – Try It Online")
* inspired by @xnor [answer](https://codegolf.stackexchange.com/a/220283/84844)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 6 bytes
```
×⁵ọ¹ȧ%
```
[Try it online!](https://tio.run/##y0rNyan8///w9EeNWx/u7j2088Ry1f@H2/UfNa35/z862kLHJFYHSJoCSXMwaaljDCQNDQx0zGNjAQ "Jelly – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 18 bytes
```
n=>k=>n%k>0>10*n%k
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@z/P1i7b1i5PNdvOwM7QQAvI@J@cn1ecn5Oql5OfrpGmYaGpYaKpaa2gr6@ga6eQlphTXMmFocIUoaKkqLQkA12JJWEl5poaxmj2/AcA "JavaScript (Node.js) – Try It Online")
-2 bytes thanks to [iota](https://codegolf.stackexchange.com/users/99986/iota)
-1 byte indirectly from Neil or Noodle9 or dingledooper
[Answer]
# [J](http://jsoftware.com/), 11 bytes
```
3=[#@":@%~|
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/jW2jlR2UrBxU62r@a3KlJmfkK6inJeYUVyokJxanFqtDhEwU0hQsIExjINOcC6qypKi0JANVqSlCKYhpqfAfAA "J – Try It Online")
Looks like I stumbled on almost exactly the same method as the APL answer.
* `[...%~|` The left input `[` floating point divided into `%~` the remainder when the left input is divided into the right input `|`.
* `#@":@` Format that result as a string and take its length.
* `3=` Does that equal 3? This will only be true for numbers of the form `0.n` where n is an element of the digits `1-9`.
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 36 bytes
```
param($n,$k)!((10*$n)%$k)-and($n%$k)
```
[Try it online!](https://tio.run/##K8gvTy0qzkjNyfn/vyCxKDFXQyVPRyVbU1FDw9BASyVPUxXI0U3MSwGKg5j///@3@G8CAA "PowerShell – Try It Online")
Inspired by @xnor method of checking if 10n is multiple of k but n itself not
[Answer]
# [GolfScript](http://www.golfscript.com/golfscript/), 15 bytes
```
.~@~%!!@10*@%!&
```
[Try it online!](https://tio.run/##S8/PSStOLsosKPn/X6/OoU5VUdHB0EDLQVVR7f9/CwVTAA "GolfScript – Try It Online")
Unfortunately, as GolfScript lacks support for floating-point values, I couldn't use the strategy of looking for the decimal place. The program just checks if n % k is truthy and 10n % k is falsy.
Also of note is that I found it easier to take the input as a string containing two space-separated integers instead of taking it as two integers directly.
```
.~@~                  prepare two sets of n and k
    %!!               check if n % k > 0
       @10*           multiply n by 10
           @%!        check if 10n % k = 0
              &       AND both values
```
[Answer]
# [R](https://www.r-project.org/), 28 bytes
```
function(x,y)!(x*10)%%y&x%%y
```
[Try it online!](https://tio.run/##K/qfoJpZHF@cmpuZklmWWZyZlJMan1SpmmD7P600L7kkMz9Po0KnUlNRo0LL0EBTVbVSrQJI/DdTwKpNwURBWaGkqDSVywKPgrTEnGLcKkxhRlgSUmCOQ4Ex3A5DSwMDQxyqDA2AAK7yPwA "R – Try It Online")
Test harness taken from [Dominic's answer](https://codegolf.stackexchange.com/a/220284/55372).
[Answer]
# Excel, ~~31~~ ~~29~~ 20 bytes
```
=LEN(MOD(A1/B1,1))=3
```
*-2 bytes thanks to @Dominic van Essen*
*-9 bytes porting [Dominic's Answer](https://codegolf.stackexchange.com/questions/220281/semidivisibility/220284#220284)*
Previous Answer
```
=MOD(A1,B1)*(MOD(A1*10,B1)=0)
```
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), ~~41~~ ~~40~~ 35 bytes
```
$
0
\d+
$*
^(1+),(?!(\1{10})+$)\1+$
```
[Try it online!](https://tio.run/##K0otycxL/K@q4a8SlxCTos31X4XLgAvEUNHiitMw1NbU0bBX1IgxrDY0qNXUVtGMMdRW@f/fQseEy0LHlMsSiM11jAE "Retina 0.8.2 – Try It Online") Takes inputs in reverse order, but header in link reverses the test suite for convenience. Explanation:
```
$
0
```
Multiply `n` by `10`.
```
\d+
$*
```
Convert `k` and `10n` to unary.
```
^(1+),
```
Match k, then ...
```
(?!(\1{10})+$)
```
... while ensuring `10k` doesn't divide `10n` (i.e `k` does not divide `n`), ...
```
\1+$
```
... ensure `k` divides `10n`.
[Answer]
# [Vyxal v2.6.0+](https://github.com/Lyxal/Vyxal), 6 bytes
```
ġ/₀KḢc
```
Takes its input as \$k\$ followed by \$n\$.
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCLEoS/igoBL4biiYyIsIiIsIjEwXG4xMjM0NTY3ODkxMjM0NTY4OTUiXQ==)
This uses the same algorithm as my [regex answer](https://codegolf.stackexchange.com/a/249412/17216), which is similar to the algorithm used by [Leo's Husk answer](https://codegolf.stackexchange.com/a/220433/17216). It asserts that $${k\over gcd(n,k)} ∈ [2,5,10]$$
It doesn't use floating point, and can thus handle arbitrarily large integers correctly.
```
ġ            Push gcd(n,k)
 /           Pop the above result, and push k divided by it
  ₀K         Push the divisors of 10, i.e. [1, 2, 5, 10]
    Ḣ        Head remove – drop first element, yielding [2, 5, 10]
     c       Is the above quotient contained in the above list?
```
## [Vyxal v2.5.3ω](https://github.com/Vyxal/Vyxal/tree/old), 7 bytes
```
ġ/₀Kḣ„c
```
Takes its input as \$k\$ followed by \$n\$.
[Try it Online!](https://lyxal.pythonanywhere.com?flags=&code=%C4%A1%2F%E2%82%80K%E1%B8%A3%E2%80%9Ec&inputs=10%0A123456789123456895&header=&footer=) - v2.5.3ω  
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCLEoS/igoBL4bij4oCeYyIsIiIsIjEwXG4xMjM0NTY3ODkxMjM0NTY4OTUiXQ==) - latest
The reason I didn't use the `Ḣ` head-remove element in the first place is that I was referring to outdated documentation – my clone of the git repo was pointed at master instead of main.
```
ġ             Push gcd(n,k)
 /            Pop the above result, and push k divided by it
  ₀K          Push the divisors of 10, i.e. [1, 2, 5, 10]
    ḣ         Head extract – split the above, yielding 1 and [2, 5, 10]
     „        Rotate stack left, such that a=the above quotient, and b=[2, 5, 10]
      c       Is a contained in b?
```
# [Vyxal v2.5.3ω](https://github.com/Vyxal/Vyxal/tree/old), 7 bytes
```
Ḋ⁰₀*¹Ḋ<
```
Takes its input as \$k\$ followed by \$n\$.
[Try it Online!](https://lyxal.pythonanywhere.com?flags=&code=%E1%B8%8A%E2%81%B0%E2%82%80*%C2%B9%E1%B8%8A%3C&inputs=10%0A123456789123456895&header=&footer=) - v2.5.3ω  
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCLhuIrigbDigoAqwrnhuIo8IiwiIiwiMTBcbjEyMzQ1Njc4OTEyMzQ1Njg5NSJd) - latest
This uses the same logic as in [xnor's Python answer](https://codegolf.stackexchange.com/a/220283/17216) and many subsequent answers, which is to assert that \$n≢0\pmod k\ \land\ 10n≡0\pmod k\$.
```
Ḋ             Push 1 if n is divisible by k, 0 otherwise
 ⁰            Push n
  ₀           Push 10
   *          Push n*10, popping both n and 10
    ¹         Push k
     Ḋ        Push 1 if n*10 is divisible by k, 0 otherwise (pop both)
      <       Is the top boolean less than the bottom boolean?
```
## [Vyxal v2.5.3ω](https://github.com/Vyxal/Vyxal/tree/old), 7 bytes, 6 elements
```
k≈↵*⁰Ḋ¯
```
Takes its input as \$n\$ followed by \$k\$.
[Try it Online!](https://lyxal.pythonanywhere.com?flags=&code=k%E2%89%88%E2%86%B5*%E2%81%B0%E1%B8%8A%C2%AF&inputs=123456789123456895%0A10&header=&footer=) - v2.5.3ω  
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCJr4omI4oa1KuKBsOG4isKvIiwiIiwiMTIzNDU2Nzg5MTIzNDU2ODk1XG4xMCJd) - latest
```
k≈            Push [0, 1]
  ↵           Raise 10 to the power of the above: [1, 10]
   *          Multiply the above list by n
    ⁰         Push k
     Ḋ        Are the list items divisible by k? (Result is a list)
      ¯       Take deltas (consecutive differences) of the list. Iff the two
              elements of the list were different, this will be truthy.
```
Oddly, the behavior of `¯` was changed. It used to give \$[a[0]-a[1], a[1]-a[2], …]\$ but now gives \$[a[1]-a[0], a[2]-a[1], …]\$. This doesn't change the truthiness of the output, just the sign of the truthy result: `⟨-1⟩` in old, `⟨1⟩` in new.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 9 bytes
```
⁼¹⌕⮌Ｉ∕ＮＮ.
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMO1sDQxp1jDUEfBLTMvRSMotSy1qDhVwzmxuETDJbMsMyVVwzOvoLTErzQ3KbVIQ1NHAYULBDoKSnpKQNr6/38LBdP/umU5AA "Charcoal – Try It Online") Link is to verbose version of code. Outputs a Charcoal boolean, i.e. `-` for semidivisble, nothing if not. Explanation:
```
      Ｎ     First input
     ∕      Divided by
       Ｎ    Second input
    Ｉ       Cast to string
   ⮌        Reversed
  ⌕         Index of
        .   Literal `.`
⁼           Equal to
 ¹          Literal 1
            Implicitly print
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), 9 bytes
```
&¬%³*10¹%
```
[Try it online!](https://tio.run/##yygtzv6fq3Fo@aOmxkdtEx61TdL8r3ZojeqhzVqGBod2qv5XSq0oSE0uSU1RyC8tKSgtsVIw1DHQMQRCAwUNMx0TheiSotKSjMpYhbT8nJz8cqDCpEqFkoxUBROF9Myy1DyFktTiEt3kxOLUYs3//6OjTXTMYnWApAWQNIWSlkDSWMc8NhYA "Husk – Try It Online")
[Answer]
# [K (ngn/k)](https://bitbucket.org/ngn/k), 13 bytes
```
{>/~y!10 1*x}
```
[Try it online!](https://tio.run/##y9bNS8/7/z/NqtpOv65S0dBAwVCrovY/kAJCAzCuU0hT0FNX0LBQMLG2UDC1tgRicwVjIG1oAGSYaP4HAA "K (ngn/k) – Try It Online")
Uses [@xnor's approach](https://codegolf.stackexchange.com/a/220283/98547). `n` is `x`, and `k` is `y`.
* `10 1*x` generate list of 10 times `x`, and `x`
* `y!` mod each of those by `y`
* `~` not them, i.e. check if `y` evenly divides `10*x` and `x`
* `>/` return true iif `y` evenly divides `10*x` but not `x`
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~9~~ ~~8~~ ~~8~~ 6 bytes
-2 thanks to @Kevin Cruijssen
```
/`×'.å
```
[Try it online!](https://tio.run/##yy9OTMpM/f9fP@HwdHW9w0v//zflsgAA "05AB1E – Try It Online")
[Try more cases](https://tio.run/##yy9OTMpM/V9WGZRgr65vb6@k8KhtkoKSfWXCf/2Ew9PV9Q4v/a/zPzraTMckVifaAkqaAklLMGmuYwwkDXUMIaQBlILTBrGxAA)
[Answer]
# [Vyxal 2.0.0](https://github.com/Lyxal/Vyxal), 6 bytes
```
/Ṫt\.=
```
[Try it Online!](http://lyxal.pythonanywhere.com?flags=&code=%2F%E1%B9%AAt%5C.%3D&inputs=5%0A8&header=&footer=)
Checks if the second last character is "."
[Answer]
# APL, 14 bytes
```
{0≠.=⍵|1 10×⍺}
```
Explanations. For example, ⍺ = 3 and ⍵ = 5
```
1 10×⍺ ⍝ Make two-element vector: 3 30
⍵|     ⍝ Remanders of division to 5: 3 0
0≠.=   ⍝ Check if they are zero: 0 1 (no yes)
       ⍝ Then check if answers are different
```
[Answer]
# Regex (ECMAScript), ~~35~~ 33 bytes
```
^(?=(.+)\1*,\1+$)(\1\B|\1{5})\2?,
```
Takes its input in unary, as the length of two strings of `x`s delimited by a `,` specifying (\$k,n\$).
[Try it online!](https://tio.run/##TY9BbtswEEX3OgUVNNaMxSikLTmuBdZAgBToJou2u6gFCIeRVVG0QNJNGtunKLLL6XoRl2pSIAs@Dub/j5n5IX9Kt7JN789c39wq221Mq34drTDqnnxW9dVDD/AoPpyPj99hKSBLseJjWvH0HULFq8t9xXfFAavJkh7H54@Y@c0XbxtTA2ZONysFM3qWI5ZOsPJ@3WgFoIVV8lY3RgFiLMxWa9y50agPOQ@DlZe10JnrdeMhoQmWzR3UmVam9utYTPb7xl3LazCil9apTyFV37BviP@F9q3Ag4D91jtv4eTK2o1dkJNUYxkRorRTu44IAslDklnVK@mhxTQMTd90DGLWSb9ag8WSyOA3p20sGBmNCJgxZ3jainAgeR0DcdwJIcmSJH@ef5OELIbiiSSYQjd0v9qtWpAX4aMMSywGLex0OBznNI/mtIjeh3dBp@HnLBR5NKW8iPIBfEJzFvHpwIvZwGI@cML@MXiLGeWziDMewiwKlr8 "JavaScript (SpiderMonkey) – Try It Online")
This uses a similar algorithm to [Leo's Husk answer](https://codegolf.stackexchange.com/a/220433/17216). We can't directly compute \$lcm(n,k)\$ since it can be larger than both the inputs, so instead we compute \$k/gcd(n,k)\$, which is conveniently equivalent to \$lcm(n,k)/n\$. All that remains is to assert that the result is in \$[2,5,10]\$.
```
^                   # tail = K
(?=
    (x+)\1*,\1+$    # \1 = greatest common factor of K and N
)
# Assert that K == \1*2, \1*5, or \1*10, i.e. that K/\1 == 2, 5, or 10
(                   # \2 = one of the below choices, \1 or \1*5
    \1              # tail -= \1
    \B              # Assert tail > 0; this prevents matching on K == \1
|                   # or
    \1{5}           # tail -= \1*5
)
\2?                 # optionally, tail -= \2; this option must be taken if
                    # \2 == \1, because in that choice, the assertion was made
                    # that K > \1
,                   # Assert tail == 0
```
# Regex (ECMAScript), 33 bytes
```
^(((x+)(\3{4})?)\2?),(?!\1+$)\3+$
```
[Try it online!](https://tio.run/##TY9NbtswEIX3OgUVJNaMxSikJTuuBdarFOgmi7a7ugUIh5VZUbRA0o0Tx6cousvpchGX6g@QBT8O5r2Hmfkuf0i/droPl77Xd8p1W9uqh5MTVt2TD6q52fcAj@Lt1fj0FQD2OcKqPFRHXOJqskQKy3TF83Nclfn5aXz1iEXYfgxO2waw8EavFczoZYVYe8Hq@402CsAIp@Sd0VYBYirszhg8@NGoj7kAg5XXjTCF740OkNEMa/0NmsIo24RNKiZPT9rfyluwopfOq/cx1XxmXxD/C@1rgUcB@13wwcHZjXNbtyBnucE6IUQZrw4dEQSyfVY41SsZoMU8Ds1fdSxi0cmw3oDDmsjotxdtKhgZjQjYMWd40Yp4IPk3BtK0E0KSJclenn@SjCyG4hfJMIdu6H5yO7Ugf4V3Mi6xGLS40/F4mtMqmdNp8ia@a1rGn7NYVElJ@TSpBvAJrVjCy4HXs4HT@cAJ@8Ponc4onyWc8RhmSbT8Bg "JavaScript (SpiderMonkey) – Try It Online")
By an interesting coincidence, there's another method that has the same length. It asserts that both:
* \$k\$ does not divide \$n\$
* At least one member of \$\{k, {k\over 2}, {k\over 5}, {k\over 10}\}\$ is an integer and divides \$n\$ (of course it's redundant to try to assert that for \$k\$, as it contradicts the previous assertion, but it results in a shorter regex)
```
^                    # tail = K
# Divide \3 = K, K/2, K/5, or K/10
(                    # \1 = tail == K
    (                # \2 = \3 or \3*5
        (x+)         # \3 = any positive number satisfying the assertions below
        (\3{4})?     # optionally add \3*4 to \2
    )                # tail -= \2
    \2?              # optionally, tail -= \2
)
,                    # Assert tail == 0;
                     # tail = N
(?!\1+$)             # Assert N is not divisible by K
\3+$                 # Assert N is divisible by \3
```
# Regex (Ruby), 31 bytes
```
^(((x+)\3{4}?)\2?),(?!\1+$)\3+$
```
[Try it online!](https://tio.run/##ZU9dS8MwFH3vr7gp25Ius7R@vFhCGUx9mzAGvhRLZamUbllJOpyIPvoD/In@kXqXVCd6IeHecw7n3Kt3D8@dBgEL@Sj3TajkE8ymy2moZbFKvKYwRq6Qjjyp9VYb25ZbDQoqBXEYxhexnetfM2AVqFTDmogIRiNgahxHwbAWIrLsBlnm7/1xDRz8iX/4cVIBiDfQVlKV6EEEELKx86GaXWtAhe02N5xOKK/7Fj7fP4BytoEU6FLvJIVLoNfF2kgaIH0Cd4vb@Q2hP079NVyAW1ei9Bjjrj6SauXhS2zT6Eq1veQ7vpWmxXgHEhEf1jB2BxvvcOrhSX0u3hUl4Kz8TPnc4X/8HPjfryyqNfq5ffL8aj7L8@6eMbbnQXb2cv6aBtlpGkxYSrKYDxDjg677Ag "Ruby – Try It Online")
This is a straight port of the above ECMAScript regex. Ruby allows multiple back-to-back quantifiers in situations where the meaning is unambiguous, so `(\3{4})?` can be done as `\3{4}?` instead. In other regex engines, the `?` in `\3{4}?` would be interpreted as modifying the quantifier to be lazy (non-greedy), even though on a constant quantifier that has no effect.
Note that `(A{N,M})?` *cannot* be changed to `A{N,M}?` in Ruby, because in that case the `?` does act as a lazy modifier to the quantifier.
### Regex (ECMAScript), ~~171~~ 151 bytes
Just for kicks, let's see if we can port the algorithm from [xnor's Python answer](https://codegolf.stackexchange.com/a/220283/17216) and many subsequent answers, which is to assert that \$n≢0\pmod k\ \land\ 10n≡0\pmod k\$. The challenge here is that we can't directly compute \$10n\$, since regex can't operate on numbers larger than any of the inputs (of course, we could if \$k\ge 10n\$, but in most cases it won't). So we need to emulate the calculation of \$10n\$ modulo \$k\$.
`^(?=(x*),\1*(x*))(?=(?=\2\B(x*))(x*(?=\3\3)|\2\2))(?=((?=\4(x*))x*(?=\3\6)|\4\2))(?=((?=\5(x*))x*(?=\3\8)|\5\2))(?=((?=\7(x*))x*(?=\3\10)|\7\2))\9{2}\b`
[Try it online!](https://tio.run/##VZBNbtswEIX3OgUdINaMrCii/uxYYA0USIFusmi7q1qAdVhZFUULpNw4sX2KoruerhdxybgBnAUfZ@Z7gxnyB//JzVI3/XBl@uZe6G6tWvF41EyJB/JB1LfbHuCJvbkOjl9hwWAbYFjRwN3o8gWrkurtKd0GLk2rFPe2mJwMrpQ98xdcWJyd4/wVnlmcn@PpK0xjy6eOVze75FB9OwbXTxgN64@DblQNGBnZLAUU4VWGWBoWlw@rRgoAybTg97JRAhBHTG2kxJ0Zj3vbN4Cz0rJmMjK9bAbwQx/L5jvUkRSqHlYjluz3jbnjd6BYz7UR721X/Tn@gvgC2nNALcB@M5hBw8Wt1ms9JxcTiaVHiJBG7DrCCPhbP9KiF3yAFid26OSsohCjjg/LFWgsCbd@ddmOWEzGYwIqsF9x2TL7QPJ/DIxGHWOcLIj/988v4pO5C34THyfQueonvRFzcgLvuF1i7pjd6XA4zsLMm4W5d2PPNEztTWMbZF4a0tzLnNAkzGKPpk6nhdN85jSJn9V68yKkhUdjaptjz1r@AQ "JavaScript (SpiderMonkey) – Try It Online")
```
^                      # tail = K
(?=(x*),\1*(x*))       # \1 = K; \2 = N % K
(?=
    (?=
        \2             # tail -= \2
        \B             # Assert 0 < \2 < K
        (x*)           # \3 = tail == K - \2 == also a tool to make tail = \2
    )
    (                  # \4 = (\2 + \2) % K == (N * 2) % K
        x*(?=\3\3)     # \4 = head = \2 - \3
    |                  # if above failed due to K - \2 > \2 then fall back on:
        \2\2           # \4 = \2 + \2
    )
)
(?=((?=\4(x*))x*(?=\3\6 )|\4\2))   # \5 = (\4 + \2) % K == (N * 3) % K
(?=((?=\5(x*))x*(?=\3\8 )|\5\2))   # \7 = (\5 + \2) % K == (N * 4) % K
(?=((?=\7(x*))x*(?=\3\10)|\7\2))   # \9 = (\7 + \2) % K == (N * 5) % K
\9{2}                  # tail = tail - \9*2 == K - \9*2
\b                     # Assert tail==K or tail==0, which is equivalent to
                       # asserting (N * 5 * 2) % K == 0
```
This could be shortened greatly in regex flavors with forward-declared backreferences, but it'd still be much longer than 33 bytes.
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), ~~42~~ 40 bytes
```
\d+
$*
^(?=(.+)\1*,\1+$)(\1\B|\1{5})\2?,
```
[Try it online!](https://tio.run/##Hcs7DgIxDATQ3ucIUrKxUCa/DQVaiQtwAWsFEhQ0FCs64OzBofCbKcbb/fV4XvvOns16kZunPjATrXY52r13gokF3jgrkNNH8C5fJ3Hh3htnalzooDdz0kTQkikxCuUBIudASMO5DksbxvBXt6UyKiFAnwPp5Ac "Retina 0.8.2 – Try It Online")
[Answer]
# [Raku](http://raku.org/), 16 bytes
```
*/(.1&none 1)%%*
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPtfS19Dz1AtLz8vVcFQU1VV67@1QnFipYJ9mkaNSrymQlp@kYKNhYKJnQ6IMgVRlhDKXMHY7j8A "Perl 6 – Try It Online")
This is an anonymous function where the asterisks represent the two arguments. The main expression is `* / X %% *`, which checks that the first argument divided by an expression X is divisible by the second argument. `X` here is an and-junction of the number `.1`, and the none-junction of the number `1`. Raku threads the expression over the junction, producing a truthy value if the first argument divided by `.1` is divisble by the second argument, AND the first argument divided by `1` is NOT divisible by the second argument.
The return value is a junction of boolean values, which collapses into a single value in a boolean context. Fortunately, this challenge did not stipulate that the return value must be one of two distinct values, or I'd have to add a `so` to collapse the junction to a regular boolean, for two more bytes.
Note that I used division instead of multiplication because an extra space would have been required to separate the first function argument from the multiplication operator: `* *(10&none 1)%%*`. `.1` is a rational number in Raku, not a floating-point number, so there's no danger of floating-point rounding error.
[Answer]
# Java, 35 bytes
```
n->k->(n/k+"").matches(".+\\.[^0]")
```
Port of my [JavaScript answer](https://codegolf.stackexchange.com/a/220304/99986).
[Try it online!](https://tio.run/##lY1Ba8JAEIXv@RVLTruVTAUrWmxzKt4EwaNaGDcbu8lmd8lOBBF/e7rF2LO@y/DefPOmwhNmVVH3uvGuJVZFDx1pA2VnJWln4WWR@O5gtGTSYAhshdpeEhY1xIGQ4jg5XbAmLvmGWm2P2z3D9hjEjf3Tl4sHajkUf9zsulWFlkgqZ@Vnb7O8znJuX@tRmgpokOSPCjyF0W4H2@/xPhX94r9wcw6kGnAdgY8vyVheAnpvznwugFQg/ibEU/z0Qf79SX428JM7f02u/S8)
# Java, 20 bytes
```
n->k->n*10%k<1&n%k>0
```
Port of [xnor's answer](https://codegolf.stackexchange.com/a/220283/99986).
[Try it online!](https://tio.run/##lY1BC4JAEIXv/oq9FCq4KBUVmqfoFgQeo8Omq6yuu4s7ChL@dtvQOue7DO/NN29K0hGvzKqR1Uo2gErjcQuM47wVKTApsBtaqn1ylqKUE63RlTDxspDRHGsgYEYnWYZqs7QTaJgo7g9EmkI7E/vRWZoDepmLo8neGpqxlACNUX4ahRdXXizcwF9VUbAWqyr2x/DXkPQaaI1lC1iZH8CFnWOiFO/tg4OBarC3jrOI3/3JHxfy@5nffPnBGsY3)
[Answer]
# JavaScript, 22 bytes
```
n=>k=>/\..$/.test(n/k)
```
Checks that there is exactly one decimal place after division.
[Try it online!](https://tio.run/##y0osSyxOLsosKNEts/ifZvs/z9Yu29ZOP0ZPT0VfryS1uEQjTz9b839BUWZeiUaahoWmhommJhcS1xSJa4nKNdfUMNbU/A8A)
[Answer]
# Scala, 20 bytes
```
n=>k=>n%k-n*10%k*k>0
```
[Try it in Scastie](https://scastie.scala-lang.org/uFovZj1ZReWVY1LcySfBvA)
If `n` is divisible by `k` but not `n*10`, `n%k-n*10%k*k` is negative. If the both are divisible by `k`, it's 0. If only `n*10` is divisible by `k`, it's positive. If neither is divisible by `k`, it's still negative, because we're multiplying the second by `k` to make it bigger.
[Answer]
# [Templates Considered Harmful](https://github.com/feresum/tmp-lang), 51 bytes
```
Fun<If<Rem<Mul<I<10>,A<1>>,A<2>>,F,Rem<A<1>,A<2>>>>
```
[Try it online!](https://tio.run/##K0nNLchJLEkt/u9YYPPfrTTPxjPNJig118a3NMfG08bQwE7H0cbQDkQaAUk3HZAcSAQiYGf3X4eL09PG0g5Mmdpx2f0HAA "Templates Considered Harmful – Try It Online")
Implementation of [xnor's answer](https://codegolf.stackexchange.com/a/220283/66421). Anonymous function that takes 2 arguments.
```
Fun<
    If<Rem<Mul<I<10>,A<1>>,A<2>>,  # if 10n%k > 0
       F,                          # false
       Rem<A<1>,A<2>>>>            # else n%k
```
[Answer]
## [Kustom](https://help.kustom.rocks/s1-general/knowledgebase/top/c2-functions), 30 bytes
this one is really small for a language for making android widgets O.o
```
$tc(cut,gv(n)/gv(k),-2,1)=.$
```
28+2 extra bytes for global names
]