[Question]
  [
[Give credit to whom credit is due](http://chat.stackexchange.com/transcript/message/29674708#29674708).
**Objective** Given an integer `N > 0`, out the smallest integers `A`, `B`, and `C` so that:
1. All of `A`, `B`, and `C` are strictly greater than `N`;
2. `2` divides `A`;
3. `3` divides `B`;
4. and `4` divides `C`.
This is a code-golf, so the shortest answer in bytes wins.
## Test cases
```
N => A, B, C
1 => 2, 3, 4
4 => 6, 6, 8
43 => 44, 45, 44
123 => 124, 126, 124
420 => 422, 423, 424
31415 => 31416, 31416, 31416
1081177 => 1081178, 1081179, 1081180
```
  
[Answer]
## Python 2, 32 bytes
```
lambda n:[n+2&-2,n/3*3+3,n+4&-4]
```
Bit arithmetic for 2 and 4, modular arithmetic for 3.
I found four 7-byte expressions for the next multiple of `k` above `n` but none shorter:
```
n-n%k+k
~n%k-~n
n/k*k+k
~n/k*-k
```
Any gives 34 bytes when copies for `k=2,3,4`, and 33 bytes if combined:
```
[n/2*2+2,n/3*3+3,n/4*4+4]
[n/k*k+k for k in 2,3,4]
```
But, 2 and 4 are powers of 2 that allow bit tricks to zero out the last 1 or 2 bytes.
```
n+2&-2
n+4&-4
```
This gives 6 bytes (instead of 7) for getting the next multiple, for 32 bytes overall, beating the `for k in 2,3,4`.
Unfortunately, the promising-looking `n|1+1` and `n|3+1` have the addition done first, so incrementing the output takes parentheses.
[Answer]
# [Jelly](http://github.com/DennisMitchell/jelly), 8 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
~%2r4¤+‘
```
[Try it online!](http://jelly.tryitonline.net/#code=fiUycjTCpCvigJg&input=&args=MTI) or [verify all test cases](http://jelly.tryitonline.net/#code=fiUycjTCpCvigJgKw4figqxH&input=&args=MSwgNCwgNDMsIDEyMywgNDIwLCAzMTQxNSwgMTA4MTE3Nw).
### How it works
```
~%2r4¤+‘  Main link. Argument: n (integer)
~         Bitwise NOT; yield ~n = -(n + 1).
     ¤    Combine the three links to the left into a niladic chain:
  2         Yield 2.
   r4       Yield the range from 2 to 4, i.e., [2, 3, 4].
 %        Yield the remainder of the division of ~n by 2, 3 and 4.
          In Python/Jelly, -(n + 1) % k = k - (n + 1) % k if n, k > 0.
       ‘  Yield n + 1.
      +   Add each modulus to n + 1.
```
[Answer]
# Julia, 16 bytes
```
n->n-n%(r=2:4)+r
```
[Try it online!](http://julia.tryitonline.net/#code=ZiA9IG4tPm4tbiUocj0yOjQpK3IKCmZvciBuID0gKDEsIDQsIDQzLCAxMjMsIDQyMCwgMzE0MTUsIDEwODExNzcpCiAgICBwcmludGxuKGYobikpCmVuZA&input=)
[Answer]
# MATL, ~~15 10~~ 9 bytes
```
2:4+t5M\-
```
[Try it online!](http://matl.tryitonline.net/#code=Mjo0K3QyOjRcLQ&input=MTA)
Explanation:
```
2:4          #The array [2, 3, 4]
   +         #Add the input to each element, giving us [12, 13, 14]
    t        #Duplicate this array
     5M      #[2, 3, 4] again
       \     #Modulus on each element, giving us [0, 1, 2]
        -    #Subtract each element, giving us [12, 12, 12]
```
[Answer]
# MATL, 8 bytes
```
Qt_2:4\+
```
Uses Denis' Jelly algorithm, I'm surprised it's the same length!
[Try it online](http://matl.tryitonline.net/#code=UXRfMjo0XCs&input=NDIw), or, [verify all test cases](http://matl.tryitonline.net/#code=Mjo0K3QyOjRcLQ&input=MTA).
```
Q    % takes implicit input and increments by one
t_   % duplicate, and negate top of stack (so it's -(n+1))
2:4  % push vector [2 3 4]
\    % mod(-(n+1),[2 3 4])
+    % add result to input+1
     % implicit display
```
[Answer]
# Matlab, 33 bytes
Another slightly different approach
```
@(a)feval(@(x)a+1+mod(-a-1,x),2:4)
```
[Answer]
# [05AB1E](http://github.com/Adriandmen/05AB1E), 8 bytes
Code:
```
>D(3L>%+
```
[Try it online!](http://05ab1e.tryitonline.net/#code=PkQoM0w-JSs&input=NA).
[Answer]
# Ruby, 27 bytes
Maps 2, 3, and 4 to the next multiple above `n`.
```
->n{(2..4).map{|e|n+e-n%e}}
```
[Answer]
# CJam, 15 bytes
```
5,2>rif{1$/)*N}
```
[Try it online!](http://cjam.tryitonline.net/#code=NSwyPnJpZnsxJC8pKk59&input=MTI) or [verify all test cases](http://cjam.tryitonline.net/#code=cU4vewogICAgNSwyPlJpZnsxJC8pKk59Ck59ZlI&input=MQo0CjQzCjEyMwo0MjAKMzE0MTUKMTA4MTE3Nw).
[Answer]
## Pyth, ~~11~~ 10 bytes
```
m*dh/QdtS4
```
[Test suite.](https://pyth.herokuapp.com/?code=m%2adh%2FQdtS4&input=1%0A4%0A43%0A123%0A420%0A31415%0A1081177%0A&test_suite=1&test_suite_input=1%0A4%0A43%0A123%0A420%0A31415%0A1081177&debug=0)
```
       tS4  generate range [2, 3, 4]
m           for d in range...
 *dh/Qd       d*(1+input/d)
```
Thanks to [Dennis](https://codegolf.stackexchange.com/users/12012/dennis) for a byte!
[Answer]
## Pyke, ~~11 9~~ 8 bytes
```
3FODQRc+
```
[Try it here!](http://pyke.catbus.co.uk/?code=3FODQRc%2B&input=4)
```
3FODQRc+
         - Q = input()
3F       - for i in range(3): # for i in [0,1,2]
  O      -  i += 2
    Q c  -   Q-(Q%i)
       + -  i+^
```
[Answer]
## Mathematica, 21 bytes
```
Ceiling[#+1,{2,3,4}]&
```
This is an unnamed function which takes a single integer as input and returns a list of the multiples.
The `Ceiling` function takes an optional second parameter which tells it to round up to the next multiple of the given number. Thankfully, it *also* automatically threads over its second argument such that we can give it a list of values and in turn we'll get rounded up multiples for all of those.
[Answer]
# Octave, 20 bytes
```
@(n)n-mod(n,d=2:4)+d
```
Examples:
```
octave:60> f(123)
ans =
   124   126   124
octave:61> f(1081177)
ans =
   1081178   1081179   1081180
octave:62> f(420)
ans =
   422   423   424
```
Worth noting that we can do this up to 9 without adding any extra bytes:
```
@(n)n-mod(n,d=2:9)+d
```
Output (2520 is the smallest positive integer evenly divisible by all the single digit numbers):
```
octave:83> f(2520)
ans =
   2522   2523   2524   2525   2526   2527   2528   2529
```
[Answer]
# C, ~~50~~ 46 bytes
```
i;f(int*a,int n){for(i=1;++i<5;*a++=n+i-n%i);}
```
*Thanks to Neil and nwellnhof for saving 4 bytes!*
Disappointingly long. I feel like there's some bit-shifting hack in here that I don't know about, but I can't find it yet. Returns a pointer to an array holding the three elements. Full program:
```
i;f(int*a,int n){for(i=1;++i<5;*a++=n+i-n%i);}
int main()
{
    int array[3];
    int n=10;
    f(array, n);
    printf("A:%d\tB:%d\tC:%d\n",array[0],array[1],array[2]);
    return 0;
}
```
[Answer]
# Haskell, 27 bytes
```
f n=[div n d*d+d|d<-[2..4]]
```
[Answer]
# Reng, 40 bytes
```
i1+#i2341ø>(1+)31j
i(2[¤,  q!^$]æl0eq!~
```
## 1: init
```
i1+#i2341ø
```
`i1+#i` sets the input to `1 + input`; this is because we are to work on the numbers strictly greater than the input. `234` initializes the tape with our iteration values, and `1ø` jumps to the beginning of the next line.
## 2a: loop
```
i(2[¤,  q!^$]æl0eq!~
```
`i(` puts the input at the STOS, and `2[` makes a new stack with the top 2 elements. `¤` duplicates the stack, and `,` does modulus. If there is a remainder, `q!^` breaks out of the loop to go to (b). Otherwise, we're fine to print. `$` removes the extra thingy, `]` closes the stack, and `æ` prints it nicely. `l0wq!~` terminates iff the stack contains zero members.
## 2b: that other loop
```
          >(1+)31j
        q!^
```
`(1+)` adds 1 to the STOS, and `31j` jumps to the part of the loop that doesn't take stuff from the stack. And profit.
---
That extra whitespace is really bothering me. Take a GIF.
[![REENNNNNGGG](https://i.stack.imgur.com/jzTxE.gif)](https://i.stack.imgur.com/jzTxE.gif)
[Answer]
## [Labyrinth](https://github.com/mbuettner/labyrinth), 19 bytes
```
:?
:
#/)
\ #
!"*@
"
```
[Try it online!](http://labyrinth.tryitonline.net/#code=Oj8KOgojLykKXCAjCiEiKkAKIg&input=NDI)
This outputs the results in the order `C, B, A` separated by linefeeds.
### Explanation
As usual, a short Labyrinth primer:
* Labyrinth has two stacks of arbitrary-precision integers, *main* and *aux*(iliary), which are initially filled with an (implicit) infinite amount of zeros. We'll only be using *main* for this answer.
* The source code resembles a maze, where the instruction pointer (IP) follows corridors when it can (even around corners). The code starts at the first valid character in reading order, i.e. in the top left corner in this case. When the IP comes to any form of junction (i.e. several adjacent cells in addition to the one it came from), it will pick a direction based on the top of the main stack. The basic rules are: turn left when negative, keep going ahead when zero, turn right when positive. And when one of these is not possible because there's a wall, then the IP will take the opposite direction. The IP also turns around when hitting dead ends.
Despite the two no-ops (`"`) which make the layout seem a bit wasteful, I'm quite happy with this solution, because its control flow is actually quite subtle.
The IP starts in the top left corner on the `:` going right. It will immediately hit a dead end on the `?` and turn around, so that the program actually starts with this linear piece of code:
```
:   Duplicate top of main stack. This will duplicate one of the implicit zeros
    at the bottom. While this may seem like a no-op it actually increases
    the stack depth to 1, because the duplicated zero is *explicit*.
?   Read n and push it onto main.
:   Duplicate.
:   Duplicate.
```
That means we've now got three copies of `n` on the main stack, but its depth is `4`. That's convenient because it means we can the stack depth to retrieve the current multiplier while working through the copies of the input.
The IP now enters a (clockwise) 3x3 loop. Note that `#`, which pushes the stack depth, will always push a positive value such that we know the IP will always turn east at this point.
The loop body is this:
```
#   Push the stack depth, i.e. the current multiplier k.
/   Compute n / k (rounding down).
)   Increment.
#   Push the stack depth again (this is still k).
*   Multiply. So we've now computed (n/k+1)*k, which is the number
    we're looking for. Note that this number is always positive so
    we're guaranteed that the IP turns west to continue the loop.
"   No-op.
!   Print result. If we've still got copies of n left, the top of the 
    stack is positive, so the IP turns north and does another round.
    Otherwise, see below...
\   Print a linefeed.
    Then we enter the next loop iteration.
```
After the loop was traversed (up to `!`) three times, all copies of `n` are used up and the zero underneath is revealed. Due to the `"` at the bottom (which otherwise seems pretty useless) this position is a junction. That means with a zero on top of the stack, the IP tries to go straight ahead (west), but because there's a wall it actually makes a 180 degree turn and moves back east as if it had hit a dead end.
As a result, the following bit is now executed:
```
"   No-op.
*   Multiply two zeros on top of the stack, i.e. also a no-op.
    The top of the stack is now still zero, so the IP keeps moving east.
@   Terminate the program.
```
[Answer]
# Matlab, 50 bytes
```
@(a)arrayfun(@(k)find(~rem(a+1:a+k,k))+a,[2 3 4])
```
[Answer]
## JavaScript (ES6), 26 bytes
Interestingly porting either @KevinLau's Ruby answer or @xnor's Python answer results in the same length:
```
n=>[2,3,4].map(d=>n+d-n%d)
n=>[n+2&-2,n+3-n%3,n+4&-4]
```
I have a slight preference for the port of the Ruby answer as it works up to 253-3 while the port of the Python answer only works up to 231-5.
[Answer]
# Retina, ~~62~~ ~~43~~ 26 bytes
17 bytes thanks to [@Martin Büttner](https://codegolf.stackexchange.com/users/8478/martin-b%C3%BCttner).
```
^
1111:
M!&`(11+):(\1*)
:
```
(Note the trailing newline.)
[Try it online!](http://retina.tryitonline.net/#code=XgoxMTExOgpNISZgKDExKyk6KFwxKikKOgo&input=MTExMQ)
Input in unary in `1`, output in unary in `1` separated by newlines.
## Previous 43-byte version:
```
.+
11:$&;111:$&;1111:$&
\b(1+):(\1*)1*
$1$2
```
[Try it online!](http://retina.tryitonline.net/#code=LisKMTE6JCY7MTExOiQmOzExMTE6JCYKXGIoMSspOihcMSopMSoKJDEkMg&input=MQ)
Input in unary, output in unary separated by semi-colon (`;`).
## Previous 62-byte version:
```
.+
$&11;$&111;$&1111
((11)+)1*;((111)+)1*;((1111)+)1*
$1;$3;$5
```
[Try it online!](http://retina.tryitonline.net/#code=LisKJCYxMTskJjExMTskJjExMTEKKCgxMSkrKTEqOygoMTExKSspMSo7KCgxMTExKSspMSoKJDE7JDM7JDU&input=MTExMQ)
Input in unary, output in unary separated by semi-colon (`;`).
[Answer]
# Octave, ~~27~~ ~~22~~ 20 bytes
MATLAB and Octave:
```
f=2:4;@(x)f.*ceil((x+1)./f)
```
Better (solutions are equivalent, but one may outperform the other when further golfed), MATLAB and Octave:
```
@(x)x-rem(x,2:4)+(2:4)
f=2:4;@(x)x+f-rem(x,f)
```
Only in Octave:
```
@(x)x-rem(x,h=2:4)+h
```
[Try here](https://ideone.com/gFh8IM).
[Answer]
## [Minkolang 0.15](https://github.com/elendiastarman/Minkolang), 17 bytes
```
n$z3[zi2+$d%-+N].
```
[Try it here!](http://play.starmaninnovations.com/minkolang/?code=n%24z3%5Bzi2%2B%24d%25-%2BN%5D%2E&input=57)
### Explanation
```
n$z                  Take number from input and store in register
   3[                Open for loop that repeats 3 times
     z               Push value in register on stack
      i2+            Loop counter plus 2
         $d          Duplicate stack
           %-+       Mod, subtract, add
              N      Output as number
               ].    Close for loop and stop.
```
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 11 bytes
-1 thanks to Adam
```
⎕(+-|⍨)1+⍳3
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT////1Hf1EdtE4Cktm7No94VhtqPejcb//9vYmQAAA "APL (Dyalog Unicode) – Try It Online")
Explanation:
```
⎕(+-|⍨)1+⍳3
       1+⍳3    ⍝ 2 3 4
⎕              ⍝ read n
  +-|⍨          ⍝ {⍺ + ⍵ - ⍵ | ⍺}
Let's look at how {⍺ + ⍵ - ⍵ | ⍺} is transformed to +-|⍨:
        {⍺ + ⍵ - ⍵ | ⍺}
       {⍺} + {⍵ - ⍵ | ⍺}
         ⊣ + ({⍵} - {⍵ | ⍺})
         ⊣ + (⊢ - ({⍵} | {⍺}))
         ⊣ + (⊢ - (⊢ | ⊣))
        (⊣ + ⊢ - (⊢ | ⊣))
          (+ - (⊢ | ⊣))
          (+ - (⊣ |⍨ ⊢))
          (+ - (|⍨))
          (+-|⍨)
```
[Answer]
# [><>](https://esolangs.org/wiki/Fish), 31 bytes
```
&2v
:&\&
?!\1+:{:}%
ao\n1+:5=?;
```
Expects `N` to be present on the stack at program start. [Try it online!](http://fish.tryitonline.net/#code=JjJ2CjomXCYKPT9cMSs6ezp9JTAKYW9cbjErOjU9Pzs&input=&args=LXYgMTA4MTE3Nw)
[Answer]
# Mathematica 28 bytes
```
f@n_:=n-n~Mod~#+#&/@{2,3,4}
```
---
```
f[1]
f[4]
f[43]
f[123]
f[420]
f[31415]
f[1081177]
```
{2, 3, 4}
{6, 6, 8}
{44, 45, 44}
{124, 126, 124}
{422, 423, 424}
{31416, 31416, 31416}
{1081178, 1081179, 1081180}
---
[Answer]
# R, ~~30~~ 26 bytes
(Reduced 4 bytes thanks to @Neil)
```
N=scan();cat(N+2:4-N%%2:4)
```
This (similarly to the rest of the answers I guess) adds 2:4 to the input and the reduces the remainder after running modulo on the same numbers.
[Answer]
# [UGL](https://github.com/schas002/Unipants-Golfing-Language), ~~51~~ ~~31~~ ~~25~~ 24 bytes
```
icu$l_u^^/%_u^*ocO$dddd:
```
[Try it online!](http://schas002.github.io/Unipants-Golfing-Language/?code=aWN1JGxfdV5eLyVfdV4qb2NPJGRkZGQ6&input=MTI)
## Previous 25-byte version:
```
iRcu$l_u$r^/%_u*ocO$dddd:
```
[Try it online!](http://schas002.github.io/Unipants-Golfing-Language/?code=aVJjdSRsX3Ukcl4vJV91Km9jTyRkZGRkOg&input=MTI)
## Previous 31-byte version:
```
iRcuuulu$cuuuuuu%-r^/%_u*oddcO:
```
[Try it online!](http://schas002.github.io/Unipants-Golfing-Language/?code=aVJjdXV1bHUkY3V1dXV1dSUtcl4vJV91Km9kZGNPOg&input=MTI)
## Previous 51-byte version:
```
i$$cuuu/%_ucuuu*@cuuuu/%_ucuuuu*@cuu/%_ucuu*ocOocOo
```
[Try it online!](http://schas002.github.io/Unipants-Golfing-Language/?code=aSQkY3V1dS8lX3VjdXV1KkBjdXV1dS8lX3VjdXV1dSpAY3V1LyVfdWN1dSpvY09vY09v&input=MTI)
[Answer]
# Java ~~70~~ 57
```
a->System.out.print(a/2*2+2+" "+(a/3*3+3)+" "+(a/4*4+4))
```
[Answer]
# [><>](https://esolangs.org/wiki/Fish), 28 bytes
```
i2&::&::&@%-+nao&1+:&5=?;20.
```
# How it Works
```
i2&::&::&@%-+nao&1+:&5=?;20.
i2&                                  Takes N as input and stores 2 in the register
   ::                                Duplicates N twice
     &::&                            Pushes the register onto the stack and duplicates twice
          @                          Shifts top the 3 values in the stack to the right
                                     Stack now looks like: N N & N & (& = register)
            %-+nao                   Computes the smallest multiple of k > N: N+k-N%k, where k is the value of the register
               nao                   Outputs answer and a newline.
                  &1+:&5=?;          Increments register by 1, ends the program if the register equals 5
                           20.       Jumps back into the loop, skipping taking input and initializing the register
```
You could save a byte if you are allowed to take input by initializing the stack with N, but TIO doesn't allow for that. The interpreter on <https://fishlanguage.com/> does.
```
2&::&::&@%-+nao&1+:&5=?;10.
```
[Try it online!](https://tio.run/##S8sszvj/30jNygqEHFR1tfMS89UMta3UTG3trY0M9P7/LwIA "><> – Try It Online")
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal) `r`, 8 bytes
```
3ɾ›ƛ⁰/⌈*
```
[Try it Online!](http://lyxal.pythonanywhere.com?flags=r&code=3%C9%BE%E2%80%BA%C6%9B%E2%81%B0%2F%E2%8C%88*&inputs=5&header=&footer=)
-1 thanks to lyxal
```
 ɾ       # Range 1...
3        # Literal
  ›      # Incremented (2...4)
   ƛ     # Map to...
       * # Product of...
          # Current item (implicit)
       * # And...
      ⌈  # Floor of
         # (Implicit) current item
     /   # Divided by...
    ⁰    # Input
```
]