[Question]
  [
[Related](https://codegolf.stackexchange.com/questions/246025/average-ignorant-sets-of-integers).
Given a list of 3 or more positive integers, remove every number X for which there is another number Y in the list and the average of X and Y is also in the list. In other words, if X, Y, and the average of X and Y are all in the input, neither X nor Y should appear in the output.
Note: Pairs of numbers are not successively removed from the list, rather all at once. This avoids ambiguity. A pair of numbers whose average is in the list will be removed even if one or both of the numbers are already part of another such pair.
The average of two numbers is their sum divided by two.
Examples:
```
input => output
explanation
[1, 2, 3] => [2]
1 and 3 are removed because their average (2) is in the list.
[1, 2, 3, 4] => []
1 and 3 are removed because their average (2) is in the list,
2 and 4 are removed because their average (3) is in the list.
[1, 3, 4, 5] => [4]
1 and 5 are removed because their average (3) is in the list,
3 and 5 are removed because their average (4) is in the list.
[1, 5, 10, 20, 40] => [1, 5, 10, 20, 40]
No numbers are removed; No pair of numbers also has their average in the list.
[1, 5, 6, 10] => [1, 5, 6, 10]
[1, 2, 3, 4, 10, 52, 100, 200] => [10, 52, 200]
[1, 2, 3, 5, 8, 13, 21, 34] => []
```
You may assume numbers are given in ascending order with no duplicates.
[code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") Shortest code wins.
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~9~~ 7 bytes
```
+HfḊʋÐḟ
```
[Try it online!](https://tio.run/##y0rNyan8/1/bI@3hjq5T3YcnPNwx///hdm/NyP//ow11FIx0FIxjdRRgTB0FEygPxNRRMIXyTHUUDA2ASoDYxAAhZgYSRtUOUWhqBKLBOlDlgZosgFJAlhHIEpNYAA "Jelly – Try It Online")
```
     Ðḟ    Remove elements for which
+          that element plus each element of the list
 H         halved
   Ḋ       has more than one element
  f ʋ      after being filtered to only elements of the original list.
```
[Answer]
# [J](http://jsoftware.com/), 27 22 15 14 bytes
```
-.&,~:/~*+:-/]
```
[Try it online!](https://tio.run/##XY5BCsIwFET3PcWg0FqbpEmaiKQUioIrceG@K2kRNx5AyNXrb9IKdfFJ8v7MZF7jRmQDGocMDBKOhguc79fLyEXKvCv9vnC87MY8uZ0ELT9t7et261PW9cIHAXdtUfqkfzzfGKBQwcAm8a3RBKZRRZBl4G5BMBHuFINlUJJB0xiZz6I/vFIfps1KGEjUKAmrySV/e81QUUaMs3o6Q@5sMHPRWH5ddTHTF0fy0U0Tq8z4BQ "J – Try It Online")
Consider `1 3 4 5`.
* `+:-/]` We note that if `c = (a + b)/2`, then `2c - a = b`. So we can double the input,
and create a subtraction table between that doubled input and the original input:
```
1 _1 _2 _3
5  3  2  1
7  5  4  3
9  7  6  5
```
Now any element in that table not on the diagonal is the `a` or `b` giving rise to
a `c` in the original list, and thus invalid.
* `~:/~*` So zero out the diagonal:
```
0 _1 _2 _3
5  0  2  1
7  5  0  3
9  7  6  0
```
* `-.&,` Flatten, and then remove all the table elements from the original list:
```
4
```
[Answer]
# [R](https://www.r-project.org), ~~48~~ 46 bytes
```
\(v)v[!v%in%combn(v,2)[,combn(v,2,mean)%in%v]]
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72waMGiNNulpSVpuhY39WI0yjTLohXLVDPzVJPzc5PyNMp0jDSjdeBsndzUxDxNkHRZbCxU15c0jWQNQx0FIx0FY01NZQVbO4Voo1guJFEdBROYBFwcJKijYAoTN4FLmOooGBoA9QGxiQFMGl0cWbUZSAJVIVgI3QkQ_aZGIBpsEEITVBwohKYJaJYFUD2QZQRyM8IbEL8vWAChAQ)
[Answer]
# [K (ngn/k)](https://codeberg.org/ngn/k), 17 bytes
```
{x^/x+(x-\:x)^'0}
```
[Try it online!](https://ngn.codeberg.page/k#eJx1kd1uwyAMhe95CkeREsiPDDSZJrZMfY+mVLnJM3jK0mevoWnSrJuEMJzPHIwZ3UQeqZRU946Uz/UsxOim6Qdx6NDZYnDMvpXXM7oTnS80R24+08EPPnDGOyal6WpMc98baQvVU61ylf5mZW/Taod2pFbRcmF0zExXIuZD17v8fim6lb2aRpQl+GoaogvnMkr+OcdVFl8en2tcnsa9ktcuJVXUoQBbbPJD4B5uogzC0tlVpZKVE33QObZ7/PMLwICFwyNCE1ccoY2rFowGq6HRy/aNhS070NbyHJI2vYV3MAew7NQ8JbPlsTICRWVFokXViN0Fq/3dNBgmYdwA8bGKRg==)
Dang, [Jonah's solution](https://codegolf.stackexchange.com/a/248996/78410) translates very well to K.
```
{x^/x+(x-\:x)^'0}
      (x-\:x)      self difference table
             ^'0   remove zeros from each row
    x+             add i-th item of x to i-th row of matrix above
 x^/               seeded reduce: remove all numbers that appear
                   in the matrix from x
```
---
# [K (ngn/k)](https://codeberg.org/ngn/k), 22 bytes
```
{((*>^/^\+\2#,x-)')_x}
```
[Try it online!](https://ngn.codeberg.page/k#eJx1kF0OwiAMgN85RZclG8wtBRzGEGe8h4jhZWfATO8uxZ85jQmhpV/7NWG0E+fN3qN3K6fLNnaiFud4Y2y003RFDANa3QTLY3cRXt7QHuOJGoirXRl88MQTXjDO1dBhWXunuG6Ey+Lym807X2hBOpGVTxYPlRpWiHUYnK0fS9G+2a80o6rAXylFS3NVLP7M/f0XUKBh/YrQ5yxFMDkzoCRoCb18PjepMHcTNTrd1DTXDWxBrUEnU//RbBiyVrNCsrZnC/fb/PCRq6BzB9ykakw=)
I think this idea is not touched well yet (or at least not explained well in other answers).
The idea here is: given an element E of list X, E is to be removed from the result if:
* there exists two other elements E2 and E3 of X such that E2 = (E + E3)/2
* ⇔ E, E2, E3 forms an arithmetic progression
* ⇔ E2 = E + k, E3 = E + 2k for some nonzero k
* ⇔ X-E (elementwise) contains k and 2k for some nonzero k
```
{((*>^/^\+\2#,x-)')_x}
{((             )')_x}  apply to each element E and keep those that gives 0
              x-    L = X-E
         +\2#,      (L, 2L)
     ^/^\           set intersection of L and 2L
   *>      first of grade down (index of max)
           all k's (including zero) are found in increasing order;
           index of max is nonzero iff there exist some nonzero k's
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~10~~ 5 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
ʒ+;Ãg
```
Byte-count halved thanks to *@Steffan* by porting [*@UnrelatedString*'s Jelly answer](https://codegolf.stackexchange.com/a/249019/52210).
[Try it online](https://tio.run/##yy9OTMpM/f//1CRt68PN6f//RxvqKBjpKBjrKJjoKBga6CiYGoFoIMPIwCAWAA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfaXLoZX/T006tM6lSNv6cHP6/1qd/9HRhjpGOsaxOhBaxwTMAtI6pmCWqY6hgY6RgY6JAZRrBhRAqAbJmhoCSZAihLipjoWOobGOEdAkk9hYAA).
**Explanation:**
```
ʒ      # Filter the (implicit) input-list by:
 +     #  Add the current value to each in the (implicit) input-list
  ;    #  Halve each
   Ã   #  Only keep those values from the (implicit) input-list
    g  #  Pop and push the length to get the amount of remaining values
       #  (only 1 is truthy in 05AB1E)
       # (after which the filtered result is output implicitly)
```
[Answer]
# [Haskell](https://www.haskell.org), 39 bytes
```
f a=[x|x<-a,[1]==[1|z<-a,elem(2*z-x)a]]
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m708I7E4OzUnZ8GCpaUlaboWN9XTFBJtoytqKmx0E3WiDWNtbaMNa6pAnNSc1FwNI60q3QrNxNhYqPLO3MTMPAVbhZR8LgWFgqLMvBIFFYU0hWhDHWMdEx3TWHRRUx0zHUMDDGEFIx0FYx0FEx0FQwMdBVMjEA1kGBngVGqqo2ABVAVkGQHFjE2gDoL5AwA)
ovs and Wheat Wizard each saved a byte. Thanks!
[Answer]
# JavaScript (ES6), 50 bytes
```
a=>a.filter(x=>!a.some(y=>x-y&&a.includes(y*2-x)))
```
[Try it online!](https://tio.run/##fY5BDsIgEEX3ngI3DRhKWizGDVzEuJi01NQgmFINnB5Bt7WLyUzyXv78O7zB9/P0XGrrBp1GmUAqYONkFj3jINUemHcPjaNUoY5VBWyyvXkN2uN44HUghKTeWe@MZsbd8IgvLUWcouOVkN06oahbh4VQJNahoKhtckCervmrnIq1@foXI3jZ37xNPUees5kvXgqW4ukD "JavaScript (Node.js) – Try It Online")
### Commented
```
a =>            // a[] = input
a.filter(x =>   // for each value x in a[]:
  !a.some(y =>  //   test whether there is a value y in a[]:
    x - y &&    //     which is not equal to x
    a.includes( //     and is the average of x and
      y * 2 - x //     another value 2y - x that exists in a[]
    )           //
  )             //   end of some()
)               // end of filter()
```
[Answer]
# [K (ngn/k)](https://codeberg.org/ngn/k), 20 bytes
```
{x^/a*~=#a:-x-\:2*x}
```
[Try it online!](https://ngn.codeberg.page/k#eJxLs6quiNNP1KqzVU600q3QjbEy0qqo5eJKUzBUMFIwhtEKJmAWkFYwBbNMFQwNFIwMFEwMoFwzoABCNUjW1AhIghQhxE0VLBQMjRWMgCaZAABf3xgV)
Switched to @Jonah's approach.
-1 byte thanks to @ovs!
## Explanation
Input is *x*.
* `a:-x-\:2*x` subtraction table of 2*x* - *x* stored as `a`
* `a*~=#` multiply *a* by inverse of eye of *a* (i.e. zero out *a*'s diagonals)
* `x^/` remove table elements from *x*
[Answer]
# [Scala](http://www.scala-lang.org/), 52 bytes
```
s=>s.filter(i=>s.forall(j=>i==j|s.forall(_*2!=i+j)))
```
[Try it online!](https://tio.run/##dZHBTsMwDIbvewpv2qEBD21di9BEKnHggDhMGuKEEMq2FKUKXWmyCQn27MVJuzLKuESO/8@/LdushBbVZpnJlYXHXOxkKV6lWGppQH5Yma8N3BQFfPZ6AGuZQjqDB/n@dJfbZ@DJUVwZnpiLVGkry0D5eFMKrYOMJ4rz7KtNvJyFfa7OM8ZYBbATmjqJt8K15M4woFYAgYsmGOIUY4Y@HzKGHe1/BaNG60gktIZRR4txMsZwjNG4AX6luuwlSUec/54YwxnEIb3Ohwq85FPu@7cgxiucTDGkUaOaZowY5i5AG6RT@AKVF1uLtLqCTifXDK5H7R49sdlaImilac06k31TXZQqtzqvNw2gUggOOP@xbFQAM5jfwwyG3gdGCQxretAQUht5BN8uFvPFKR76HIYH@7rYT9XbV98 "Scala – Try It Online")
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~12~~ 10 bytes
```
f(εn¹Mo½+¹
```
[Try it online!](https://tio.run/##yygtzv7/P03j3Na8Qzt98w/t1T608////9GGOkY6xjomOoYGOqZGQNJAx8jAIBYA "Husk – Try It Online")
```
f(          )  # filter the input to keep only elements that satisfy:
         ½+    # half the sum  
       Mo  ¹   # with each other element of the input 
    ε          # has only 1 element
     n¹        # shared with any elements of the input
```
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), ~~9~~ 7 bytes
```
'?+½?↔₃
```
[Try it Online](https://vyxal.pythonanywhere.com/#WyIiLCIiLCInPyvCvT/ihpTigoMiLCIiLCJbMSwgMiwgMywgNCwgMTAsIDUyLCAxMDAsIDIwMF0iXQ==) or [verify all test cases](https://vyxal.pythonanywhere.com/#WyJhUGoiLCJ2aMabwqMiLCInwqUrwr3CpeKGlOKCgyIsIjs7wqhad0o7Osabw7figbxg4p2M4pyFYGk7wqhaJMO3JF9cImAgPT4gYGpcXCBKcCIsIlsxLCAyLCAzXSwgWzJdXG5bMSwgMiwgMywgNF0sIFtdXG5bMSwgMywgNCwgNV0sIFs0XVxuWzEsIDUsIDEwLCAyMCwgNDBdLCBbMSwgNSwgMTAsIDIwLCA0MF1cblsxLCA1LCA2LCAxMF0sIFsxLCA1LCA2LCAxMF1cblsxLCAyLCAzLCA0LCAxMCwgNTIsIDEwMCwgMjAwXSwgWzEwLCA1MiwgMjAwXVxuWzEsIDIsIDMsIDUsIDgsIDEzLCAyMSwgMzRdLCBbXSJd).
*-2 bytes by porting Unrelated String's Jelly answer*
## How?
```
'?+½?↔₃
'       # Filter for:
 ?+     #  Add the input (vectorizes)
   ½    #  Halve each
    ?↔  #  Remove elements that are not in the input
      ₃ #  Is the length equal to 1?
```
[Answer]
# [Ruby](https://www.ruby-lang.org/), 39 bytes
```
->l{l-l.permutation(2).map{|a,b|a*2-b}}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y6nOkc3R68gtSi3tCSxJDM/T8NIUy83saC6JlEnqSZRy0g3qbb2f4FCWnS0oY6RjnFsLBeUo2Cko2Cso2Cio2BooKNgagSigQwjAwOgmv8A "Ruby – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/)
## 58 bytes with unordered sets
*Thanx to [Jitse](https://codegolf.stackexchange.com/users/87681/jitse)!*
```
lambda l:{*l}-{a for a in l for b in{*l}-{a}if(a+b)/2in l}
```
[Try it online!](https://tio.run/##VY3RCsIgFIav6ynOpZbR5jRi0JMsL5SQBHNjeBPDZzfPMmIX4nfO9/@c6R2fY@iyvd2z1y/z0OD75eDTadFgxxk0uAB@RVOwquQs0UdDzxxtyqgjJoehZcAZdIrBDxmIOiEykHWSDNqmRMoTzX93wfW2/g1Kjv/a2PpSuhZViOMRoVS/302zC5FYEinNHw "Python 3 – Try It Online")
## ~~62~~ 61 bytes with ordered lists
```
lambda l:[a for a in l if{(a+b)/2in l for b in{*l}-{a}}=={0}]
```
[Try it online!](https://tio.run/##VY3NCsMgEITP7VPsUVtLjfmhBHwS60Ep0oBNQvBSxGe3bppSclh2Zr4ddn6H5zTW2cl79uZlHwZ8rwy4aQEDwwgeBheJOVt6FatFYguJJ58u0aQkZeRJZ8wDNpSqGAgGtWbwkwyazaFk0G6uZVDxclKm4f@sw3hf/x62Avfa2PNSuhVUlMAnjdb98TAvwxiII4HS/AE "Python 3 – Try It Online")
[Answer]
# [Nibbles](http://golfscript.com/nibbles/index.html), 7 bytes (14 nibbles)
```
|$~<<`&*2@+@_
```
```
|$~<<`&*2@+@_
|               # filter
 $              # input list
  ~             # keeping only elements that are falsy for
   <<           #   discard first element of
     `&         #   common elements of
       *2@      #     twice the input list
                #     and
          +@_   #   sum of this element and the input list
```
[![enter image description here](https://i.stack.imgur.com/D5Mig.png)](https://i.stack.imgur.com/D5Mig.png)
---
Works on the basis that if the average of X and Y is Z, then X+Y=2\*Z. So we just remove all Xs whenever there's a Y that when added to it gives twice one of the other elements of the input.
Step-by-step for input of `[1, 2, 3, 4, 10, 52, 100, 200]`:
```
|$              # for each element x in input=[1, 2, 3, 4, 10, 52, 100, 200]
  ~             # keep it if the following function returns an empty list (falsy):
     `&         #   find elements in common between:
       *2@      #      double the input: [2, 4, 6, 8, 20, 104, 200, 400]
                #   and:
          +@_   #      input + x: 
                #         so, when x=1 => [2, 3, 4, 5, 11, 53, 101, 201]
                #               common elements = [2, 4]
                #             when x=10 => [11, 12, 13, 14, 20, 62, 110, 210]
                #               common elements = [20]
   <<           #   and remove the first element:
                #         so, when x=1 => [4] => so won't keep it
                #             when x=10 => [] => so we'll keep it
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 10 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
ŒcSe¥ƇḤFḟ@
```
A monadic Link that accepts a list of positive integers and yields the filtered list.
**[Try it online!](https://tio.run/##y0rNyan8///opOTg1ENLj7U/3LHE7eGO@Q7///@PNtRRMNJRMNZRMNFRMDTQUTA1AtFAhpGBQSwA "Jelly – Try It Online")**
### How?
```
ŒcSe¥ƇḤFḟ@ - Link: list L
Œc         - ordered pairs (L)
      Ḥ    - double (L) (vectorises)
     Ƈ     - filter the pairs keeping those for which:
    ¥      -   last two links as a dyad - f(pair, doubled L)
  S        -     sum (pair)
   e       -     exists in (doubled L)?
       F   - flatten (this list of pairs whose sum is in the doubled L)
         @ - with swapped arguments:
        ḟ  -   filter discard (take L and remove the pair elements)
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), ~~12~~ 10 bytes
```
-Qs-L-LydQ
```
[Try it online!](https://tio.run/##K6gsyfj/XzewWNdH16cyJfD//2hDHQVjHQUTHQXTWAA "Pyth – Try It Online") or [Verify all test cases](https://tio.run/##K6gsyfiv/F83sFjXR9enMiUwUMHW9f//aEMdBSMdBeNYLhhLR8EEwgGxdBRMIRxTHQVDA6ACIDYxgAuZgURRtEKUmRqBaLB6FGmgFgugDJBlBLLAJBYA "Pyth – Try It Online")
```
-Qs-L-LydQ
    L     (Q) # Left map over the implicit input with variable `d`:
      L  Q    #   Left map over the input with variable `k`:
     - yd     #     d*2 - k
   -          #   Remove d from the resulting list
  s           # Flatten
-Q            # Remove elements of the resulting list from the input
```
### 12-byte solutions
```
fqFf}-yYTQQQ
```
```
-Qsf}.OT-QT*
```
[Answer]
# [Factor](https://factorcode.org) + `math.unicode`, ~~57~~ ~~51~~ 50 bytes
```
[| s | s [ s n+v 2 v/n s ∩ length 1 > ] reject ]
```
[Attempt This Online!](https://ato.pxeger.com/run?1=XU-7bsJAEOz9FdNHEPvACAUpbURDE6VCFCezJkb22dydLfHq-QcaN0TKJ9Gm5CvYixvbK-1jZnd2tdefWEY21_X98fU5X3y8IZP2e1iqJMrXhEKTtftCJ8rC0K4kFZFBrPfNWEVOa7AhRVqmyUHaJFfmv4k0j2RqMPO8owe2IwIIjHDuoHELOxS2cIjAh_Ax9jvkxNH9LUyFgqMT9LshpghGEHzBnTvfShsPpnexPMHA-ZJdvVQ8XL0qrv8uv0hJbfiLAO9YQdOWX8WqUd4yWWDY1HXd5Cc)
[Answer]
# [Desmos](https://desmos.com/calculator), ~~80~~ 76 bytes
```
f(l)=l[[[(.5k-l)^2.minfork=l[m]+l[(L-m)^2>0]].minform=L]>0]
L=[1...l.length]
```
This is probably a terrible way of doing it, but whatever. Also, the "words" `minfork` and `minform` that appear in the code are very much intentional, though you will quickly see what they actually parse as in the graph links :P.
[Try It On Desmos!](https://www.desmos.com/calculator/xhboevghmj)
[Try It On Desmos! - Prettified](https://www.desmos.com/calculator/hflewhjjth)
[Answer]
# [T-SQL] 111 bytes
```
DELETE FROM T WHERE EXISTS(Select*From T Y Join T Z ON T.ID NOT IN(Y.ID,Z.ID)And Y.ID<>Z.ID And T.N+Y.N=2*Z.ID)
```
Formatted:
```
DELETE FROM T
WHERE EXISTS(
    Select *
    From T as Y
    Join T as Z
        ON T.ID NOT IN(Y.ID, Z.ID)
        And Y.ID <> Z.ID
        And T.N+Y.N = 2*Z.ID)
```
I *could* save one more byte by using the excremental SQL-89 joins, but my soul is worth more than one byte.
[Answer]
# [Arturo](https://arturo-lang.io), 41 bytes
```
$[a][a--map permutate.by:2a'p[-p\0*2p\1]]
```
[Try it](http://arturo-lang.io/playground?I0bU8I)
Port of G B's [Ruby answer](https://codegolf.stackexchange.com/a/249099/97916).
[Answer]
# [Thunno](https://github.com/Thunno/Thunno), \$ 14\log\_{256}(96)\approx \$ 11.52 bytes
```
gz0+2/z0sAqS2<
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72sJKM0Ly9_wYKlpSVpuhbr0qsMtI30qwyKHQuDjWwgglC5BWuiDXUUjHUUTHQUTGMhYgA)
#### Explanation
```
g   # Filter:
z0+ # Add input
2/  # Halve each
z0  # Push input again
sAq # Each is in the input?
S2< # Sum is less than 2?
```
[Answer]
# [Pyt](https://github.com/mudkip201/pyt), 16 bytes
```
ĐĐ2*⇹ɐ-ĐŁřĐɐ≠*Ƒ\
```
[Try it online!](https://tio.run/##AS0A0v9weXT//8SQxJAyKuKHucmQLcSQxYHFmcSQyZDiiaAqxpFc//9bMSwyLDMsNF0 "Pyt – Try It Online")
Port of [Jonah's J answer](https://codegolf.stackexchange.com/a/248996/116013)
[Answer]
# [Julia 1.0](http://julialang.org/), 32 bytes
```
!l=l[l.|>i->sum(i.+l.∈[2l])<2]
```
[Try it online!](https://tio.run/##ZY5RCsIwDED/d4rsr8M6XN3EDze8gCcY@wisQiVWaaf44QE8pxeZrXEwsFCavLykOd3IYPEYx5Rqail/NmbZ@NtZmHxB@fv1ahV12U514/HiwICx4DT2ZKz2IksgHJQaatB3JHHQA@ZXdF4Lk3H16owdyAqEuoEUGe7Re@2GkEMdWhNt@7EtJCgJ6y6KreqSCUgomTGKuYSKUcmsklCsgh1uueLKH53ETaRzh8H8O@6rVHy/Ayb/RyOY@WHGNqghUnG/adsP "Julia 1.0 – Try It Online")
[Answer]
# [PowerShell Core](https://github.com/PowerShell/PowerShell), 68 bytes
```
($a=$args)|?{$_-notin($a|%{$a-ne($c=$_)|%{$_,$c*(($_+$c)/2-in$a)}})}
```
[Try it online!](https://tio.run/##lU/RSsMwFH3vV1zGVRJNcKub@FIsFH3wRXF7Eyk1Zm6yNbPJVGj77TVJtyLbHmagNPece07OWalvWeiZXCy4UIVscBqVDcEswqx417S6KTHluTLz3ILVSYkZzyVBEWFK3ZgyFGeEYHqOgl6EfJ5jRuua1k0dBDEJwB4GMYnJgEHI4JK6KaR0n2Ew9OQu5wgGI88Nd8kRg0Hf6u037PuVPXBfceX4P8vtfDhSazUK3d97boQb0M0Hhdb22mrsLXQdumoUKrhTxW0mZvzh9UMKA6XXo5HaMED5s7KgfIMIMG2ZQur1wljgFKcQuz2PPz@Ok7U2atn6vMStkTvjtRBSa3@PgGwdKhirwmzfrSBR@ZcszETxe61y4IlaruyqpsDlp5V1WY4Wdgl6ExsTkkzLnmviQh/t0pk8tbE3Nf7bwtvUQd38Ag "PowerShell Core – Try It Online")
[Answer]
# [Burlesque](https://github.com/FMNSSun/Burlesque), 26 bytes
```
Js12CB:U_f{avg1j~[}g1jFL\\
```
[Try it online!](https://tio.run/##SyotykktLixN/V@tZGunZG2tG1uUqFmS8t@r2NDI2ckqND6tOrEs3TCrLroWSLr5xMT8rw3P@R9tqKNgpKNgHKtga6cQbRTLBRPQUTCBiMUqgMVAAjoKphAxE4g6Ux0FQwOgciA2MYDIYIjCFJqBRJHVQASQ7YPoMzUC0WADYOqhoiABJPVAMyyASoEsI5D7YM4FAA "Burlesque – Try It Online")
Takes input as block of doubles
```
J          # Duplicate
s1         # Store as 1
2CB        # Combinations of length 2
:U_        # Filter for unique (guaranteed safe by no dups)
f{avg1j~[} # Filter for average contained in original list (1)
g1         # Get 1
j          # Reorder stack
FL         # Flatten
\\         # Remove elements contained in (1) also in averages
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 16 bytes
```
ＩΦθ¬⊙θ∧⁻κμ№⊗θ⁺ιλ
```
[Try it online!](https://tio.run/##LYvBCoMwEER/ZY8rbCGm9tSTWLy1eBcPqQoN3SYYk4Jfv0ZwLvN4w4wfE0ZvWKQL1kVszBqxtRzngAvBy0es3XZg7SZ8WpdW/BL8CoLGp3x4@PTmecIlm47zagm4OHMX6fuSQBNcCSqCUhHc9NEZtFLDIJc/7w "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
  θ                 Input list
 Φ                  Filtered where
     θ              Input list
   ¬⊙               No elements satisfy
       ⁻κμ          Indices differ
      ∧             Logical And
            θ       Input list
           ⊗        Doubled
          №         Does not contain
             ⁺ιλ    Sum of current elements
Ｉ                   Cast to string
                    Implicitly print
```
[Answer]
# [Haskell](https://www.haskell.org), 67 bytes
```
f a=[z|z<-a,not$elem z[x|x<-a,y<-a,x/=y,even$x+y,div(x+y)2`elem`a]]
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m708I7E4OzUnZ8GCpaUlaboWN53TFBJto6tqqmx0E3Xy8ktUUnNScxWqoitqKkAilSCiQt-2Uie1LDVPpUK7Uicls0wDSGsaJYCUJiTGxkKMgpoIMxkA)
[Answer]
# [Zsh](https://www.zsh.org/), 75 bytes
```
for x;for y;((s=x+y,s%2||x==y))||a+=(${=${(M)@:#$[s/2]}:+$x $y})
<<<${@:|a}
```
[Try it online!](https://tio.run/##bZDBbsIwEETv/oqpcNUEkAoBpAqIxKGH9tBjTxVSXLIBqyRGsQNJCd@e2gGKVPXitXbXM/P8rTdN4vlek6gc5cyd1czzdFj2qr6@D@q6DMPK9@ta9EKPH0N@9N78xbTDP/RjsDxNe7wEr04@m8/n/LiY1uLU@IwlGCLA@FJH13rp2IpJe5tgOEAwwHhwW3GtSWBPN7n1J3jCcITAPh8zRqU0jHXwrEhnDwYHlX/1IbIYZkPISWiV4bCpsFLFNsYnodCUFFs4xLXaJjJbT9l/1GloyW7sdX3HFx/eq8/T5e8/OGbf2b9QToh4GkFqULmzASiGtXYpuruc9lIVuou92BYElYCnNos1JMTKRmj3RC7NJiUjV2cJLVVmtd@1WziLZ9qQiJ1AtItazKi/C@3kL55MUKkCGdkYRkGLPbUe1yiQhnJhrEPzAw "Zsh – Try It Online")
Not as compact as I was expecting...
```
for x;for y   # for $x, $y in the Cartesian product of the list with itself
    ((s=x+y,s%2||x==y)) ||          # test if the sum is odd or x == y. If not,
    a+=(${=${(M)@:#$[s/2]}:+$x $y})
#          ${(M)@:#$[s/2]}          # substitute the average if found in $@
#       ${                :+$x $y}  # if non-empty, substitute "$x $y"
#   a+=(${=                      }) # split on spaces and add it to $a
<<<${@:|a}                          # set difference
```
[Answer]
# [Python](https://www.python.org) + NumPy, 50 bytes
```
lambda a:a[((a+[[a]]).T==a+a[:,1>0]).sum((0,1))<2]
```
[Attempt This Online!](https://ato.pxeger.com/run?1=VY5BCsIwEEX3PcUsExxLkrZSivUU7mIWI1Is2DTEFuxZ3BRE8Urexth24-q9_z8Dc3-5oTu3dnxU5eHZd9U6_6gLNccTARWkGaOV1mQMj_dlSSvSBcqdCPHaN4wJlJxvlVku33XjWt-B7Rs3AF3BuqhqPdwAagtaosLE4ExMJwvEbLIMpUAlMBVThAxhgyCXpBAShPRXhEn9GESJvzmc5GEJpkKXpKaIwPnadqxi1sXkPQ3sxjmf_x3HmV8)
Straightforward masking with a few tricks to shorten the required indexing operations without having to explicitly import numpy.
#### How?
Construct 3d table of *z,y,x* each running through the input list *a*. Each cell is True if *2z=y+x* and False otherwise. Fixing *x=a* count solutions *z,y*. If *a* is not part of an averaging pair there is only solution *z=a,y=a*, otherwise there are more. Use boolean indexing to filter *a* accordingly.
`(a+[[a]]).T` is a shorter surrogate for `2*a[:,None,None]` and `a[:,1>0]` is shorter than the more natural `a[:,None]`.
]