g | x | w | all
Bytes Lang Time Link
012APL Dyalog Unicode201012T145559ZVen
009Vyxal210809T093254Zemanresu
010Pyth210809T062721ZAnders K
011Vyxal210529T085504ZWasif
063PowerShell210527T162654Zmazzy
083C gcc201011T230608ZNoodle9
038Ruby201012T174106Zellcs
064Scala201011T171953ZTomer Sh
01005AB1E201009T233220ZJonathan
007Jelly201009T213917ZJonathan
040Ruby201010T162354ZEric Dum
049Perl 5201010T220342ZKjetil S
020APL+WIN201010T180550ZGraham
031R201010T122428ZDominic
009Husk201010T040225ZRazetime
032Charcoal201009T214704ZNeil
065JavaScript ES6201009T200037ZArnauld
01705AB1E201009T225551Zlyxal
043Python 3201009T222651ZJonathan
014Japt201009T212444ZShaggy
053Python 3201009T194655Zhyper-ne

APL (Dyalog Unicode), 13 12 bytesSBCS

1↓+/⌽(⌽⍳7)∘~

Try it online!

This is an atop of a train

1↓+/⌽(⌽⍳7)∘~
     (⌽⍳7)∘~ ⍝ Right side of the atop
       ⍳7    ⍝ Range
      ⌽     ⍝ Reverse
          ∘  ⍝ Composed with...
           ~ ⍝ ...without (to remove our arguments)
    ⌽        ⍝ Rotated by...
  +/         ⍝ ...the sum of the arguments
1↓           ⍝ Left side of the atop
1↓           ⍝ Drop leftmost (drop curried with 1)

Vyxal, 9 bytes

∑5*‹ʁ7%⊍Ḣ

Try it Online!

Porting Pyth saves two bytes.

Pyth, 10 bytes

>3-%R7t*5s

Takes input as a 3-element list of {0, …, 6}.

Try it online! Or see all 35 inputs.

How it works

         sQ   sum of input
       *5     multiply by 5
      t       subtract 1
   %R7        take each element of [0, that) mod 7
  -        Q  remove elements present in input
>3            last 3 elements

It’s helpful to preserve symmetry under rotations modulo 7, since that leaves just five equivalence classes to consider. A good starting point is the “average” \$\frac{x + y + z}{3}\$, where division by 3 is the same as multiplication by 5 modulo 7. It happens that if we start walking down from the average minus 2, taking the first three numbers that aren’t in the input set, the five equivalence classes are conveniently mapped one-to-one:

Vyxal, 11 bytes

7ɾ$⊍?∑N$ǔṫ$

Try it Online!

PowerShell, 35 63 bytes

based on the hyper-neutrino♦'s solution

+28 bytes thanks @DLosc

param($a)$b=1..7|?{$_-notin$a}
$b|%{$s+=$_}
$b|?{$_-ne$b[$s%4]}

Try it online!

C (gcc), 84 83 bytes

Saved a whopping 16 19 23 bytes thanks to the man himself ceilingcat!!!
Saved a byte thanks to Neil!!!

p;i;f(m){for(p=i=0;(L"᰸ᨴᘬᤲᔪ"[p]>>i%7&m)-m;p+=++i%7<1);p=(64>>i%7)+m^127;}

Try it online!

Takes input as \$3\$ bits set in the least-significant-\$7\$-bits of an int and returns the three other numbers likewise.

Explanation (before some golfs)

f(m){                                  // function taking an integer with  
                                       // 3 bits set in its 7 lsb  
                                       // representing the 3 input numbers  
     for(                              // loop over  
         p=L"ᔪᘬᤲᨴ᰸"                     // a sequence of 5 int values:
                                       //   5418,5676,6450,6708,7224
                                       // that are the 5 unique patterns of    
                                       // 3 set bits per 7 bits shifted and
                                       // repeated over 13 bits so that their  
                                       // 7th bit is unset:  
                                       //   5418 = 1010100101010
                                       //   5676 = 1011000101100  
                                       //   6450 = 1100100110010  
                                       //   6708 = 1101000110100  
                                       //   7224 = 1110000111000
                    ;;++p)             // no need to test for stopping  
                                       // since we must match one  
       for(i=7;i--;)                   // loop over shift values from 6 to 0    
         if((*p>>6-i&m)==m)            // if a shifted 7-bit slice of one of  
                                       // our patterns matches m we've found  
                                       // the correct bit to exclude from m's  
                                       // 4 unset bits
            return(1<<i)+m^127;        // add that bit to m and flip the 7   
                                       // lsb so the 3 other unset bits are  
                                       // now set to represent the 3 return
                                       // values  
 }

Ruby, 38 bytes

->s{n=s.sum;(([*1..7]-s)*9)[-n..-n+2]}

Try it online!

Stealing Eric's answer which based on Jonathan's answer. I would've commented to Eric, but i do not have enough reputation.

The actual difference: Using a range to get the three elemented slice.

Scala, 64 bytes

b=>1.to(7).diff(b).zipWithIndex.filter(_._2!=b.sum*3%4)map(_._1)

Try it online!

05AB1E, 10 bytes

7LsKsO(._¨

Try it online!

How?

7LsKsO(._¨ - (push the input)      e.g.: [2,4,7]
7          - push 7                      7,[2,4,7]
 L         - range                       [1,2,3,4,5,6,7],[2,4,7]
  s        - swap top two of the stack   [2,4,7],[1,2,3,4,5,6,7]
   K       - push a without bs           [1,3,5,6]
    s      - swap top two of the stack   [2,4,7],[1,3,5,6]  (implicit input swapped in)
     O     - sum                         13,[1,3,5,6]
      (    - negate                      -13,[1,3,5,6]
       ._  - rotate a left by b          [6,1,3,5]
         ¨ - remove rightmost            [6,1,3]
           - implicit print top of stack [6,1,3]

Jelly,  9 8  7 bytes

7RṚḟṙSḊ

A monadic Link accepting a list of the three numbers, from \$[1,7]\$, in sorted order which yields a list of other numbers, from \$[1,7]\$, not necessarily sorted.

Try it online! Or see all 35 (I sorted the resulting values for easier comparison).

How?

7RṚḟṙSḊ - Link: list A                   e.g.  [2,4,7]
7R      - seven range                          [1,2,3,4,5,6,7]
  Ṛ     - reverse                              [7,6,5,4,3,2,1]
   ḟ    - filter discard (A) -> B              [6,5,3,1]
     S  - sum (A)                              13
    ṙ   - rotate (B) left by (that)            [5,3,1,6]
      Ḋ - remove the leftmost                  [3,1,6]

Ruby, 40 bytes

->s{(([*1..7]-s)*9).last(s.sum).first 3}

Try it online!

Ruby port of Jonathan's answer.

Perl 5, 49 bytes

sub{@c=grep!/[@_]/,0..6;splice@c,-sum(@_)%4,1;@c}

Try it online!

Just a translation of the python answer from HyperNeutrino.

APL+WIN, 20 bytes

Prompts for input of a vector of integers

3↑(-+/¯2↑n)⌽n←(⍳7)~⎕

Try it online! Thanks to Dyalog Classic

R, 33 31 bytes

Edit: -2 bytes by using modulo -4 (which returns the negative of modulo 4)

(1:7)[v<--scan()][sum(v)%%-4-1]

Try it online!

Finds the 4 digits in 1..7 that aren't in the input, and excludes the one corresponding to the input sum (wrapping around).

TIO link tests that outputs are unique for each input, and shows output for every input.

(1:7)                   # vector of digits 1..7
     [          ]       # select elements
         -scan()        # excluding (negative indexes) input
      v<-               # and define v as (negative) input
                        # (so up to here we have the 4 elements that aren't in the input)  
     [              ]   # from these, select elements
      -                 # excluding (negative index)
       (sum(v)%%4+1)    # the sum of input, modulo 4, plus 1

Husk, 9 bytes

hṙ_Σ¹`-ḣ7

Try it online!

Charcoal, 39 38 34 32 bytes

NθI⁻¹²⁷⁺θX²⊟Φ⁷№ETXdhp﹪×℅λX²ι¹²⁷θ

Try it online! Link is to verbose version of code. I/O is as a 7-bit integer 7..112. Explanation: The ordinals of the string TXdhp have five bit patterns which I have arbitrarily chosen to be such that the result excludes 1. They are then cyclically rotated until one matches the input, at which point I have determined the excluded bit. This bit is then added to the original input, and finally the difference between 127 and the sum is printed.

Nθ                                  Cast input to integer
             ⁷                      Literal 7
            Φ                       Filter on implicit range
                TXdhp               Literal string `TXdhp`
               E                    Map over characters
                        λ           Current character
                       ℅            Ordinal
                      ×             Multiplied by
                          ²         Literal 2
                         X          Raised to power
                           ι        Outer index
                     ﹪              Modulo
                            ¹²⁷     Literal 127
              №                     Count (i.e. contains)
                               θ    Input
           ⊟                        Pop matching value
          ²                         Literal 2
         X                          Raised to that power
       ⁺                            Added to
        θ                           Input
   ⁻                                Subtracted from
    ¹²⁷                             Literal 127
  I                                 Cast to string
                                    Implicitly print

I arbitrarily chose the following five bit patterns to exclude 1 but any five even cyclically distinct patterns would work.

T   1010100
X   1011000
d   1100100
h   1101000
p   1110000

JavaScript (ES6),  66  65 bytes

Takes input as a 3-digit string. Returns a string in the same format.

f=(n,k=i=0)=>++k<8?(~n.search(k)||n*43%399%4==i++?'':k)+f(n,k):''

Try it online!

05AB1E, 17 bytes

7LIм{3.$IO(._Dg<£

Try it online!

It's a much longer version of the Jelly answer, so go upvote that too.

Python 3, 43 bytes

lambda s:([*{*range(7)}-s]*4)[-sum(s):][:3]

Try it online!

Japt, 14 bytes

As previously advertised, I'm a wee bit tipsy so this could well be wrong and, even if right, could probably be golfed a little.

7õ kU k϶UxÍu4

Try it or view (what I think is) the proof

Python 3, 53 bytes

def f(b):c=[*{*range(7)}-b];del c[-sum(b)%4];return c

Try it online!

-3 bytes thanks to FryAmTheEggman
-4 bytes by zero-indexing
-1 byte thanks to xnor