text:
Nth Differences
In math, one way to figure out what the type of a given relation (linear, quadratic, etc) is to calculate the differences.  To do so you take a list of y values for which the gap between the correspondent x values is the same, and subtract each one from the number above it, creating a list of numbers one shorter then the previous list.  If the resultant list is completely composed of identical numbers, then the relation has a difference of 1 (it is linear).  If they are not identical, then you repeat the process on the new list.  If they are now identical, the relation has a difference of 2 (it is quadratic).  If they are not identical, you simply continue this process until they are.  For example, if you have the list of y values [1,6,15,28,45,66] for incrementally increasing x values:
First Differences:

1
6   1-6  =-5
15  6-15 =-9
28  15-28=-13
45  28-45=-17
66  45-66=-21

Second differences:

-5
-9  -5+9  =4
-13 -9+13 =4
-17 -13+17=4
-21 -17+21=4

As these results are identical, this relation has a difference of 2

Your Task
Write a program or function that, when given an array of integers as input, returns the difference of the relation described by the array, as explained above.
Input
An array of integers, which may be of any length>1.
Output
An integer representing the difference of the relation described by the input.
Test Cases
Input                            => Output
[1,2,3,4,5,6,7,8,9,10]           => 1
[1,4,9,16,25,36]                 => 2
[1,2,1]                          => 2 (when there is only one value left, all values are automatically identical, so the largest difference an array can have is equal to the length of the array-1)
"Hello World"                    => undefined behavior (invalid input)
[1,1,1,1,1,1,1,1,1]              => 0 (all elements are already identical)
[1, 3, 9, 26, 66, 150, 313, 610] => 6

Scoring
This is code-golf, lowest score in bytes in each language wins for that language.  Lowest score overall gets the green checkmark.

Can the input be "invalid" as in, if the input is to NOT conform to the provided spec, should we error? Provide -1 as the output?

Behavior is undefined for invalid input (I don't care what your code does)

Shouldn't [1,2,1] give 2? [1,2,1] -> [1,-1] -> [-2]

@HyperNeutrino, yep, sorry.  I had a brain-fart there

Add this test case [1,3,9,26,66,150,313,610] -> 6 if you like

Related, potential dupe targets: https://codegolf.stackexchange.com/questions/q/4229/194 , https://codegolf.stackexchange.com/q/47005/194 , https://codegolf.stackexchange.com/q/65409/194 , https://codegolf.stackexchange.com/q/119301/194

@PeterTaylor the third one you suggested is really similar, so I don't know if this counts as a good question.

The description talks about an array with any number of integers, but all the test cases are arrays of at least 2 positive integers. Do solutions need to handle 0s, negative numbers, empty arrays, and arrays of a single element?

@PatrickStephansen, yes, yes, no, and yes.

Husk, 6 bytes
Thanks Leo for letting me use his version that works for [1,1,1,1,1,1]
←VE¡Ẋ-

Try it online!
Explanation
   ¡     Repeatedly apply function, collecting results in a list
    Ẋ-     Differences
 VE      Get the index of the first place in the list where all the elements are equal
←        Decrement

Whenever someone said Husk is the new Jelly, they were pretty dang right. >_<

Damn, I was gonna post this. Good job though, +1!

@Leo, test case I didn't see [1,1,1,1], can I use yours?

@H.PWiz sure, go on!

JavaScript (ES6), 47 bytes
f=a=>-a.every(x=>i=!x)||1+f(a.map(n=>n-a[++i]))

Test cases

f=a=>-a.every(x=>i=!x)||1+f(a.map(n=>n-a[++i]))

console.log(f([1,2,3,4,5,6,7,8,9,10]))    // 1
console.log(f([1,4,9,16,25,36]))          // 2
console.log(f([1,2,1]))                   // 2
console.log(f([1,1,1,1,1,1,1,1,1]))       // 0
console.log(f([1,3,9,26,66,150,313,610])) // 6

MATL, 8 bytes
`dta}x@q

Try it online! Or verify all test cases.
Explanation
This compuntes consecutive differences iteratively until the result is all zeros or empty. The output is the required number of iterations minus 1.
`      % Do... while
  d    %   Consecutive diffferences. Takes input (implicitly) the first time
  t    %   Duplicate
  a    %   True if any element is nonzero. This is the loop condition
}      % Finally (execute before exiting the loop)
  x    %   Delete. This removes the array of all zeros
  @    %   Push iteration index
  q    %   Subtract 1. Implicitly display
       % End (implicit). Proceed with next iteration if top of the stack is true

R, 50 44 bytes
function(l){while(any(l<-diff(l)))F=F+1
F*1}

Try it online!
Takes a diff of l, sets it to l, and checks if the result contains any nonzero values. If it does, increment F (initialized as FALSE implicitly), and returns F*1 to convert FALSE to 0 in the event that all of l is identical already.

Full program and +F trick for 5 bytes. Neat answer btw!

Mathematica, 49 bytes
(s=#;t=0;While[!SameQ@@s,s=Differences@s;t++];t)&

thanx @alephalpa for -6 bytes and @hftf -1 byte
and here is another approach from @hftf
Mathematica, 49 bytes
Length@NestWhileList[Differences,#,!SameQ@@#&]-1&

(s=#;t=0;While[UnsameQ@@s,s=Differences@s;t++];t)&

UnsameQ[1,2,1] is False; !SameQ[1,2,1] is True. I don't think the manual loop saves characters either: Length@NestWhileList[Differences,#,!SameQ@@#&]-1& is already the same length as yours after replacing UnsameQ with !SameQ.

Perl 6, 37 bytes
{($_,{@(.[] Z- .[1..*])}...*.none)-2}

Try it online!
Explanation: The function takes the input as one list. It then builds a recursive sequence like this: the first element is the original list ($_), the next elements are returned by {@(@$_ Z- .[1..*])} being called on the previous element, and that is iterated until the condition *.none is true, which happens only when the list is either empty or contains only zeroes (or, technically, other falsey values). We then grab the list and subtract 2 from it, which forces it first to the numerical context (and lists in numerical context are equal to the number of their elements) and, at the end, returns 2 less than the number of elements in the list.
The weird block {@(@$_ Z- .[1..*])} just takes the given list (.[] — so called Zen slice — indexing with empty brackets yields the whole list), zips it using the minus operator (Z-) with the same list without the first element (.[1..*]) and forces it to a list (@(...) — we need that because zip returns only a Seq, which is basically an one-way list that can be iterated only once. Which is something we don't like.) And that's it.

Changing @(.[] Z- .[1..*]) to [.[] Z-.[1..*]] should save two bytes.

Jelly, 7 bytes
-Iß$E?‘

Try it online!
Explanation
-Iß$E?‘  Input: array A
     ?   If
    E    All elements are equal
         Then
-          Constant -1
         Else
   $       Monadic chain
 I           Increments
  ß          Recurse
      ‘  Increment

Non-recursive alternative: IÐĿE€ċ0

Japt, 10 7 bytes
è@=ä-)d

Try it online!
Relies on the fact that the result is guaranteed to be within the length of the input array.
Explanation
è@=ä-)d     Implcit input of array U
 @          For each value in U...
  =ä-)      Update U to be equal to its subsections, each reduced by subtraction
      d     Check if any values in that are truthy
è           Count how many items in that mapping are true

By the end, this will map the array
[1, 3, 9, 26, 66, 150, 313, 610] to [true, true, true, true, true, true, false, false],
which contains 6 trues.
Previous 10 byte version
@=ä-)e¥0}a

Try it online!

Java 8, 191 + 58 = 249 198 140 bytes.
Thanks PunPun1000 for 51 bytes.
Thanks Nevay for 58 bytes.
int f(int[]a){int x=a.length-1,b[]=new int[x];for(;x-->0;)b[x]=a[x+1]-a[x];return java.util.Arrays.stream(a).distinct().count()<2?0:1+f(b);}

Try it Online!
Try it Online (198 byte version)
So, this is my first time posting here in PPCG (and the first time ever doing a code golf challenge). Any constructive criticism is welcome and appreciated. I tried to follow the guidelines for posting, if anything's not right feel free to point it out.
Beautified version:
int f(int[] a) {
    int x = a.length - 1, b[] = new int[x];
    for (; x-- > 0;) {
        b[x] = a[x + 1] - a[x];
    }
    return java.util.Arrays.stream(a).distinct().count() < 2 ? 0 : 1 + f(b);
}

Welcome to the site!

Instead of importing those modules you can just use java.util.stream.IntStream k = java.util.Arrays.stream(a);

In fact, there are a couple of changes you can make for free.  1) public doesn't need to be included in the byte count.  2) You should not be accepting a second parameter, but removing it can actually save bytes. 3) you can remove some unneeded brackets there

Not a saver but you should include a TIO if possible, here is an example with those suggestions at 198 bytes TIO

Also you might want to check out these tips pages for Java and All languages to help you get familiar with the more common golfing tricks.  Welcome to PPCG!

@PunPun1000 thanks for the input! The second parameter is meant to count the number of times the recursion was called (which is conveniently also the difference of the relation), is that wrong? I don't know how I could do it without that parameter. Also, I'll try to golf it down further with the tips you gave me, thanks again!

@J.Salle if you checked the TIO I linked above it shows how to avoid the second variable

@PunPun1000 yeah I just checked it. I'm not very good at this yet hahahah. I'll edit the post in a couple minutes, thanks for the tips!

140 bytes

@Nevay I'd never seen the x-->0 syntax before. Thanks for the tip.

I just noticed it's actually the loop condition, didn't see the first ; there.

APL (Dyalog Classic), 22 17 bytes
{1=≢∪⍵:0⋄1+∇2-/⍵}

Try it online!
Thanks to @ngn for -5 bytes!
How?

{ ... }, the function
1=≢∪⍵:0, if every element is equal in the argument, return 0
1+∇2-/⍵, otherwise, return 1 + n of the differences (which is n-1, thus adding one to it gives n)

it's shorter if you sacrifice tail-recursiveness: {1=≢∪⍵:0⋄1+∇2-/⍵}

Kotlin, 77 bytes
first post, tried to edit last answer on kotlin 2 times ;D
{var z=it;while(z.any{it!=z[0]})z=z.zip(z.drop(1),{a,b->a-b});it.size-z.size}

took testing part from @jrtapsell
TryItOnline

Welcome to PPCG! Nice first answer, an outgolf too.

Haskell, 46 bytes
g l|all(==l!!0)l=0|0<1=1+g(zipWith(-)l$tail l)

this simply recurses - zipWith(-)l$last l is the difference list of l. and g is the function that answers the question.

the recursive solution was the good one.

@jferard that's very true

Java (OpenJDK 8), 98 94 bytes
a->{int o=0,i,z=1;for(;z!=0;o++)for(i=a.length-1,z=0;i>o;a[i]-=a[--i])z|=a[o]^a[i];return~-o;}

Try it online!

Jelly, 7 bytes
IÐĿEÐḟL

Try it online!
Explanation
IÐĿEÐḟL  Main link
 ÐĿ      While results are unique (which is never so it stops at [])
I        Take the increments, collecting intermediate values # this computes all n-th differences
    Ðḟ   Filter out
   E     Lists that have all values equal (the first n-th difference list that is all equal will be removed and all difference lists after will be all 0s)
      L  Take the length (this is the number of iterations required before the differences become equal)

-1 byte thanks to Jonathan Allan

@Gryphon Done! :)

IÐĿEÐḟL for seven (I see Miles also found a seven using recursion).

@JonathanAllan Cool thanks!

JavaScript (ES6), 58 bytes
f=a=>+(b=a.slice(1).map((e,i)=>e-a[i])).some(e=>e)&&1+f(b)

+0, not enough Jquery :p. Really though, +1, nice job, I know I would never be able to golf in JS.

Python 2, 65 bytes
-7 bytes thanks to Jonathan Allan.
f=lambda l,c=1:any(l)and f([j-i for i,j in zip(l,l[1:])],c-1)or-c

Try it online!

Save a byte initialising c to 1, decrementing and then using print-c.

Save six more by making it into a recursive function: f=lambda l,c=1:any(l)and f([j-i for i,j in zip(l,l[1:])],c-1)or-c

Is it just me or is the switch to a recursive lambda not saving enough bytes? :P Thanks!

I think this needs a max(...,0) to pass the [1, 1, 1, 1, ...] test cases.

05AB1E, 7 bytes
[DË#¥]N

Try it online!
Explanation
[         # start loop
 D        # duplicate current list
  Ë       # are all elements equal?
   #      # if so, break
    ¥     # calculate delta's
     ]    # end loop
      N   # push iteration counter

Haskell, 66 61 60 bytes
z=(=<<tail).zipWith
f=length.takeWhile(or.z(/=)).iterate(z(-))

Try it online!
Saved 5 bytes thanks to Christian Sievers
Saved 1 byte thanks to proud-haskeller
iterate(z(-)) computes the differences lists.
or.z(/=) tests if there are non equal elements in those lists.
length.takeWhile counts the differences lists with non equal elements.

I think you can test for non-equal elements with or.z(/=)

@ChristianSievers thanks! That was obvious, but I didn't see it...

You can also use z=(=<<tail).zipWith, one byte shorter

@proudhaskeller and more elegant, as always with point free definitions. Thanks!

Dyalog APL, 19 bytes
≢-1+(≢2-/⍣{1=≢∪⍵}⊢)

Explanation:
≢                      length of input
 -1+(             )    minus 1+
     ≢                 length of
      2-/              differences between elements
         ⍣             while
          {1=≢∪⍵}      there is more than 1 unique element
                 ⊢     starting with the input

Does this work? ≢-1+∘≢2-/⍣{1=≢∪⍵}⊢

k, 21 bytes
#1_(~&/1_=':)(1_-':)\

This works in k, but not in oK, because oK's while loop runs before checking the condition (as opposed to first checking the condition, and then running the code). Therefore, in oK, the 1 1 1 1 1 example will not work properly.
Try oK online!

Explanation:
   (        )       \ /while(
    ~&/               /      not(min(
       1_=':          /              check equality of all pairs))) {
             (1_-':)  /    generate difference list
                      /    append to output }
#1_                   /(length of output) - 1

~&/1_=': -> 1<#?

Japt, 7 bytes
Same approach (but independently derived) as Justin with a different implementation.
£=äaÃèx

Test it

Explanation
Implicit input of array U.
£   Ã

Map over each element.
äa

Take each sequential pair (ä) of elements in U and reduce it by absolute difference (a).
=

Reassign that array to U.
èx

Count (è) the number of sub-arrays that return truthy (i.e., non-zero) when reduced by addition.

TI-Basic, 19 bytes
While max(abs(ΔList(Ans
ΔList(Ans
IS>(A,9
End
A

By default, variables start at zero. Also, never thought I'd be using IS>( for anything useful.

Pyth, 15 bytes
W.E.+Q=.+Q=hZ)Z

Verify all the test cases.
How?
Explanation #1
W.E.+Q=hZ=.+Q)Z   ~ Full program.

W                 ~ While...
 .E.+Q            ~ ... The deltas of Q contain a truthy element.
      =hZ         ~ Increment a variable Z, which has the initial value of 0.
         =        ~ Transform the variable to the result of a function applied to itself...
          .+Q     ~ ... Operate on the current list and deltas.
             )Z   ~ Close the loop and output Z.

-1 byte Wtl{Q=hZ=.+Q)Z

@Dave Even better: WP{Q=hZ=.+Q)Z. Thanks!

C# (.NET Core), 70 69 + 18 bytes
-1 byte thanks to Kevin Cruijssen
g=a=>i=>a.Distinct().Count()>1?g(a.Zip(a.Skip(1),(y,z)=>y-z))(i+1):i;

Must be given 0 when calling to operate correctly. Also included in byte count:
using System.Linq;

Try it online!
Explanation:
g = a => i =>                      // Function taking two arguments (collection of ints and an int)
    a.Distinct()                   // Filter to unique elements
    .Count() > 1 ?                 // If there's more than one element
        g(                         //     Then recursively call the function with
            a.Zip(                 //     Take the collection and perform an action on corresponding elements with another one
                a.Skip(1),         //         Take our collection starting at second element
                (y, z) => y - z    //         Perform the subtraction
            )
        )(i + 1)                   //     With added counter
        : i;                       // Otherwise return counter

Iterative version 84 + 18 bytes:
a=>{int i=0;for(;a.Distinct().Count()>1;i++)a=a.Zip(a.Skip(1),(y,z)=>y-z);return i;}

Try it online!

You can remove the redundant space at (y,z)=>y-z. But nice answer, +1 from me.

@KevinCruijssen thank you! Also, oops.

Clojure, 62 bytes
#(loop[c % i 0](if(apply = c)i(recur(map -(rest c)c)(inc i))))

Nicely = can take any number of arguments, and a single argument is identical to "itself". (apply = [1 2 3]) gets executed as (= 1 2 3).

Nice, exactly what I was trying to do but I was struggling for a compact pairwise diffs. That's brilliant, I'll have to remember that for the future.

Vyxal, 6 bytes
⁽¯İ~aL

Try it online!
Explanation:
⁽¯      # Single element lambda that gets the differences
  İ     # Apply that and collect results until no change
   ~    # Filter by:
    a   #   Any truthy?
     L  # Get the length of those

J, 21 18 bytes
2#@(}.~.)2-/\^:a:]

Try it online!
-3 thanks to rdm!

2#@(}.~.)2-/^:a:]

Very nice again!

Perl 5, 83 + 1 (-a) = 84 bytes
sub c{$r=0;$r||=$_-$F[0]for@F;$r}for(;c;$i=0){$_-=$F[++$i]for@F;$#F--}say y/ //-$#F

Try it online!
Input as a list of numbers separated by one space.

Pyke, 11 bytes
W$D}ltoK)Ko

Try it here!

Kotlin, 83 bytes
{var z=it
var c=0
while(z.any{it!=z[0]}){c++
z=(0..z.size-2).map{z[it+1]-z[it]}}
c}

Beautified
{
    // Make input mutable
    var z=it
    // Count for returning
    var c=0
    // While the array is not identical
    while (z.any { it != z[0] }) {
        // Increment count
        c++
        // Update list to differences
        z = (0..z.size-2).map { z[it+1] - z[it] }
    }
    // Return count
    c
}

Test
var n:(List<Int>)->Int =
{var z=it
var c=0
while(z.any{it!=z[0]}){c++
z=(0..z.size-2).map{z[it+1]-z[it]}}
c}

data class TestData(var input: List<Int>, var output: Int)

fun main(args: Array<String>) {
    val items = listOf(
        TestData(listOf(1,2,3,4,5,6,7,8,9,10), 1),
        TestData(listOf(1,4,9,16,25,36), 2),
        TestData(listOf(1,2,1), 2),
        TestData(listOf(1,1,1,1,1,1,1,1,1), 0),
        TestData(listOf(1, 3, 9, 26, 66, 150, 313, 610), 6)
    )

    val fails = items.map { it to n(it.input) }.filter { it.first.output != it.second }

    if (fails.isEmpty()) {
        println("Test passed")
    } else {
        fails.forEach {println("FAILED: $it")}
    }
}

TryItOnline

If someone could edit to fix my language hints please, I can't seem to get them working

It's lang-kotlin, not simply kotlin, in the highlighter hints.

Swift 4, 90 bytes
func f(_ a:[Int])->Int{return a.contains{$0 != a[0]} ?f(zip(a, a.dropFirst()).map(-))+1:0}

Alternative, closure-based implementation:
var f: ((_ input: [Int]) -> Int)!
f = {a in a.contains{$0 != a[0]} ?f(zip(a, a.dropFirst()).map(-))+1:0}

test cases:
let testcases: [(input: [Int], expected: Int)] = [
    (input: [1,2,3,4,5,6,7,8,9,10],           expected: 1),
    (input: [1,4,9,16,25,36],                 expected: 2),
    (input: [1,2,1],                          expected: 2),
    (input: [1,1,1,1,1,1,1,1,1],              expected: 0),
    (input: [1, 3, 9, 26, 66, 150, 313, 610], expected: 6),
]

for (caseNumber, testcase) in testcases.enumerated() {
    let actual = f(testcase.input)
    assert(actual == testcase.expected,
        "Testcase #\(caseNumber) \(testcase.input) failed. Got \(actual), but expected \(testcase.expected)!")
    print("Testcase #\(caseNumber) passed!")
}

Pyth, 10 bytes
tf!t{.+FQt

If we can index from 1, we can save a byte by removing the leading t.
Try it Online
Explanation
tf!t{.+FQt
 f        T  Find the first (1-indexed) value T...
     .+FQt   ... such that taking the difference T - 1 times...
  !t{        ... gives a set with more than one value in it.
t            0-index.

Factor, 58 bytes
[ 0 swap [ tuck all-eq? ] [ 1 + swap differences ] until ]

Try it online!

Ruby, 55 bytes
F=->a,i=0{a.uniq[1]?F[a.each_cons(2).map{_2-_1},i+1]:i}

Attempt This Online!

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Sort the points by linear distance in a 3D space
Specs

You have a cubic 3D space x,y,z of size S integer units, such as 0 <= x,y,z <= S.
You get from default input methods an array of points P represented as x,y,z integer coordinates, in any reasonable format as you like, for example: [x1,y1,z1],[x2,y2,z2],[x3,y3,z3] ... [xn,yn,zn].
All the P values will be in the above said cubic 3D space, such as 0 <= x,y,z <= S.
The possible total number of P will be 1 <= P <= S3.
You also get as input the x,y,z integer coordinates of the base point B and the 3D cube size S.

Task
Your goal is to output, in your preferred format, the points P sorted by the linear (Euclidean) distance from the base point B.
Rules

If you find more than one point P that are equidistant from B you must output all of the equidistant P's in your preferred order.
It is possible that a point P will coincide with B, so that their distance is 0, you must output that point.
This is a code-golf challenge, so the shortest code wins.
Standard loopholes are forbidden.
Code explanations are appreciated.

Test cases
Input:
S (size), [B (base point x,y,z)], [P1 (x,y,z)], [P2], [P3], [P4], [P5], [...], [Pn]
10, [5,5,5], [0,0,0], [10,10,10], [2,0,8], [10,3,1], [4,4,5], [5,5,5], [5,5,4]

Output:
[5,5,5], [5,5,4], [4,4,5], [2,0,8], [10,3,1], [0,0,0], [10,10,10]

- - -

Input:
5, [2, 3, 3], [3, 0, 4], [5, 0, 3], [0, 2, 4], [0, 3, 5], [4, 2, 1], [2, 2, 2], [3, 1, 2], [3, 1, 0], [1, 3, 2], [2, 3, 1], [3, 1, 5], [4, 0, 0], [4, 3, 1], [0, 5, 5], [1, 5, 1], [3, 1, 4], [2, 2, 2], [0, 2, 5], [3, 3, 5], [3, 3, 0], [5, 4, 5], [4, 1, 3], [5, 1, 1], [3, 5, 3], [1, 5, 3], [0, 5, 2], [4, 3, 3], [2, 1, 1], [3, 3, 0], [5, 0, 4], [1, 5, 2], [4, 2, 3], [4, 2, 1], [2, 5, 5], [3, 4, 0], [3, 0, 2], [2, 3, 2], [3, 5, 1], [5, 1, 0], [2, 4, 3], [1, 0, 5], [0, 2, 5], [3, 4, 4], [2, 4, 0], [0, 1, 5], [0, 5, 4], [1, 5, 1], [2, 1, 0], [1, 3, 4], [2, 2, 2], [4, 2, 4], [5, 5, 4], [4, 4, 0], [0, 4, 1], [2, 0, 3], [3, 1, 5], [4, 4, 0], [2, 5, 1], [1, 2, 4], [4, 3, 1], [0, 2, 4], [4, 5, 2], [2, 0, 1], [0, 0, 2], [4, 1, 0], [5, 4, 3], [2, 5, 2], [5, 4, 4], [4, 4, 3], [5, 5, 1], [4, 0, 2], [1, 3, 5], [4, 2, 0], [0, 3, 1], [2, 2, 0], [0, 4, 5], [3, 2, 0], [0, 2, 1], [1, 2, 2], [2, 5, 3], [5, 5, 2], [5, 2, 4], [4, 5, 5], [2, 1, 2], [5, 4, 3], [4, 5, 4], [2, 3, 1], [4, 4, 4], [3, 0, 0], [2, 4, 5], [4, 3, 3], [3, 5, 3], [4, 0, 0], [1, 1, 1], [3, 1, 3], [2, 5, 5], [0, 0, 5], [2, 0, 2], [1, 0, 3], [3, 1, 4], [1, 2, 5], [4, 1, 3], [1, 4, 5], [3, 1, 4], [3, 5, 1], [5, 1, 4], [1, 0, 4], [2, 2, 0], [5, 2, 1], [0, 5, 3], [2, 1, 1], [0, 3, 0], [4, 5, 5], [3, 4, 2], [5, 3, 3], [3, 1, 1], [4, 0, 1], [5, 0, 5], [5, 0, 4], [1, 4, 3], [5, 4, 2], [5, 4, 0], [5, 1, 0], [0, 0, 1], [5, 3, 0]

Output:
[2, 4, 3], [2, 3, 2], [1, 3, 4], [1, 3, 2], [2, 2, 2], [1, 4, 3], [2, 2, 2], [2, 2, 2], [1, 2, 2], [3, 4, 2], [1, 2, 4], [3, 4, 4], [2, 5, 3], [4, 3, 3], [2, 3, 1], [4, 3, 3], [2, 3, 1], [1, 3, 5], [4, 4, 3], [2, 5, 2], [3, 1, 3], [1, 5, 3], [4, 2, 3], [2, 1, 2], [3, 5, 3], [2, 4, 5], [3, 3, 5], [3, 5, 3], [3, 1, 4], [0, 2, 4], [0, 2, 4], [1, 2, 5], [3, 1, 2], [3, 1, 4], [3, 1, 4], [4, 2, 4], [1, 4, 5], [4, 4, 4], [1, 5, 2], [4, 3, 1], [0, 5, 3], [2, 1, 1], [4, 1, 3], [4, 3, 1], [2, 5, 5], [0, 3, 5], [4, 1, 3], [2, 5, 1], [2, 1, 1], [0, 3, 1], [2, 5, 5], [1, 1, 1], [0, 4, 5], [4, 5, 4], [4, 5, 2], [0, 2, 1], [1, 5, 1], [5, 3, 3], [0, 5, 2], [3, 5, 1], [3, 5, 1], [0, 2, 5], [1, 5, 1], [4, 2, 1], [3, 1, 5], [3, 1, 1], [0, 2, 5], [4, 2, 1], [0, 5, 4], [0, 4, 1], [2, 0, 3], [3, 1, 5], [2, 4, 0], [2, 2, 0], [2, 0, 2], [3, 3, 0], [3, 3, 0], [5, 4, 3], [1, 0, 3], [5, 4, 3], [2, 2, 0], [3, 0, 2], [5, 4, 4], [5, 4, 2], [1, 0, 4], [3, 0, 4], [5, 2, 4], [3, 2, 0], [3, 4, 0], [0, 1, 5], [0, 5, 5], [4, 5, 5], [4, 5, 5], [0, 3, 0], [2, 0, 1], [2, 1, 0], [4, 4, 0], [5, 1, 4], [5, 5, 4], [5, 2, 1], [3, 1, 0], [5, 4, 5], [4, 4, 0], [1, 0, 5], [4, 2, 0], [0, 0, 2], [4, 0, 2], [5, 5, 2], [4, 1, 0], [5, 5, 1], [0, 0, 1], [5, 1, 1], [4, 0, 1], [0, 0, 5], [5, 0, 3], [5, 3, 0], [5, 4, 0], [3, 0, 0], [5, 0, 4], [5, 0, 4], [5, 1, 0], [4, 0, 0], [4, 0, 0], [5, 0, 5], [5, 1, 0]

- - -

Input:
10, [1, 9, 4], [4, 6, 2], [7, 5, 3], [10, 5, 2], [9, 8, 9], [10, 5, 10], [1, 5, 4], [8, 1, 1], [8, 6, 9], [10, 4, 1], [3, 4, 10], [4, 7, 0], [7, 10, 9], [5, 7, 3], [6, 7, 9], [5, 1, 4], [4, 3, 8], [4, 4, 9], [6, 9, 3], [8, 2, 6], [3, 5, 1], [0, 9, 0], [8, 4, 3], [0, 1, 1], [6, 7, 6], [4, 6, 10], [3, 9, 10], [8, 3, 1], [10, 1, 1], [9, 10, 6], [2, 3, 9], [10, 5, 0], [3, 2, 1], [10, 2, 7], [8, 4, 9], [5, 2, 4], [0, 8, 9], [10, 1, 6], [0, 8, 10], [5, 10, 1], [7, 4, 5], [4, 5, 2], [0, 2, 0], [8, 3, 3], [6, 6, 6], [3, 0, 2], [0, 1, 1], [10, 10, 8], [6, 2, 8], [8, 8, 6], [5, 4, 7], [10, 7, 4], [0, 9, 2], [1, 6, 6], [8, 5, 9], [3, 7, 4], [5, 6, 6], [3, 1, 1], [10, 4, 5], [1, 5, 7], [8, 6, 6], [4, 3, 7], [2, 1, 0], [6, 4, 2], [0, 7, 8], [8, 3, 6], [9, 2, 0], [1, 3, 8], [4, 4, 6], [5, 8, 9], [9, 4, 4], [0, 7, 3], [8, 3, 4], [6, 7, 9], [8, 7, 0], [0, 7, 7], [8, 10, 10], [10, 2, 5], [6, 9, 5], [6, 2, 7], [0, 9, 6], [1, 4, 1], [4, 3, 1], [5, 7, 3], [9, 6, 8], [4, 1, 7], [4, 0, 8], [3, 4, 7], [2, 3, 6], [0, 0, 7], [5, 3, 6], [7, 3, 4], [6, 7, 8], [3, 7, 9], [1, 9, 10], [2, 1, 2], [2, 8, 2], [0, 3, 0], [1, 1, 9], [3, 5, 2], [10, 5, 3], [5, 2, 9], [6, 9, 0], [9, 5, 0], [7, 1, 10], [3, 3, 8], [2, 5, 1], [3, 10, 10], [6, 2, 2], [10, 7, 2], [4, 3, 1], [4, 2, 1], [4, 2, 8], [6, 8, 5], [3, 10, 0], [1, 1, 7], [6, 9, 6], [6, 2, 4], [5, 5, 7], [5, 4, 5], [9, 8, 1], [9, 8, 1], [0, 10, 6], [1, 1, 9], [3, 8, 8], [3, 1, 5], [5, 7, 4], [4, 3, 6], [5, 4, 7], [6, 0, 8], [7, 8, 1], [9, 8, 4], [2, 10, 0], [3, 4, 5], [9, 3, 10], [7, 4, 1], [2, 1, 9], [10, 8, 1], [10, 3, 7], [2, 0, 6], [3, 8, 4], [10, 0, 2], [9, 9, 10], [8, 9, 5], [4, 10, 2], [8, 3, 4], [4, 2, 10], [9, 1, 6], [6, 1, 3], [4, 1, 3], [2, 9, 0], [5, 6, 5], [8, 8, 3], [5, 5, 0], [7, 6, 9], [1, 1, 5], [3, 0, 4], [1, 10, 6], [8, 0, 2], [0, 7, 3], [8, 9, 8], [2, 1, 8], [3, 1, 10], [4, 5, 9], [7, 6, 10], [3, 6, 10], [5, 9, 8], [9, 3, 3], [2, 2, 3], [9, 9, 0], [7, 2, 2], [0, 0, 9], [8, 7, 4], [9, 2, 9], [0, 6, 4], [9, 4, 3], [10, 1, 3], [5, 9, 10], [5, 10, 6], [6, 3, 10],

Output:
[1, 10, 6], [3, 8, 4], [0, 9, 6], [0, 9, 2], [2, 8, 2], [0, 7, 3], [0, 7, 3], [0, 10, 6], [3, 7, 4], [0, 6, 4], [1, 6, 6], [0, 7, 7], [4, 10, 2], [1, 5, 4], [0, 9, 0], [2, 9, 0], [2, 10, 0], [5, 7, 4], [5, 7, 3], [5, 10, 6], [5, 7, 3], [0, 7, 8], [3, 10, 0], [3, 8, 8], [4, 6, 2], [3, 5, 2], [1, 5, 7], [5, 10, 1], [6, 9, 3], [6, 9, 5], [5, 6, 5], [2, 5, 1], [0, 8, 9], [6, 8, 5], [5, 6, 6], [6, 9, 6], [4, 5, 2], [4, 7, 0], [3, 5, 1], [3, 4, 5], [5, 9, 8], [6, 7, 6], [3, 7, 9], [1, 4, 1], [1, 9, 10], [4, 4, 6], [0, 8, 10], [6, 6, 6], [3, 4, 7], [3, 9, 10], [5, 5, 7], [3, 10, 10], [2, 3, 6], [6, 9, 0], [5, 8, 9], [5, 4, 5], [6, 7, 8], [7, 8, 1], [5, 5, 0], [4, 3, 6], [3, 6, 10], [8, 9, 5], [5, 4, 7], [4, 5, 9], [5, 4, 7], [2, 2, 3], [8, 8, 3], [1, 3, 8], [5, 9, 10], [0, 3, 0], [7, 5, 3], [8, 7, 4], [4, 3, 1], [8, 8, 6], [6, 4, 2], [4, 3, 7], [6, 7, 9], [4, 6, 10], [4, 3, 1], [6, 7, 9], [3, 3, 8], [5, 3, 6], [4, 4, 9], [4, 3, 8], [8, 6, 6], [3, 2, 1], [7, 4, 5], [7, 10, 9], [2, 3, 9], [5, 2, 4], [1, 1, 5], [3, 4, 10], [8, 9, 8], [9, 8, 4], [0, 2, 0], [4, 2, 1], [3, 1, 5], [2, 1, 2], [8, 7, 0], [9, 10, 6], [7, 4, 1], [7, 6, 9], [7, 3, 4], [1, 1, 7], [0, 1, 1], [4, 2, 8], [9, 8, 1], [0, 1, 1], [4, 1, 3], [6, 2, 4], [9, 8, 1], [8, 4, 3], [3, 1, 1], [6, 2, 2], [5, 1, 4], [9, 9, 0], [7, 6, 10], [2, 1, 0], [2, 1, 8], [4, 1, 7], [8, 6, 9], [6, 2, 7], [8, 3, 4], [8, 3, 4], [10, 7, 4], [3, 0, 4], [8, 3, 3], [8, 10, 10], [2, 0, 6], [9, 6, 8], [10, 7, 2], [1, 1, 9], [8, 3, 6], [1, 1, 9], [7, 2, 2], [3, 0, 2], [9, 4, 4], [8, 5, 9], [2, 1, 9], [6, 1, 3], [6, 2, 8], [5, 2, 9], [9, 4, 3], [9, 8, 9], [0, 0, 7], [10, 8, 1], [4, 2, 10], [8, 3, 1], [9, 5, 0], [6, 3, 10], [10, 10, 8], [10, 5, 3], [8, 4, 9], [9, 9, 10], [10, 5, 2], [9, 3, 3], [8, 2, 6], [3, 1, 10], [4, 0, 8], [0, 0, 9], [10, 4, 5], [10, 5, 0], [10, 4, 1], [8, 1, 1], [6, 0, 8], [10, 3, 7], [9, 2, 0], [10, 2, 5], [9, 1, 6], [10, 5, 10], [8, 0, 2], [9, 3, 10], [7, 1, 10], [9, 2, 9], [10, 2, 7], [10, 1, 3], [10, 1, 6], [10, 1, 1], [10, 0, 2]

- - -

Input:
10000, [8452, 3160, 6109], [7172, 5052, 4795], [9789, 4033, 2952], [8242, 213, 3835], [177, 7083, 908], [3788, 3129, 3018], [9060, 464, 2701], [6537, 8698, 291], [9048, 3860, 6099], [4600, 2696, 4854], [2319, 3278, 9825]

Output:
[9048, 3860, 6099], [7172, 5052, 4795], [9789, 4033, 2952], [8242, 213, 3835], [4600, 2696, 4854], [9060, 464, 2701], [3788, 3129, 3018], [2319, 3278, 9825], [6537, 8698, 291], [177, 7083, 908]

Is it really necessary to take S as a parameter?

@GolfWolf if you don't need it, don't take it.

I'd strongly recommend specifying which kind of metric you want us to be using. Some people use Euclidean metric (ρ = √[(x₁-x₂)²+(y₁-y₂)²+(z₁-z₂)²]), others use Manhattan metric (ρ = |x₁-x₂| + |y₁-y₂| + |z₁-z₂|). In my opinion everyone should be using the same metric.

@Ramillies: The challenge specifies linear distance which in my mind is Euclidean. I wouldn't call Manhattan linear, but I agree that specifying specifically which metric to use should make it harder to misunderstand the challenge.

@Emigna: I understood it as Euclidean too. Some people just used Manhattan, but that was probably only accidentally (since all of these posts seem to use Euclidean now).

Don't say linear, say Euclidean.

05AB1E, 4 bytes
ΣαnO

Try it online!
Explanation
Σ        # sort by
   O     # sum of
  n      # square of
 α       # absolute difference between current value and second input

Why do you need n?

@EriktheOutgolfer: Maybe this small example can show the difference between squaring and not.

So, is everybody doing it wrong or everybody doing it right?

@EriktheOutgolfer: I haven't checked all answers, but most seem to be correct.

Many answers don't square, that's why I asked, since they are using exactly the same algorithm.

@EriktheOutgolfer: Most answers seem to either square or have a built-in for euclidean distance.

Let us continue this discussion in chat.

This answer is 6 bytes long, not 4. The sigma and alpha codepoints are both 2 bytes long.

@Willem: 05AB1E uses the 05AB1E code page where each of these codepoints are 1 byte.

@Emigna I got this too, but I was almost 100% sure it wasn't correct. Low-and-behold I scroll down to see the king with that answer too <3.

@Emigna fair enough I suppose, I don't like that it's UTF-8 as-posted.

JavaScript (ES6), 71 bytes
(b,a,g=a=>a.reduce((d,c,i)=>d+(c-=b[i])*c,0))=>a.sort((b,a)=>g(b)-g(a))

I think you can save a byte by using currying and moving definition of g inside sort.

@ThePirateBay: Neil doesn't do currying!

Haskell, 54 52 bytes
import Data.List
f o=sortOn(sum.map(^2).zipWith(-)o)

Try it online!
I don't need the size of the space. sum.map(^2).zipWith(-)o computes the distance from a point to o : (xo-xp)^2+(yo-yp)^2+(zo-zp)^2. The points are simply sorted on the distance to o.
EDIT: "if you don't need it, don't take it" saved 2 bytes.

Python 3, 68 64 bytes
-4 bytes thanks to @Ramillies
def f(b,l):l.sort(key=lambda p:sum((a-b)**2for a,b in zip(b,p)))

Try it online!

R, 56 40 bytes
-16 bytes thanks to flodel for suggesting a different input format
function(P,B)P[,order(colSums((P-B)^2))]

Try it online!
Takes P as a 3xn matrix of points, i.e., each column is a point; output is in the same format.
Use the helper function g to transform the list of points P from the test cases into the appropriate R format.

Maybe replace the sapply() with colSums((t(P)-B)^2), where the input P would be a matrix?

@flodel if I'm going to do that, I may as well take P as a 3xn matrix and just do colSums((P-B)^2) instead!

Mathematica, 24 bytes
xN@Norm[#-x]&//SortBy

Takes input in the format f[B][P].
We have to use 4 bytes on x to make the nested function. The precedence of  (\[Function]) and // works out nicely so that the expression is equivalent to this:
Function[x, SortBy[N@Norm[# - x]&] ]

We need N because by default, Mathematica sorts by expression structure instead of by value:
Sort[{1, Sqrt@2, 2}]
{1, 2, Sqrt[2]}

SortBy[N][{1, Sqrt@2, 2}]
{1, Sqrt[2], 2}

Japt, 10 9 bytes
-1 byte thanks to @Shaggy
ñ_íaV m²x

Takes points as an array of three-item arrays and the base point an a single array, in that order. Does not take the size argument.
Try it online! or run the huge test case with -R to output one x,y,z per line.
Explanation
ñ_            Sort the input array as if each item were mapped through the function...
  í V         Pair the x,y,z in the current item with those in the base point, V
   a          Take the absolute different from each pair
      m²      Square each of the 3 differences
        x     Sum those squares
              Sorted array is implicitly returned

Nice :) I was down to 11 bytes before work got in the way!

Looks like this should work for 9 bytes, but it needs some more testing. EDIT: Both versions fail on the 2nd & 3rd test cases.

@Shaggy I never realized í could take it's arguments in reverse, that's pretty nice. I too think it should work; I'll run some of the other test cases and edit when I'm back to a computer.

Note: - or n would also work in place of a.

C# (.NET Core), 68 57 53 + 23 18 bytes
-11 bytes thanks to Emigna
B=>P=>P.OrderBy(p=>p.Zip(B,(x,y)=>(x-y)*(x-y)).Sum())

Byte count also includes
using System.Linq;

Try it online!
Points are treated as collections of ints. Explanation:
B => P =>                          // Take the base point and a collection of points to sort
    P.OrderBy(p =>                 // Order the points by:
        p.Zip(B, (x, y) =>         //     Take each point and combine it with the base:
            (x - y) * (x - y)      //         Take each dimension and measure their distance squared
        ).Sum()                    //     Sum of the distances in each dimension together
    )

JavaScript (ES6), 72 71 bytes
This one is not shorter than Neil's answer, but I thought I would post it anyway to demonstrate the use of Math.hypot(), which was introduced in ES6.
Takes input in currying syntax (p)(a), where p = [ x,y,z ] is the base point and a is the array of other points.
p=>a=>a.sort((a,b)=>(g=a=>Math.hypot(...a.map((v,i)=>v-p[i])))(a)-g(b))

let f =

p=>a=>a.sort((a,b)=>(g=a=>Math.hypot(...a.map((v,i)=>v-p[i])))(a)-g(b))

console.log(JSON.stringify(f([5, 5, 5])([[0, 0, 0], [10, 10, 10], [2, 0, 8], [10, 3, 1], [4, 4, 5], [5, 5, 5], [5, 5, 4]])))

console.log(JSON.stringify(f([2, 3, 3])([[3, 0, 4], [5, 0, 3], [0, 2, 4], [0, 3, 5], [4, 2, 1], [2, 2, 2], [3, 1, 2], [3, 1, 0], [1, 3, 2], [2, 3, 1], [3, 1, 5], [4, 0, 0], [4, 3, 1], [0, 5, 5], [1, 5, 1], [3, 1, 4], [2, 2, 2], [0, 2, 5], [3, 3, 5], [3, 3, 0], [5, 4, 5], [4, 1, 3], [5, 1, 1], [3, 5, 3], [1, 5, 3], [0, 5, 2], [4, 3, 3], [2, 1, 1], [3, 3, 0], [5, 0, 4], [1, 5, 2], [4, 2, 3], [4, 2, 1], [2, 5, 5], [3, 4, 0], [3, 0, 2], [2, 3, 2], [3, 5, 1], [5, 1, 0], [2, 4, 3], [1, 0, 5], [0, 2, 5], [3, 4, 4], [2, 4, 0], [0, 1, 5], [0, 5, 4], [1, 5, 1], [2, 1, 0], [1, 3, 4], [2, 2, 2], [4, 2, 4], [5, 5, 4], [4, 4, 0], [0, 4, 1], [2, 0, 3], [3, 1, 5], [4, 4, 0], [2, 5, 1], [1, 2, 4], [4, 3, 1], [0, 2, 4], [4, 5, 2], [2, 0, 1], [0, 0, 2], [4, 1, 0], [5, 4, 3], [2, 5, 2], [5, 4, 4], [4, 4, 3], [5, 5, 1], [4, 0, 2], [1, 3, 5], [4, 2, 0], [0, 3, 1], [2, 2, 0], [0, 4, 5], [3, 2, 0], [0, 2, 1], [1, 2, 2], [2, 5, 3], [5, 5, 2], [5, 2, 4], [4, 5, 5], [2, 1, 2], [5, 4, 3], [4, 5, 4], [2, 3, 1], [4, 4, 4], [3, 0, 0], [2, 4, 5], [4, 3, 3], [3, 5, 3], [4, 0, 0], [1, 1, 1], [3, 1, 3], [2, 5, 5], [0, 0, 5], [2, 0, 2], [1, 0, 3], [3, 1, 4], [1, 2, 5], [4, 1, 3], [1, 4, 5], [3, 1, 4], [3, 5, 1], [5, 1, 4], [1, 0, 4], [2, 2, 0], [5, 2, 1], [0, 5, 3], [2, 1, 1], [0, 3, 0], [4, 5, 5], [3, 4, 2], [5, 3, 3], [3, 1, 1], [4, 0, 1], [5, 0, 5], [5, 0, 4], [1, 4, 3], [5, 4, 2], [5, 4, 0], [5, 1, 0], [0, 0, 1], [5, 3, 0]])))

console.log(JSON.stringify(f([1, 9, 4])([[4, 6, 2], [7, 5, 3], [10, 5, 2], [9, 8, 9], [10, 5, 10], [1, 5, 4], [8, 1, 1], [8, 6, 9], [10, 4, 1], [3, 4, 10], [4, 7, 0], [7, 10, 9], [5, 7, 3], [6, 7, 9], [5, 1, 4], [4, 3, 8], [4, 4, 9], [6, 9, 3], [8, 2, 6], [3, 5, 1], [0, 9, 0], [8, 4, 3], [0, 1, 1], [6, 7, 6], [4, 6, 10], [3, 9, 10], [8, 3, 1], [10, 1, 1], [9, 10, 6], [2, 3, 9], [10, 5, 0], [3, 2, 1], [10, 2, 7], [8, 4, 9], [5, 2, 4], [0, 8, 9], [10, 1, 6], [0, 8, 10], [5, 10, 1], [7, 4, 5], [4, 5, 2], [0, 2, 0], [8, 3, 3], [6, 6, 6], [3, 0, 2], [0, 1, 1], [10, 10, 8], [6, 2, 8], [8, 8, 6], [5, 4, 7], [10, 7, 4], [0, 9, 2], [1, 6, 6], [8, 5, 9], [3, 7, 4], [5, 6, 6], [3, 1, 1], [10, 4, 5], [1, 5, 7], [8, 6, 6], [4, 3, 7], [2, 1, 0], [6, 4, 2], [0, 7, 8], [8, 3, 6], [9, 2, 0], [1, 3, 8], [4, 4, 6], [5, 8, 9], [9, 4, 4], [0, 7, 3], [8, 3, 4], [6, 7, 9], [8, 7, 0], [0, 7, 7], [8, 10, 10], [10, 2, 5], [6, 9, 5], [6, 2, 7], [0, 9, 6], [1, 4, 1], [4, 3, 1], [5, 7, 3], [9, 6, 8], [4, 1, 7], [4, 0, 8], [3, 4, 7], [2, 3, 6], [0, 0, 7], [5, 3, 6], [7, 3, 4], [6, 7, 8], [3, 7, 9], [1, 9, 10], [2, 1, 2], [2, 8, 2], [0, 3, 0], [1, 1, 9], [3, 5, 2], [10, 5, 3], [5, 2, 9], [6, 9, 0], [9, 5, 0], [7, 1, 10], [3, 3, 8], [2, 5, 1], [3, 10, 10], [6, 2, 2], [10, 7, 2], [4, 3, 1], [4, 2, 1], [4, 2, 8], [6, 8, 5], [3, 10, 0], [1, 1, 7], [6, 9, 6], [6, 2, 4], [5, 5, 7], [5, 4, 5], [9, 8, 1], [9, 8, 1], [0, 10, 6], [1, 1, 9], [3, 8, 8], [3, 1, 5], [5, 7, 4], [4, 3, 6], [5, 4, 7], [6, 0, 8], [7, 8, 1], [9, 8, 4], [2, 10, 0], [3, 4, 5], [9, 3, 10], [7, 4, 1], [2, 1, 9], [10, 8, 1], [10, 3, 7], [2, 0, 6], [3, 8, 4], [10, 0, 2], [9, 9, 10], [8, 9, 5], [4, 10, 2], [8, 3, 4], [4, 2, 10], [9, 1, 6], [6, 1, 3], [4, 1, 3], [2, 9, 0], [5, 6, 5], [8, 8, 3], [5, 5, 0], [7, 6, 9], [1, 1, 5], [3, 0, 4], [1, 10, 6], [8, 0, 2], [0, 7, 3], [8, 9, 8], [2, 1, 8], [3, 1, 10], [4, 5, 9], [7, 6, 10], [3, 6, 10], [5, 9, 8], [9, 3, 3], [2, 2, 3], [9, 9, 0], [7, 2, 2], [0, 0, 9], [8, 7, 4], [9, 2, 9], [0, 6, 4], [9, 4, 3], [10, 1, 3], [5, 9, 10], [5, 10, 6], [6, 3, 10]])))

console.log(JSON.stringify(f([8452, 3160, 6109])([[7172, 5052, 4795], [9789, 4033, 2952], [8242, 213, 3835], [177, 7083, 908], [3788, 3129, 3018], [9060, 464, 2701], [6537, 8698, 291], [9048, 3860, 6099], [4600, 2696, 4854], [2319, 3278, 9825]])))

k, 14 bytes
{y@<+/x*x-:+y}

Try it online!
{            } /function(x,y)
           +y  /transpose y
        x-:    /w[j,i] = x[j] - y[j,i]
      x*       /w[j,i]*w[j,i]
    +/         /v[i] = sum over all j: w[j,i]
   <           /indices to sort by
 y@            /rearrange list of points by indices

Also, this works for n dimensions, and is not limited to 3.

Java 8, 194 + 31 214 169 163 123 112 106 + 19 109 103 bytes
B->P->P.sort(java.util.Comparator.comparing(p->{int d=0,i=0;while(i<3)d+=(d=p[i]-B[i++])*d;return d;}))

Try it online!

Wrong results : base=[2,3,3], points=[4,3,3],[1,3,4]. Your result is [4,3,3], [1,3,4], while the correct result is [1,3,4],[4,3,3].

@OlivierGrégoire Oops, fixed

Fix + golf: b->l->{l.sort(java.util.Comparator.comparing(p->{int d=0,i=3;for(;i-->0;)d+=(b[i]-p[i])*(b[i]-p[i]);return d;}));} (114 bytes), assuming a List<int[]> as parameter instead of int[][].

Oh, pow does work in += without cast, not in most other cases. Nice to know!

103 bytes: B->P->P.sort(java.util.Comparator.comparing(p->{int d=0,i=0;while(i<3)d+=(d=p[i]-B[i++])*d;return d;}))

@Nevay Clever, thanks

MATL, 7 bytes
yZP&SY)

Inputs are: 3-column matrix with points as rows, and 3-column vector with base point.
Try it at MATL Online!
Explanation
y   % Implicitly take two inputs: 3-column matrix and 3-row vector. Duplicate the first
    % STACK: input 1 (matrix), input 2 (vector), input 1 (matrix)
ZP  % Euclidean distance between rows of top two elements in stack
    % STACK: input 1 (matrix), distances (vector)
&S  % Sort and push the indices of the sorting (not the sorted values)
    % STACK: input 1 (matrix), indices (vector)
Y)  % Use as row indices. Implicitly display
    % STACK: final result (matrix)

Perl 6, 35 bytes (33 characters)
{@^b;@^p.sort:{[+] ($_ Z- @b)»²}}

Try it online!
Explanation: This takes a list with the coordinates of the base point (called @b), then a list of lists with coordinates of the other points (called @p). In a block, you can use them on the fly using the ^ symbol. Each of the ^'d variables corresponds to one argument. (They're sorted alphabetically, so @^b is the 1st argument and @^p the 2nd.) After one use of this symbol, you can use the variable normally.
The statement @^b is there just to say that the block will take the base point argument, which is used only inside the sorting block. (Otherwise it would refer to the argument of the sorting block.) The method .sort may take one argument. If it's a block taking 1 argument (like here), the array is sorted according to the values of that function. The block itself just takes each point in turn and zips it with minus (Z-) with the base point coordinates. Then we square all the elements in the list with »² and sum them using [+].
As an added bonus, this will work with float coordinates as well, and in any dimension (as long as you, obviously, supply the same number of coordinates for all the points, it does the right thing).

This is no longer valid. I leave it here just for fun.
Perl 6, 24 bytes — only a joke!
{@^b;@^p.sort:{$_!~~@b}}

Try it online!
Since the OP doesn't state which metric shall be used, this submission chooses to use the discrete metric. In this metric, the distance between two points is 0 if they are identical, and 1 if they are not. It's easy to check that this is indeed a metric (if ρ(A,B) is distance from A to B, we require that 1) ρ(A,B) = 0 iff A = B, 2) ρ(A,B) = ρ(B,A), 3) ρ(A,B) + ρ(B,C) ≥ ρ(A,C) ("triangle inequality")).
It could be probably golfed a lot more, but I don't mean it seriously.

Doesn't work for <5 5 5>,(<5 5 10>,<6 5 5>). Lists don't sort by their sum, but by element-wise comparison. You need a sum somewhere.

@nwellnhof, many thanks. I don't know what I was thinking... Will fix shortly.

Jelly, 5 bytes
Saved 1 byte, thanks to Leaky Nun.
ạ²SðÞ

Try it online!
Explanation

ạ²SðÞ

    Þ - Sort by key function.
ạ     - Absolute difference with the elements in the second input list.
 ²    - Square. Vectorizes.
  S   - Sum.
   ð  - Starts a separate dyadic chain.
      - Output implicitly.

Save a byte with ạS¥Þ (didn't notice your answer before posting mine).

Hmm...I think you will have to go back to 5 bytes since I found that you need to square: ạ²SµÞ

@EriktheOutgolfer I think I fixed it now. Not sure though

You need to square before summing (vectorize), not after.

@EriktheOutgolfer Should be ok now

Kotlin 1.1, 58 bytes
{t,i->i.sortedBy{it.zip(t).map{(f,s)->(f-s)*(f-s)}.sum()}}

Beautified
// t is the target, i is the list of inputs
{ t, i ->
    // Sort the inputs by the distance
    i.sortedBy {
        // For each dimension
        it.zip(t)
            // Calculate the square of the distance
            .map { (f, s) -> (f - s) * (f - s) }
            // Add up the squares
            .sum()
    }
}

Test
var f: (List<Int>, List<List<Int>>) -> List<List<Int>> =
{t,i->i.sortedBy{it.zip(t).map{(f,s)->(f-s)*(f-s)}.sum()}}

data class TestData(val target: List<Int>, val input: List<List<Int>>, val output: List<List<Int>>)

fun main(args: Array<String>) {
    val items = listOf(
            TestData(listOf(5, 5, 5),
                    listOf(listOf(0, 0, 0), listOf(10, 10, 10), listOf(2, 0, 8), listOf(10, 3, 1), listOf(4, 4, 5), listOf(5, 5, 5), listOf(5, 5, 4)),
                    listOf(listOf(5, 5, 5), listOf(5, 5, 4), listOf(4, 4, 5), listOf(2, 0, 8), listOf(10, 3, 1), listOf(0, 0, 0), listOf(10, 10, 10))
            ),
            TestData(listOf(8452, 3160, 6109),
                    listOf(listOf(7172, 5052, 4795), listOf(9789, 4033, 2952), listOf(8242, 213, 3835), listOf(177, 7083, 908), listOf(3788, 3129, 3018), listOf(9060, 464, 2701), listOf(6537, 8698, 291), listOf(9048, 3860, 6099), listOf(4600, 2696, 4854), listOf(2319, 3278, 9825)),
                    listOf(listOf(9048, 3860, 6099), listOf(7172, 5052, 4795), listOf(9789, 4033, 2952), listOf(8242, 213, 3835), listOf(4600, 2696, 4854), listOf(9060, 464, 2701), listOf(3788, 3129, 3018), listOf(2319, 3278, 9825), listOf(6537, 8698, 291), listOf(177, 7083, 908))
            ))
    items.map { it to f(it.target, it.input) }.filter { it.first.output != it.second }.forEach {
        System.err.println(it.first.output)
        System.err.println(it.second)
        throw AssertionError(it.first)
    }
    println("Test Passed")
}

Pyth, 6 bytes
o.a,vz

Try it online: Demonstration
Explanation:
o.a,vzNQ   implicit variables at the end
o      Q   order the points from the first input line by:
 .a           the euclidean distance between
      N       the point
   ,          and
    vz        the point from the second input line

Herokuapp says: Bad Request: Request Line is too large (7005 > 4094). You should  make your test suite smaller in order to fit the maximum link size.

@Mr.Xcoder Thanks. I fixed it.

Perl 5, 90 bytes
sub v{$i=$t=0;$t+=($_-$p[$i++])**2for pop=~/\d+/g;$t}@p=<>=~/\d+/g;say sort{v($a)<=>v$b}<>

Try it online!
Input is newline separated list of points, with the first one being the base point and the last having a trailing newline.  Brackets ([]) around the coordinates are optional.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Generating Word Grids
Given input n, produce a word grid of size n, in as few bytes as possible.
Details
The number provided will always be odd. The centre square of the grid must always be empty (a space character). The letters that fill the grid must be chosen at random from the English Scrabble letter distribution of letters. That is, each tile must be chosen at random, with uniform probability, from the following 100 characters:
??EEEEEEEEEEEEAAAAAAAAAIIIIIIIIIOOOOOOOONNNNNNRRRRRRTTTTTTLLLLSSSSUUUUDDDDGGGBBCCMMPPFFHHVVWWYYKJXQZ

where ? denotes blank tiles.
As with a Scrabble board, some tiles in this board will also be bonus tiles for a higher score. These tiles are only visible on a board with a size of 9 or more. and should be visible every 3 rows from the centre square in a pattern emanating outwards, but should never appear on the outermost letters. Bonus squares are denoted using lowercase letters, with blank tiles identified as ! instead of ?. Please see this visual demonstration or the reference implementation for more examples on how to correctly distribute bonus tiles.
Examples
Input: 5
Output:
VNZNT
IFOSN
UD VD
ZIOO?
KTLED

Input: 9
Output:
UWDESTKPW
ItDBaDEdI
TERMDYSTR
ROANJLEFT
EkCI OOsT
IPAJPGM?Y
MZLORETVI
G!EGgPUeI
MNROYOEER

Reference implementation.
Rules
This is code-golf so the shortest code in bytes wins.

Any reasonable format can be used for I/O, assuming it is consistent.
You should be able to handle grids at least up to 999.
All standard loopholes are forbidden.

I actually contemplated adding a scrabble letter-set yield to Jelly a while back :p

Should these not be called letter grids, if we're just being placing tiles randomly without actually having to form any words?

@Shaggy So, I originally wanted to make the challenge about solving these as per this sandbox post, but when making scripts to generate these and validate the co-ordinates, I thought they'd make fun challenges on their own, I didn't update the name of the challenge as I worked it back though... Perhaps you're right!

Jelly,  67 65 64 66 64  63 bytes
”?;ØAx“³Ċu~Ṿr¥rṇ⁽ȦƑ’ḃ12¤µŒl⁾?!yW,WKF€
H3ṬṚ¤ṁ‘1¦ṚŒḄ0,0j«þ`ị¢X€€Y

A monadic link taking a number and returning a list of characters, or a full program printing the result.
Try it online! (I prefer it using G rather than Y since that's more square)
How?
”?;ØAx“³Ċu~Ṿr¥rṇ⁽ȦƑ’ḃ12¤µŒl⁾?!yW,WKF€ - Link 1, getLetterSets: no arguments
”?                                    - literal '?'
   ØA                                 - yield uppercase alphabet
  ;                                   - concatenate
                       ¤              - nilad followed by link(s) as a nilad:
      “³Ċu~Ṿr¥rṇ⁽ȦƑ’                  -   base 250 number
                    ḃ12               -   converted to bijective base 12 (frequencies)
     x                                -   times (repeat each)
                        µ             - start a new monadic chain, call that uppers
                         Œl           - to lower-case
                           ⁾?!        - literal ['?','!']
                              y       - translate (change '?'s to '!'s)
                               W      - wrap (that) in a list
                                 W    - wrap (uppers) in a list
                                ,     - pair
                                  K   - join with a space, ' '
                                   F€ - flatten €ach (both flattens the wrapped lists
                                      -               AND makes the lone ' ' into [' '])

H3ṬṚ¤ṁ‘1¦ṚŒḄ0,0j«þ`ị¢X€€Y - Main link: number, n                 e.g. 13
H                         - halve                                     6.5
    ¤                     - nilad followed by link(s) as a nilad:
 3                        -   literal three                           3
  Ṭ                       -   untruth                                 [0,0,1]
   Ṛ                      -   reverse                                 [1,0,0]
     ṁ                    - mould like (implicit range(int(right)))   [1,0,0,1,0,0]
        ¦                 - sparse application:
       1                  - ...to indices: 1
      ‘                   - ...action: increment                      [2,0,0,1,0,0]
         Ṛ                - reverse                                   [0,0,1,0,0,2]
          ŒḄ              - bounce                          [0,0,1,0,0,2,0,0,1,0,0]
            0,0           - literal [0,0]                             [0,0]
               j          - join                          [0,0,0,1,0,0,2,0,0,1,0,0,0]
                  `       - repeat left argument as right argument with:
                 þ        -   outer product using:       [[0,0,0,0,0,0,0,0,0,0,0,0,0],
                «         -     minimum                   [0,0,0,0,0,0,0,0,0,0,0,0,0],
                          -                               [0,0,0,0,0,0,0,0,0,0,0,0,0],
                          -                               [0,0,0,1,0,0,1,0,0,1,0,0,0],
                          -                               [0,0,0,0,0,0,0,0,0,0,0,0,0],
                          -                               [0,0,0,0,0,0,0,0,0,0,0,0,0],
                          -                               [0,0,0,1,0,0,2,0,0,1,0,0,0],
                          -                               [0,0,0,0,0,0,0,0,0,0,0,0,0],
                          -                               [0,0,0,0,0,0,0,0,0,0,0,0,0],
                          -                               [0,0,0,1,0,0,1,0,0,1,0,0,0],
                          -                               [0,0,0,0,0,0,0,0,0,0,0,0,0],
                          -                               [0,0,0,0,0,0,0,0,0,0,0,0,0],
                          -                               [0,0,0,0,0,0,0,0,0,0,0,0,0]]
                    ¢     - call the last link (1) as a nilad (the letter sets)
                   ị      - index into - gets the correct letter sets for each cell
                     X€€  - random-choice for €ach cell in €ach row
                        Y - join with newlines
                          - if running as a full program: implicit print

I don't think this replaces ? with ! when they are in the bonus tile position, I ran a few sets (easier to spot in the 9s!) Sorry...

@DomHastings ⁾?!y means exactly that, but it seems to fail.

@DomHastings you are correct there is a bug (since the list of uppercase-letters is wrapped in a list at the point I attempt to perform the translation it never sees the ?s) I will fix it up right now...

R, 288 281 267 257 225 214 bytes
thanks to @cole for -1 byte, reordering the ? to collapse the 2 into rep(2,10)
-10 bytes realizing that row(m) == t(col(m))
-41 bytes thanks to user2390246 for reconfiguring the weights, golfing down the indexing, and some more usual R tips
function(n){m=matrix(sample(el(strsplit("EOAINRTLSUDGBCMPFHVW?YKJXQZ","")),n^2,T,rep(c(12,8,9,6,4:1),c(1,1:4,1,10,5))),,n)
K=n/2+.5
L=col(m)
m[i]=chartr("A-Z?","a-z!",m[i<-(x=!(L-K)%%3&L-1&L-n)&t(x)])
m[K,K]=" "
m}

Try it online!
Returns a matrix. Fairly simple implementation; samples n^2 values with the proper distribution, stores as an nxn matrix.
K is the index of the center.
L=col(m) is a matrix indicating the column number of each element in the matrix. Hence we compute !(L-K)%%3 to get the possible columns (including the edges), i.e., those a multiple of 3 away from the center column. To remove the edges, we consider L-1 and L-n. L-1 is 0 (false) for the first column and L-n is 0 for the last column. Applying & (element-wise boolean AND) to these three yields a matrix with TRUE in those columns a multiple of three away from the center, excluding the edges. We store this result as x.
If we take the transpose of x, t(x), we get the same matrix, but for the rows, hence x&t(x) is a matrix we save as i containing: TRUE indices for the required cells, and FALSE everywhere else.
Then we use chartr to perform the required transformation on m[i] and save the result as m[i], change the center cell to a space, and return the matrix.
Importantly as user2390246 pointed out, we don't need to test n>=9 because for n<7, there aren't any cells a multiple of 3 away from the center (apart from the center which is changed to a space anyway), and for n==7, the only cells a multiple of 3 from the center are on the edge so they are excluded. Neat!

Could you move the ? to the part of the string corresponding to rep(2,9) and just increase that to rep(2,10)?

@cole yes, that would be I think -1 byte?

Looks like it, since you remove 2 without 2, and gain 1 for 10.

For the letter distribution: rep(c(12,8,9,6,4:1),c(1,1:4,1,10,5)) saves 10 bytes. (You'll need to switch the order of the letters to EOAI...)

@user2390246 wow, thanks!

You can also cut down the indexing for i by only taking the transform once: !(x=((L-K)%%3|L%in%c(1,n))|t(x))

@user2390246 I had just started getting there but I used !((x=(L-K)%%3)|t(x))&(y=L-1&L-n)&t(y), so combining the two approaches gets us to i<-(x=!(L-K)%%3&L-1&L-n)&t(x) which is like 20 bytes shorter!

I think that, with n < 9, this indexing is still valid (returns all FALSE), so you can get rid of the if statement. Also, there's the classic el(x) to replace x[[1]].

@user2390246 oh yeah...thanks for all the help :)

JavaScript (ES6), 247 242 bytes
-5 bytes with help from @Shaggy
n=>[...Array(p=n*n)].map((_,i)=>i==p>>1?" ":g(i/n|0)&g(i%n,c="AI9O8NRTEE6LSUD4G3BCMPFHVWY?2KJXQZ".replace(/(\D+)(\d)/g,(_,c,i)=>c.repeat(i))[Math.random()*100|0])?c<"A"?"!":c.toLowerCase():++i%n?c:c+`
`,g=x=>x&&x<n-1&((n>>1)-x)%n%3==0).join``

Test Snippet

let f=
n=>[...Array(p=n*n)].map((_,i)=>i==p>>1?" ":g(i/n|0)&g(i%n,c="AI9O8NRTEE6LSUD4G3BCMPFHVWY?2KJXQZ".replace(/(\D+)(\d)/g,(_,c,i)=>c.repeat(i))[Math.random()*100|0])?c<"A"?"!":c.toLowerCase():++i%n?c:c+`
`,g=x=>x&&x<n-1&((n>>1)-x)%n%3==0).join``

;(R.onclick=L.onchange=I.oninput=function(){let n=+I.value,res=f(n);O.innerText=n+"\n"+(L.checked?res.replace(/[A-Z\?]/g,".").replace(/[a-z!]/g,"#"):res);})()
<input id=L type=checkbox> Layout only <button id=R>Rerun</button>
<input id=I type=range min=9 max=53 step=2 value=9 style="width:100%">

You should be able to save a couple of bytes by moving the assignment of c within one of the calls to g.

Really like the slider and layout functionality!

@Shaggy Thanks, I was able to save some more by improving the ternary expressions too.

Perl 5, 246 244 + 1 (-n) = 247 245 bytes
$m=($n=$_-$_%2)/2;for(@a=(U x++$n)x$n){$_=(LUU,ULU,UUL)[$m%3]x($n/3).U x($n%3)if$z%@a&&$z%3==$m%3;substr$_,$m,1,$"if$m==$z++;s/L/-U/g;s/U/substr"EEAIONRT"x6 .AIJKQXZG."AIO?BCFHMPVWYGUUSSLLDD"x2,rand 100,1/ge;s/^-//;s/-\?/!/g;s/-(.)/lc$1/ge;say}

Try it online!

Fixed it now along with a few other things.

Perl 6, 162 161 154 153 bytes
{(my@b=0,|(-$^m..$m).map({$_%%3+!$_}),0).map:{((my$e='AIJKQXZG'~'NRTBCFHMPVWYG'x 2~'EEEAAIIOONRTUSLD'x 4)~'??',$e.lc~'!!',' ')[@b Xmin$_]».comb».roll}}

Try it online!
Takes (n-3)/2 as input, returns a list of lists of letters.
Explanation:
-> $m {
    # Idea stolen from @Xcali's answer.
    my $e = 'AIJKQXZG' ~ 'NRTBCFHMPVWYG' x 2 ~ 'EEEAAIIOONRTUSLD' x 4;
    # Array containing 1 for bonus tiles, 2 for middle element, like
    #     (0,1,0,0,1,0,0,2,0,0,1,0,0,1,0)
    my @b = 0, |(-$m..$m).map({ $_ %% 3 + !$_ }), 0;
    # Map column vector.
    @b.map: {
        # Compute element-wise minimum of row vector and value from
        # column vector. Select character pools accordingly and get
        # random items.
        ($e~'??', $e.lc~'!!', ' ')[@b Xmin $_]».comb».roll
    }
}

[C64 basic v2, 210 209 bytes]
1t$="2?9E3E9A9I8O6N6R6T4L4S4U4D3G2B2C2M2P2F2H2V2W2Y1K1J1X1Q1Z":rEn
3fOx=1ton:fOy=1ton:a=rN(0)*100:b=1
4c=aS(mI(t$,b,1))-48:d=aS(mI(t$,b+1,1)):b=b+2:ifc>atH6
5a=a-c:gO4
6pO983+40*y+x,c:nE:nE:pO1003.5+n*20.5,32

An input n 5 can be specified like
0dA5

That "5" to the end should be changed to any odd number. Don't give more than 25, then the program will overwrite itself.

How to try it: google for "vice c64 emulator", install it, and copy-paste this basic code into it. To start the program, type: RUN. To clear the screen, press shift/home.
And the result:

What's the best way for me to validate this and apply the input? :)

@DomHastings C64 emulator with a monitor (monitors are byte-level memory modifiers in the c64 world), or the help plus plus basic extender. I am not 100% sure that it will work, but 90 yes.

@DomHastings I can make a 3 byte longer, debuggable version. The important thing is that the common basic commands are given here in tokenized form. The token is always very simple: first char of the command + the second char in uppercase. For example, FOR is tokenzied as fO. Or GOTO as gO. I could have made it also interactive, but unfortunately the INPUT command is an exception, it doesn't have a token. This is why the input should be given with DATA command, whose token is dA.

I'd certainly love to see it in action, any way you can help me get to see it would be awesome! Ah, thanks for explaining, that make it read better to me. I'll come back to this in the morning!!

@DomHastings Don't need, it is ready. :-) There were some minor bugs, I fixed them and the result become 1 byte smaller! In asm, it could have been only roughly 40 byte. Although I had to use some tricky way to the random generation.

Thank you for explaining and thank you for the screen shot! I'll play with this tomorrow as I'm quite intrigued, but thanks for indulging my questions!

Python 3, 214 236 240 bytes
lambda n:[[[choice([s,[[c.lower(),'!'][c<'A']for c in s]][((i-n//2)%3+(j-n//2)%3<1)*(i*j>0)*(i<n-1)*(j<n-1)])," "][i==j==n//2]for j in range(n)]for i in range(n)]
from random import*
s=(("OIAE"*2+"SDLUNTRE")*2+"HVBMCYPWF?GNTR")*2+"ZXJQKGIA"

Try it online!
The multiplicity of each character is expressed as sum of powers of two, e.g 12 = 8 + 4 => "E"*12 = "E"*2*2*2 + "E"*2*2.
((i-n//2)%3+(j-n//2)%3<1)*(i*j>0)*(i<n-1)*(j<n-1) may probably be golfed.

@Giuseppe I will fix it

I like the extra clarification via the assert!

@Giuseppe I hope it's ok now. i<n was always true, even when i=n-1 (bottom). Same for j.

looks good to me! +1.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Is it a completely even number?
A completely even number is a positive even integer whose divisors (not including 1) are all even.
Some completely even numbers are:

2 (divisors: 2, 1)
4 (divisors: 4, 2, 1)
16 (divisors: 16, 8, 4, 2, 1)
128 (divisors: 128, 64, 32, 16, 8, 4, 2, 1).

Some non-completely even numbers are:

10 (divisors: 10, 5, 2, 1)
12 (divisors: 12, 6, 4, 3, 2, 1)
14 (divisors: 14, 7, 2, 1)
18 (divisors: 18, 9, 6, 3, 2, 1)
1, being odd, is not completely even.

0 is not completely even (it's divisible by all positive integers, including odd numbers) but you do not need to handle this.
Your challenge is to take a positive integer as input and output a truthy value if it is completely even and a falsy value if it is not. These outputs do not need to be consistent.
If your solution doesn't return a falsy value for 0, it's encouraged to show what changes would be necessary to make it do so. Especially encouraged is to show how your solution differs from checking if the input is a power of 2; in some languages it may be shorter, and in some longer.
Input may be taken via any allowed method, and output may be given via any allowed method.
The shortest code in bytes wins!

Related

This is powers of 2 (credit to El'endia Starman in chat for pointing it out)

Related, related.

@Xcali that one is closed, and this one doesn't have the [tag:restricted-source]

For those who might be able to implement: The sum of this number's binary digits will always equal 1

@mbomb007 I fixed it.

@MDXF I meant in a way that a user searching for the challenge could find it.

@mbomb007 ah, I see. Fixed.

I know this has been repeated ad nauseam, but the challenge does not merely ask for powers of two. 2⁰ = 1, so 1 is a power of two, yet not completely even.

@mbomb007 See above.

@Dennis, the question contradicts itself. By the definition given in the first paragraph, 1 is completely even, because its divisors except 1 form an empty set and so are trivially all even.

Yeah, it really is the powers of 2. So I think it should be a generic "powers of 2" challenge, which we don't yet have.

@mbomb007 That would invalidate all existing answers.

@mbomb007 / Dennis I'll ask a new question sometime later today. If that's generally accepted.

Reopen voters, please read comments before voting. The question hasn't been edited to not contradict itself, so it is unclear and should still be closed. That it's not possible to change the close reason without reopening is a flaw in the system, but just reopening questions which need fixing is not the solution.

This is still the closest thing to a pure "powers of 2" question on the whole site... and it asks you to return falsey for 1. Damnit. But this would be a good question, worthy of having positive votes, if only there were also a plain "powers of 2" question.

05AB1E, 2 bytes
Óg

Try it online!
In 05AB1E only 1 is truthy. Input-1-and-input-0-verified.

MATL, 2 bytes
qB

Try it online!
How it works
This takes advantage of MATL's convenient interpretation of truthy and falsy. q decrements the input and B gets the binary representation of the result. This yields a non-empty array of 1's (truthy) for even powers of two, an array that is either empty of contains a 0 (falsy) otherwise.

Throws an error for 0.

Which makes the output empty and thus falsy.

Is this an allowed output format? Why should 1 0 1 0 1 0 1 be considered falsy and not truthy?

Jelly, 3 bytes
^’>

Try it online!
How it works
^’>  Main link. Argument: n

 ’   Decrement; yield n-1.
^    Compute the bitwise XOR of n and n-1.
     This will conserve the highest set bit of n only if n is a power of two.
     If n is even, n-1 will be positive and the result will be different from n.
  >  Test if the result is larger than n.

Python 3, 16 bytes
lambda n:n^n-1>n

Returns True or False.
Try it online!
How it works

If n = 0, then n ⊕ (n - 1) = 0 ⊕ -1 = -1 < 0 = n, so the function returns False.
If n = 1, then n ⊕ (n - 1) = 1 ⊕ 0 = 1 = n, so the function returns False.
If 2k < n < 2k+1, then 2k ≤ n - 1 < 2k+1, so n and n - 1 have the 2k bit in common,
n ⊕ (n - 1) < 2k < n, and the function returns False.
Finally, if n = 2k with k > 0, then n = 2k and n - 1 = 2k - 1 have no bits in common, so
n ⊕ (n - 1) = n + (n - 1) > n + 0 = n and the function returns True.

Regex (ECMAScript or better), 17 bytes
^((x+)(?=\2$))+x$ - Completely even
Takes its input in unary, as a string of x characters whose length represents the number.
Try it online! - ECMAScript
Try it online! - ECMAScript 2018
Try it online! - Java
Try it online! - Perl
Try it online! - PCRE
Try it online! - Boost
Try it online! - Python
Try it online! - Ruby
Try it online! - .NET
Remarkably, there are three completely different 17 byte solutions for Powers of 2, which blew my mind even when I thought there were two. For this challenge, only one is 17 bytes, but for plain Powers of 2 they all are.

^(?!(x(xx)+)\1*$) - 17 bytes - Powers of 2
^(?!(x(xx)+)\1*$)x - 18 bytes - Powers of 2, correct at zero
^(?!(x(xx)+)\1*$)xx - 19 bytes - Completely even

Regex engine
Powers of 2
Completely even

ECMAScript
Try it online!
Try it online!

Python
Try it online!
Try it online!

Ruby
Try it online!
Try it online!

This is what I came up to solve a level of Regex Golf on 2014-02-21, and was also independently discovered by several others, including earlier than 2013-12-20. It's the one most similar to the well-known primality test, which is probably why most people came up with this one instead of the others.
It asserts that \$n\$ has no odd divisors of \$3\$ or greater yielding a positive quotient. It has a false positive for zero, since although zero can be divided by any odd number, the quotient is zero, not positive. This can be fixed at the cost of an extra byte: ^(?!(x(xx)+|)\1*$) or ^(?!(x(xx)+)\1*$)x.
Since the entire test is inside a (negative) lookahead, it can be adapted to answer this challenge by adding xx at the end, which enforces that only \$n≥2\$ can match.

^(?!(x*)(\1\1)+$) - 17 bytes - Powers of 2
^(?!(x*)(\1\1)+$)xx - 19 bytes - Completely even

Regex engine
Powers of 2
Completely even

ECMAScript
Try it online!
Try it online!

Python
Try it online!
Try it online!

Ruby
Try it online!
Try it online!

This was discovered by Grimmy in 2019-02-05, without fanfare. I on the other hand was amazed, as this has no such flaw as the other negative assertion – it does not match zero.
It asserts that \$n\$ has no divisors yielding an odd quotient of \$3\$ or greater. As a negative assertion, it does not consume the power of 2 that it matches, and thus is great for use in larger regexes where it doesn't need to be wrapped in a lookahead to allow other tests to be done on the same value of \$tail\$.
The downside is that in standard regex engines, it's significantly slower than ^(?!(x(xx)+|)\1*$). In my regex engine though, they're both statically optimized into a bitwise power of 2 test unless optimizations are disabled.

^((x+)(?=\2$))*x$ - 17 bytes - Powers of 2
^((x+)(?=\2$))+x$ - 17 bytes - Completely even

Regex engine
Powers of 2
Completely even

ECMAScript
Try it online!
Try it online!

Python
Try it online!
Try it online!

Ruby
Try it online!
Try it online!

I discovered this one in 2014-02-21, after being mentally primed by solving teukon's Dominoes 2 puzzle (which is now included in Regex Golf); teukon independently came up with it later that same day. It was the very first problem in unary that we solved by repeatedly decreasing \$tail\$ in a loop while retaining an invariant property at every step, and is probably the simplest function that is best golfed by being solved that way.
It repeatedly divides \$tail\$ by \$2\$ (asserting each time that there is no remainder) as many times as possible, and then asserts that the end result is \$1\$. This one is useful in larger regexes when it is desirable to consume the identified power of 2.
It is the most suitable for solving this challenge, “Is it a completely even number?”, as the only change necessary is upping the minimum iteration count of the loop from 0 to 1 by changing the * quantifier to a +, at a cost of 0 bytes. This enforces that \$n\$ must be evenly divided by \$2\$ at least once before yielding an end result of \$1\$.

Python 2, 18 bytes
lambda x:~-x&x<1<x

Try it online!
-3 thanks to Rod.

JavaScript (ES6), 14 bytes

f=
n=>n>1>(n&n-1)
<input type=number min=0 oninput=o.textContent=f(this.value)>

Python doesn't have the monopoly on chained comparisons!

This might be the first time I've ever seen JS's comparison chaining come in handy in a function this short...

Japt, 6 bytes
õ!² øU

Test it

Explanation
Generate an array of integers (õ) from 1 to input U. Raise 2 to the power of each (!²). Check if the array includes (ø) U.

Get outgolfed 6 years later

Husk, 3 bytes
Returns log₂(x) if True 0 otherwise
£İ2

Explanation
£       Is it an element of the increasing sequence
 İ2     powers of two (starting at 2)

Try it online!

Are all positive integers truthy in Husk?

Yes, and negative integers too

Python 2, 33 bytes
lambda n:bin(n).count('1')==1-n%2

Try it online!
Recusive approach, 38 36 bytes
-2 bytes thanks to Leaky Nun
f=lambda n:n>1if n<3else f(~n%2*n/2)

Try it online!

37 bytes

36 bytes

You have lambda n but you use variable i.

@NoOneIsHere my bad, fixed

Implicit, 7 2  3 bytes
½?ö

Try it online! Explanation:
     implicit float input
½    calculate log2(input)
 ?   if truthy
  ö   push 1 if top-of-stack is whole, 0 if non-whole
     implicit int output

½ pushes log2(input). If the input is 0 or 1 it will push 0.000000. 0 is a whole number so performing ö on 0 will yield 1, giving the incorrect result for the input 1. ? only performs the next command if the top of stack is truthy. So if the input was 1 or 0, it will skip the ö and print 0 as it's supposed to. Otherwise it will push 1 if log2(input) is whole and 0 if it's not.

Regex (Tcl ARE), 24 22 bytes
^((x((xx)*))\2*$)\3 - 19 bytes - Powers of 2 - Try it online!
^(x$|(x((xx)*))\2*$)\3 - 22 bytes - Completely even - Try it online!
Tcl ARE has both positive and negative lookaheads, but neither backreferences nor captures can be done inside one. So seemingly, it would be impossible to match powers of 2 instead of non-powers, because all of the ECMAScript regexes use backreferences inside a lookahead. This challenge states "output a truthy value if it is completely even and a falsy value if it is not", so an inverted-logic regex, such as ^(x*)(\1\1)+$|^x$, would not satisfy the rules.
But as it so happens, in Tcl ARE it seems that any group anchored on both sides (^ at the beginning and $ at the end, either inside or outside the group as long as it's adjacent to the parentheses) in all its alternatives will be treated as atomic (preventing the engine from doing the equivalent of backtracking into that expression if the pattern fails to match at a later point). This does not appear to be documented, but it can be exploited to emulate a negative match. The equivalent in engines that support atomic groups would be:
^(?>(x((xx)*))\1*$)\2 - 21 bytes - Powers of 2 - Try it online!
^(?>(x\B((xx)*))\1*$)\2 - 23 bytes - Completely even - Try it online!
These in turn are based on the 17 byte ECMAScript regex ^(?!(x(xx)+)\1*$). The logic of the Tcl ARE version is to assert that the largest odd factor of \$n\$ is \$1\$. The "completely even" version additionally asserts than \$n\ne 1\$.
Even more strangely than the atomic grouping behavior, Tcl ARE apparently records the positions where word-boundary-match operators (\m, \M, \y, \Y) were used inside a capture group, and repeats them if that group is repeated via a backreference. So ^((x\Y((xx)*))\2*$)\3 (21 bytes) not only doesn't match \$1\$, but doesn't match \$2\$ either: Try it online! – and as a result, the 22 byte method has to be used instead.
Explanation for Powers of 2 (19 bytes):
^
(                  # Group an expression that is anchored to start at its
                   # beginning and to end at its end, thus telling the Tcl ARE
                   # regex engine to treat it as atomic, not backtracking into
                   # it if a subsequent match fails.
    (              # \2 = sum of the following, which will be the largest odd
                   #      number that results in a match for what follows:
        x          # 1; tail -= 1
        ((xx)*)    # \3 = any even number, including zero, trying the largest
                   #      values first; tail -= \3
    )
    \2*$           # Assert that \2 divides tail; anchor to end of string
)
\3                 # Now that the above match is locked in and won't backtrack,
                   # assert that \3 == 0, as no other value can match when
                   # tail == 0 (at the end of the string), thus asserting that
                   # \2 == 1, i.e. that the largest odd factor of N is 1.

For Completely even (22 bytes), an alternative of x$ is inserted as the first choice. If \$n=1\$ and this alternative matches, it effectively acts like a boolean short-circuit operator – the powers of 2 test won't be done, and \3 will not be set.
An alternative method to match powers of 2 is ^((x+?)((\2\2)*$))\3 (20 bytes): Try it online! - this uses the same atomic grouping trick, but the logic is to assert that the smallest quotient from dividing \$n\$ by any odd number is \$n\$ (thus it's implied that the only odd divisor of \$n\$ is \$1\$). For "completely even" numbers this becomes ^(x$|(x+?)((\2\2)*$))\3 (23 bytes): Try it online! But this method is much slower than the primary one shown in this answer, and Tcl cannot even match \$n=64\$ within 60 seconds.

Jelly, 5 bytes
Æf=2Ȧ

Try it online!
Does NOT fail for 1!

Java (OpenJDK 8), 18 16 bytes
i->i>1&(i&~-i)<1

Try it online!

This also works in JS, if you replace the "skinny arrow" with a "fat arrow": https://tio.run/##y0osSyxOLsosKNHNy09J/Z@cn1ecn5Oql5OfrqHxP9PWLtPOUE0jU61ON1PTxvC/poahkYWm5n8A

Way better than the method based version, i->Integer.bitCount(i+1)==1 by 11 bytes!

@corsiKa The most I could golf the method based one down to was 22 bytes: i->i>1&i.bitCount(i)<2. You can call a class' static methods using an instance

C (gcc), 37 33 27 18 bytes
Thanks to @MD XF for the idea
f(n){n=(n^n-1)>n;}

Try it online!

20 bytes

@MDXF Nice! I knew there was a way to determine with simple arithmetic just couldn't figure out how.

Pyth, 5 bytes
q]2{P

Verify all the test cases.
Alternative:
q2s{P

Explanation

q]2{P  ~ Full program with implicit input (Q) at the end.

    P  ~ Prime factors.
   {   ~ Deduplicated.
q      ~ Equals?
 ]2    ~ The literal [2].
       ~ Output (implicitly).

!-PQ2 is 5 bytes too, similar idea

q2eP for 4 bytes. P gives an ordered list, so eP is the largest prime factor.

MATL, 4 bytes
Saved a byte thanks to Luis Mendo!
Yf2=

Try it here.
Returns 1 (or an array of several 1s) for truthy and 0 or   (the empty string) for falsy.
How?

Yf2=   % Full program.

Yf     % Prime factors.
  2=   % All equal 2?
       % Output implicitly.

@LuisMendo Thanks, thanks a lot!

@LuisMendo Thanks, addressed.

JavaScript, 14 11 bytes
-3 thanks to Deadcode

f=
n=>!(n&n-2)

// test numbers 0-16
const tests = [f(0), false, true, false, true, false, false, false, true, false, false, false, false, false, false, false, true]
const results = tests.map((res, n) => res === f(n))
document.write(
  results.every(res => res)
    ? "All tests passed "
    : [
        "Tests failed ",
        ...results.map((res, n) => !res && `f(${n}): expected ${tests[n]}`).filter(Boolean),
      ].join("
")
)
body{font-size:3rem;font-family:monospace}

Explanation - this uses this trick for checking if n is a power of 2, but uses n&n-2 instead of n&n-1 to make 1 return false

Welcome to CGCC! And, 8 bytes: n=>n&n-2. But by my interpretation OP specified that swapping truthy/falsey is not allowed, so, 11 bytes: n=>!(n&n-2)

Also I would recommend putting f(0) (or !f(0), if you stick with the swap) as the first element of your test array. It's disingenuous to verify that your function is returning the wrong value for zero as part of the test suite, as by the challenge's rules, it can return either truthy or falsey for an input of zero.

I was trying to figure out a way to skip the n==1 check but didn't think of this. Thanks!

Another way you could save bytes, but stick with the same bitwise operation, is n=>n<2|n&n-1. This would also make it return the correct value for zero. There are two savings being done with that: using n<2 instead of n==1, and using | bitwise OR instead of || logical OR (they both work with JavaScript's operator precedence).

Huh, didn't know bitwise OR worked like that. I think I'll stick with your previous version though.

Regex (Java / Perl / PCRE / .NET), 12 bytes
^(\1\1|^x)*x$ - 13 bytes - Powers of 2
(\1\1|^x)+x$ - 12 bytes - Completely even

Regex engine
Powers of 2
Completely even

Java
Try it online!
Try it online!

Perl
Try it online!
Try it online!

PCRE
Try it online!
Try it online!

.NET
Try it online!
Try it online!

Subtracts increasing powers of 2 from \$tail\$, starting with \$1\$. As such, the sum of the subtracted powers will be \$2^a-1\$ where \$a\$ is the number of iterations so far. Once the loop has matched as many iterations as it can, asserts that the remaining \$tail=1\$.
Unlike the ECMAScript regexes, this needs to do no backtracking, thus is orders of magnitude faster in standard regex engines.
As with the 17 byte ECMAScript regex, it is quite suitable for solving this challenge, as the only change necessary is upping the minimum iteration count of the loop from 0 to 1 by changing the * quantifier to a +, at a cost of 0 bytes. But an added bonus here is that the first iteration of the loop can only match at the beginning of the string, so we can remove the first ^ anchor to save 1 byte. This does make the regex much slower in most regex engines though.
Regex (Java / Perl / PCRE / Pythonregex / Ruby / .NET), 22 bytes
^((?=(\3\3|^x))(\2))*x$ - 23 bytes - Powers of 2
((?=(\3\3|^x))(\2))+x$ - 22 bytes - Completely even

Regex engine
Powers of 2
Completely even

Python import regex
Try it online!
Try it online!

Ruby
Try it online!
Try it online!

This is a direct port of the 13 byte / 12 byte regex. Ruby, and Python's regex module, do not support nested backreferences, so they must be emulated via forward-declared backreferences. (Python's re module doesn't even support the latter.) The 13 byte version of this is faster than the 17 byte regexes, but golf-wise, they win.
Although this results in a fast regex that's compatible with six different engines, the recursive solutions provide the best golf for Python's regex module and Ruby.
\$\large\textit{Full programs}\$
Retina 0.8.2, 18 bytes
.+
$*
(\1\1|^.)+.$

Try it online!
Takes its input in decimal. Uses the Java/Perl/PCRE/.NET pure regex.
Perl 5, 24 bytes
say 1x<>~~/(\1\1|^.)+.$/

Try it online!

Regex (PCRE1), 11 bytes
^(x(?1)?x|x)$ - 13 bytes - Powers of 2
^(x(?1)?x)$ - 11 bytes - Completely even

Regex engine
Powers of 2
Completely even

PCRE1
Try it online!
Try it online!

I'm not sure when this recursive regex was originally discovered. It was likely an accidental discovery, when someone tried to match palindromes and found that due to PCRE1's atomic subroutine calls, words consisting of only one distinct letter would only match when their length was a power of 2.
Explaining why this works is complicated, but I do intend to do it sometime.
This regex is absolutely phenomenal at being ported to this challenge; it loses 2 bytes in doing so.
Regex (Perl / PCRE), 15 bytes
^x(x(?1)?+x|x|)$ - 16 bytes - Powers of 2
^x(x(?1)?+x|x)$ - 15 bytes - Completely even
This is a port of the PCRE1 regex to engines that may have non-atomic subroutine calls.

Regex engine
Powers of 2
Completely even

Perl
Try it online!
Try it online!

PCRE1
Try it online!
Try it online!

PCRE2
Try it online!
Try it online!

Regex (PCRE / Ruby), 16 bytes
^x(x\g<1>?+x|x|)$ - 17 bytes - Powers of 2
^x(x\g<1>?+x|x)$ - 16 bytes - Completely even
This is a port of the PCRE1 recursive regex to Ruby's subroutine call syntax.

Regex engine
Powers of 2
Completely even

PCRE1
Try it online!
Try it online!

PCRE2
Try it online!
Try it online!

Ruby
Try it online!
Try it online!

Regex (Perl / PCRE2 / Boost / Pythonregex), 15 bytes
^x(x((?1))\2|)$ - Powers of 2
^x(x((?1)?)\2)$ - Completely even

Regex engine
Powers of 2
Completely even

Perl
Try it online!
Try it online!

PCRE2
Try it online!
Try it online!

Boost
Try it online!
Try it online!

Python import regex
Try it online!
Try it online!

I discovered this recursive regex on 2022-07-18 while working on
Sum of Powers of 2. It relies on subroutine calls being atomic.
^            # tail = N = input number
x            # tail -= 1
(            # Define subroutine (?1)
    x        # match += 1; tail -= 1
    ((?1))   # \2 = match made by recursive call; match += \2; tail -= \2
    \2       # match += \2; tail -= \2
|    # or
             # Match nothing, causing a cascading pop to the top level of
             # recursion, ending the match.
)
$            # Assert that we've reached the end of the string.

This is similar to ^(\1\1|^x)*x$, in that the (?1) subroutine call will always return \$2^a-1\$ where \$a\$ is the depth of recursion it reached. This is why an extra \$1\$ is subtracted at the beginning (it could just as easily be done at the end, but that would be slightly slower due to backtracking).
It is very easily ported to solving this challenge; the first iteration at which it has a choice of whether to match nothing just has to be pushed down one level, at a cost of 0 bytes.
Regex (PCRE2 / Ruby), 16 bytes
^x(x(\g<1>)\2|)$ - Powers of 2
^x(x(\g<1>?)\2)$ - Completely even

Regex engine
Powers of 2
Completely even

PCRE2
Try it online!
Try it online!

Ruby
Try it online!
Try it online!

This is a port of the non-atomic recursive regex to Ruby's subroutine call syntax.

Thunno -, \$ 4 \log_{256}(96) \approx \$ 3.29 bytes
bdiP

Attempt This Online!
or verify all test cases
Port of Dennis's MATL answer.
Thunno DD, \$ 5 \log_{256}(96) \approx \$ 4.12 bytes
1-A^<

Attempt This Online!
or verify all test cases
Port of Dennis's Jelly answer.
Note: a plain "power of two" answer would be 5 chars: b1c1= (is the count of 1s in the binary representation equal to 1?)
Explanation
bdiP  # Implicit input
      # - flag decrements
b     # Convert to a binary string
 di   # Get the list of digits
      # This is a non-empty list of ones
      # if the input is a power of two
   P  # Push the product of this list
      # Implicit output

1-A^<  # Implicit input
1-     # Subtract one
  A^   # Xor with input
       # The highest set bit will only be conserved
       # if the input is a power of two
    <  # Is more than input?
       # Implicit output

Vyxal g, 4 bytes
Kḣv₂

Try it Online!
Can probably be golfed but it’s painful to do this on mobile.
Outputs 1 for truthy, 0 or the empty list for falsy.
K    # divisors of input
 ḣ   # without the first element
  v  # vectorize the following over it
   ₂ # is even?
     # (after which the `g` flag takes the minimum of the stack)

2 bytes with g flag, ports MATL: Try it Online!

PowerShell, 40 bytes
param($i)(($i-band(-$i))-eq$i)-and$i-ne0

Try it online!

Thunno 2 M, 2 bytes
⁻ḃ

Attempt This Online!
Port of Dennis's MATL answer: decrement, convert to binary, take minimum.

A plain "power of two" answer would be 4 bytes:
2BSḅ

Attempt This Online!
Convert to a binary list, sum equals one?

Neim, 3 bytes
ᛃ

Doesn't work on TIO.

Fails for input 1?

@LeakyNun Trying the program that produces the inverse output, ᛄ (which works on TIO), succeeds for input 1.

Mathematica, 21 bytes
IntegerQ@Log2@#&&#>1&

@deleter I think it works for 1 now.

Jelly, 5 bytes
ÆEL’¬

Try it online!

Kind of different approach :p

Retina, 25 bytes
.+
$*
+`^(11+)\1$
$1
^11$

Try it online!

Actually, 5 bytes
;R♂╙c

Try it online!
Explanation:
;R♂╙c
;      duplicate n
 R     range(1, n+1)
  ♂╙   powers of 2
    c  contains n

Haskell, 24 bytes
f n=elem n$map(2^)[1..n]

Try it online!

Actually, 4 bytes
yN2=

Try it online!

CJam, 9 bytes
{mf2f=:*}

Anonymous block that takes the input number from the stack and replaces it by either 1 or 0.
Try it online!
Explanation
{       e# Begin block
  mf    e# Array of (repeated) prime factors
  2f=   e# Compare each element of that array with 2
  :*    e# Fold product over the array
}       e# End block

Pyke, 6 bytes
P}2]1q

Try it here!
P      - Prime factors.
 }     - Deduplicate.
  2]1  - Create a one-element list, [2].
     q - Is equal?

Kotlin, 19 17 16 bytes
{it-1 xor it>it}

Test
private val t: (Int) -> Boolean =
{it-1 xor it>it}

fun main(args: Array<String>) {
    println(t(0))
    println(t(1))
    println(t(999))
    println(t(1024))
    println(t(2))
}

TryItOnline

The note saying zero handling isn't needed was added after your answer, but in light of it, {it-2 and it<1} is 1 byte shorter. I'd recommend keeping the zero-handling solution too, though.

Julia 0.6, 10 bytes
!n=n-1$n>n

Try it online!

TI-Basic, 11 bytes
logBASE(Ans,2
Ans and not(fPart(Ans

Alternate solution (14 bytes):
max(Ans=2^seq(I²,I,2,Ans

Perl 5, 28 bytes
$_=sprintf'%b',<>;say/^10+$/

Try it online!

Cubically, 12 bytes
$R:7-8⊕7>7%6

Try it online!
Cubically's code is quite short and easily writable, if the solution does not involves too much (more than 1) temporary variables.
Explanation: I used other people's solutions, calculate (n^(n-1)) > n.
$               Input number n, store to memory index 7.
 R              Make the cube unsolved by perform a move "R" on the cube, thus the value of face 8 will be truthy (1).
  :7            Set notepad value to value of memory index 7 (number n)
    -8          Subtract by value of memory index 8, which is 1 because cube is unsolved.
      ⊕7       Calculate bit-xor of current notepad value (n-1) with value of memory index 7 (n), store to notepad.
        >7      Calculate (notepad > n), store to notepad.
          %6    Print value of notepad as number (0 for falsy, 1 for truthy).

As long as an interpreter exists that your 11 byte version works in then it is valid and can be submitted as your solution.

What's wrong with TIO's Cubically?

@MDXF According to the specification when the cube is solved (initially) face 8 should be truthy (1), but it is 0. Try it online!

Oh, that's a bug in the spec, not the language. 8 is used for looping until the cube is solved, e.g. (R2)8 will perform R2 while the cube is not solved. So 8 contains 0 when the cube is solved and 1 when it's not. Just fixed that in the spec.

The if-else is still bugged, though. (isn't it? I didn't actually check right now)

%6 can be shortened to %.

QBIC, 16 bytes
[:|~2^a=b\_X1}?0

This checks all powers of 2 from 1 to the input, to see if it matches the input. Prints 1 when it does, 0 when it doesn't.

JavaScript (Node.js), 12 bytes
n=>(n^n-1)>n

Port of my Python answer.
Try it online!

PHP, 22 24+1 bytes
<?=(($n=$argn)^$n-1)>$n;

Run as pipe with -rF. Prints 1 for truthy, empty output for falsy.
hmm ... looks like a port from Dennis´ answer.

Dang, @Deadcode is right: bitwise operations rank lower than comparisons.
And try as I might, I could not find a way around the parentheses.

This doesn't work: Try it online! An extra pair of parentheses are needed (+2 bytes): Try it online!

Perl 5, 20 18 bytes
say!(($_=<>)&$_-2)

Try it online!
Note that this would be 17 bytes with swapping allowed, but by my interpretation, the challenge specifies that swapping is not allowed.
This is modification of the classic bitwise formula for powers of 2, using \$n∧(n-2)=0\$ instead of \$n∧(n-1)=0\$. It appears nobody else has used this yet? This method would work for eliminating all powers of 2 less than any chosen power of 2. For example, to eliminate \$\{1,2,4,8\}\$, the formula would be \$n∧(n-16)=0\$.
To handle zero correctly, a port of Dennis's Jelly answer won't work, since Perl casts the result of bitwise XOR to an unsigned integer, giving the result 18446744073709551615 for 0^-1. This can be fixed with use integer, but that would result in the program being 34 bytes:
use integer;say((($_=<>)^$_-1)>$_)

Try it online!
There is, however, a way to have proper zero handling at 21 bytes:
say!(($_=<>)--&$_)x$_

Try it online!
With both zero handling and consistent truthy values, 23 bytes:
say!(($_=<>)&$_-2)>!-$_

Try it online!

Checking for a power of 2 is 18 bytes if returning truthy for zero is acceptable:
say!(($_=<>)&$_-1)

Try it online!
With proper handling of zero, it's 21 bytes:
say!(($_=<>)&$_-1)*$_

Try it online!
With both zero handling and consistent truthy values, 23 bytes:
say!(($_=<>)&$_-1)>!-$_

Try it online!

C#, 22 17 bytes
x=>x!=1&&x&x-1==0

-5 by Steffan

Instead of false you can use something like 0>1 (I think). However, something like x!=1&&x&x-1==0 should work, and possibly n^n-1>n. (I don't know C# well).

Thanks a lot! I didn't realize I could do it.

Pyt, 5 bytes
ĐĦ1=*

Try it online!
Outputs 0 if not completely even, n if completely even
Đ            implicit input (n); duplicate on stack
 Ħ           get Hamming weight
  1=         equal to 1?
    *        coerce boolean to integer and multiply by n; implicit print

Japt -!, 3 bytes
&-Í

Try it or test numbers 0-16
This is n & -(2 - n) (simplifying to n & n-2), with the ! flag negating the result (0 becomes true, everything else becomes false)

Nice use of the auto-insertion of the second U :) I'd probably not have thought to try it after the &-, opting instead for &Ín.

J, 7 bytes
<[XOR<:

Uses \$n < (n \oplus n - 1)\$.
Attempt This Online!
<[XOR<:
     <:  NB. decrement
 [       NB. input
  XOR    NB. XOR
<        NB. is n less than result

Nekomata + -e, 4 bytes
←2D≡

Attempt This Online!
←2D≡
←       Decrement
 2D     Convert to base 2
   ≡    Check if all digits are equal

Sed, 117 bytes
Not the obvious language for an arithmetic code-golf, but still fun:
:a
s/^0*2$/T/
s/.*[,0]$/F/
t
s/[13579]/&,/g
y/123456789/011223344/
s/,0/5/g
s/,1/6/g
s/,2/7/g
s/,3/8/g
s/,4/9/g
ta
ba

This works using successive division by 2, terminating when we reach 2 (true) or a value that ends in zero (which must be a multiple of 5, or zero itself) or with a carry-out from having divided an odd number.
In more detail:
:a                   # start of loop
s/^0*2$/T/           # reached 2
s/.*[,0]$/F/         # reached an odd number
t                    # in which case, jump to end

s/[13579]/&,/g          # odd numbers cause a carry when divided
y/123456789/011223344/  # divide by two

s/,0/5/g             # add the carry
s/,1/6/g
s/,2/7/g
s/,3/8/g
s/,4/9/g

ta                   # jump, clearing the "substituted" flag
ba                   # jump anyway

Sample input and corresponding output:
0
1
2
3
4
32
64
10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376

F
F
T
F
T
T
T
T

(that last value is 2¹⁰⁰⁰)

C, 31 bytes
f(x){return !(x&(x-1))&&!(x-1)}

These are the powers of 2, except 1, and thus binary arithmetics solves the problem.

All submissions must be either full programs or functions. In particular, assuming that the input is stored in a certain variable is not allowed. Also, this approach fails when x = 1, which is a power of two but not.completely even.

@Dennis 1) Ok, I did, bit now I lost a lot of bytes. 2) The task still only describes the powers of 2, except 1. 3) What it with the languages on which no functions and procedures exist? 4) If you accept functions and programs, why you don't accept expressions? An expression in C is an independently calculatable execution fragment, just as the programs and the functions. | I am so sad, my solution is already a dirty one, it lacks already the katra.

PARI/GP, 29 bytes
Try it online!
f(n)=hammingweight(n)==1-n%2;

Python, 43 Bytes
import math
lambda x:math.log(x,2)%1or x==1

Outputs false for completely even number and outputs a truthy value for not completely even number.
Try it online (2 bytes added to allow testing)
Completely even numbers are just powers of 2 excluding 1. This programme takes the binary logarithm of the number. This only gives an integer when the argument is a power of 2. The modulo is to check if it is an integer.

Was this downvote from before this was deleted? If not, then why is it there?

Per the timeline, the downvote was indeed from before the answer was deleted.

C, 21 bytes
Requirement: 2's complement arithmetic
f(x){return!(x&x-2);}

This is a minor modification of the well-known expression x & (x-1) which yields zero when x is an power of two (including 2⁰, i.e. unity).  By subtracting an additional 1 from the right-hand side, we exclude the value that has that bit set.
0 results in a true value; if we wish to exclude that, we need an extra 3 bytes: !(x&x-2)&&x.

Demo
#include <stdio.h>
#include <limits.h>

int main(void)
{
    for (int i = INT_MAX;  i > 0; --i) {
        if (f(i)) { printf("%d\n", i); }
    }
}

The demo produces this output on a 32-bit system:
1073741824
536870912
268435456
134217728
67108864
33554432
16777216
8388608
4194304
2097152
1048576
524288
262144
131072
65536
32768
16384
8192
4096
2048
1024
512
256
128
64
32
16
8
4
2