text:
Make an infinite chain
Lets define a class of functions.  These functions will map from the positive integers to the positive integers and must satisfy the following requirements:

The function must be Bijective, meaning that every value maps to and is mapped to by exactly one value.
You must be able to get from any positive integer to any other positive integer by repeated applications of the function or its inverse.

Now, write some code that will perform any one function in this class on its input.
This is a code-golf question so answers will be scored in bytes, with less bytes being better.

Can you give an example?

@Jack Sure, Consider the function that maps 1 -> 2, maps every other odd number to that number minus 2, and every even number to that number plus 2.

Not sure I understand. Would f(x) := x+1 be a function of this class? In that case, 1+ in common lisp should do the trick here.

Continuing from MONODA43's question, would something like f(x) := x be valid?

@MONODA43 That function is a bijection when considering all integers. But this question asks for a bijection on the positive integers. Your suggestion would fail to output 1 because there is no positive x for which x+1=1.

@Cowsquack You must be able to get from any positive integer to any other positive integer by repeated applications of the function or its inverse. You cannot get from 1 to 2 by applying the identity, no matter how many times you repeat.

I think this is equivalent to asking for a permutation of the integers with no finite cycle.

@PeterTaylor It is not. Two separate chains covering all the positive integers would not have any finite cycles, but it wouldn't be possible to get between arbitrary pairs of integers of there were two separate chains.

@PeterTaylor In general take any valid answer generating a single chain. Now you can construct a pair of chains as follows. Multiply every number in the original chain by 2 to generate one chain. Multiply every number in the original chain by 2 and subtract one to generate another chain. The two chains generated this way would form a bijection on the positive integers, but would not be a valid answer.

Python 3, 24 bytes
lambda n:n-(-1)**n*2or 1

Try it online!

Ha, you ninja'd me because I took 20 extra seconds to write out my sequence before posting...

Python, 22 bytes
lambda n:n+n%2*4-2or 1

The even numbers go down to the previous even number, odd numbers go up to the next odd number, and the mapping 2 -> 1 connects those two.

wait... so 6 can result from 5 or 8? that's invalid?

@DestructibleLemon No, just a replaced odd with even in my explanation.

JavaScript (ES6), 20 bytes
n=>n>1?n%2?n-2:n+2:2

Maps ... -> 5 -> 3 -> 1 -> 2 -> 4 -> ..., which I think is valid. Correct me if I'm wrong...

Alike minds think great. I'm using the inverse.

@Dennis Heh, and I've just realized that the inverse is 1 byte shorter: n=>n%2?n+2:n-2||1:2

@Dennis You have been confirmed to be Yoda :o (StepHen's chat post)

@HyperNeutrino Greatly, alike minds think

Haskell, 20 bytes
f 1=2
f x=x+2*(-1)^x

The example function from the OP's comment in Haskell. Try it online!

Jelly, 6 bytes
-*Ḥạo1

Try it online!
How it works
-*Ḥạo1  Main link. Argument: n

-*      Compute (-1)**n, yielding 1 for even n and -1 for odd n.
  Ḥ     Unhalve; multipliy the result by 2.
   ạ    Compute the absolute difference of the result and n.
    o1  If the difference is 0, yield 1.

Are we really letting Dennis get away with 'unhalve'? Haha.

Python 3, 43 bytes
lambda n,a=(1,3,-3,-1):n+a[n%4]if n-2else 1

Try it online!
And the inverse, also 43 bytes:
lambda n,a=(-3,-1,1,3):n+a[n%4]if n-1else 2

Try it online!
TIO links use Dennis's test footer code.
Since everyone is using one way of doing, I decided I'd be different, so I created by own (although I'm probably not the first person to discover it) function. This functions maps like ... 10 -> 7 -> 6 -> 3 -> 2 -> 1 -> 4 -> 5 -> 8 -> 9 -> ..., I can show you the hand drawing I made to test this if you would like.
My golfed algorithm may be probably is golfable - tips would be appreciated.
Ungolfed versions: Try it online!

x86 32-bit machine code, 10 bytes
48 83 F0 01 74 01 40 34 01 C3

Try it online!
Uses the regparm(1) calling convention – argument in EAX, result in EAX.
Assembly:
.global f
f:
    dec eax
    xor eax, 1
    jz skip
    inc eax
skip:
    xor al, 1
    ret

05AB1E, 8 bytes
®¹m·αD_+

Try it online!
Exactly what Dennis's stuff does.
É4*+ÍD_+

Try it online!
orlp's stuff.

Java (OpenJDK 8), 22 bytes
r->r%2>0?r<2?2:r-2:r+2

Try it online!
I wish Java had a ** exponentiation operator. Oh well!

Vyxal r, 6 bytes
uedε1⟇

Try it Online!
@Dennis' answer, ported directly to Vyxal. Requires the r flag to reverse the arguments, e.g. ab+ evaluates to b+a instead of a+b.
Explanation taken from Dennis:
        # Implicit input -> n

ue      # Compute (-1)**n, yielding 1 for even n and -1 for odd n.
  d     # Unhalve; multipliy the result by 2.
   ε    # Compute the absolute difference of the result and n.
    1⟇  # If the difference is 0, yield 1.

        # Implicit output

Very clever use of the r flag. Well done!

Mathematica, 21 bytes
a@1=2;a@b_:=b+2(-1)^b

Move along, nothing to see here...

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:
Apply a wave to an array
Your task today is to apply a wave to an array of numbers. A wave looks like this: [1, 0, -1, 0, 1, 0, -1, 0, 1...] Applying it to a given array means adding together the first elements, the second elements, etc.
More precisely:
Your program or function will receive an array of integers. It must print or return an equally sized array with 1 added to the 1st, 5th, 9th, etc. element of the original array, -1 added to the 3rd, 7th, 11th, etc. element of the original array, and the rest of the elements should be left untouched.
The input array is guaranteed to have at least one element.
Test cases:
Input                               | Output
[0]                                 | [1]
[-1]                                | [0]
[-4, 3, 0, 1, 7, 9, 8, -2, 11, -88] | [-3, 3, -1, 1, 8, 9, 7, -2, 12, -88]
[0, 0, 0, 0, 0]                     | [1 ,0 ,-1 ,0 ,1]
[1, 1]                              | [2, 1]

This is code-golf, shortest code wins!

Somewhat unexepectedly, many solutions are using imaginary number magic...

It makes a good deal of sense why imaginary numbers would be useful, this is a wave problem and the imaginary numbers have a well documented history of polar properties.  Imaginary numbers can be pretty golfy way of calculating sines and cosines especially for these types of integer quarter rotations.  Math is cool ...

@WheatWizard It's a pretty big proportion given most languages don't have support for imaginary numbers.

Jelly, 5 bytes
Jı*Ċ+

Try it online!
How it works
Jı*Ċ+  Main link. Argument: A (array)

J      Indices; yield [1, ..., len(A)].
 ı*    Elevate the imaginary unit to the power 1, ..., len(A), yielding
       [0+1i, -1+0i, 0-1i, 1+0i, ...].
   Ċ   Take the imaginary part of each result.
    +  Add the results to the corresponding elements of A.

Same as what Leaky Nun got: https://chat.stackexchange.com/transcript/message/38868472#38868472

Any explanation?

@Pureferret the imaginary part of the successive powers of imaginary number i are added to each element

@Cœur is that 1, 2, 3 ... or 1, 0, -1, 0 ...?

@Pureferret the same explanation as the answer in MATL or Math.JS or Mathematica or R or ...

LOGO, 18 bytes
[map[?+sin 90*#]?]

There is no "Try it online!" link because all online LOGO interpreter does not support template-list.
That is a template-list (equivalent of lambda function in other languages).
Usage:
pr invoke [map[?+sin 90*#]?] [-4 3 0 1 7 9 8 -2 11 -88]

(invoke calls the function, pr prints the result)
prints [-3 3 -1 1 8 9 7 -2 12 -88].
Explanation (already pretty understandable):
 map[?+sin 90*#]?       map a function over all the items of the input
              #         the 1-based index of the element in the input
       sin 90*#         equal to the required wave
     ?                  looping variable
     ?+sin 90*#         add the wave to the input

Hah, I knew someone would come up with a sine-based answer.

@ETHproductions the very first answer, in Mathematica, was based on Sine until it was golfed down. The second answer, in R, is stil using sine.

@Phoenix I'm shocked that I didn't notice...

@ETHproductions and.... Sine has been golfed out of the R answer too. I think it's doing the same thing as the Mathematica answer.

Haskell, 26 bytes
zipWith(+)$cycle[1,0,-1,0]

Try it online! (runs all test cases)
Explanation:
zipWith(+)$cycle[1,0,-1,0]  -- anonymous tacit function
zipWith(+)                  -- pairwise addition between input list
          $cycle[1,0,-1,0]  -- and an infinitely-cycling "wave" list

Mathematica, 26 23 22 bytes
Im[I^Range@Tr[1^#]]+#&

Try it online! (Mathics)
Note: The TIO link is for the 23-byte version, the 22-byte version is not Mathics-compatible.

There is a 19-byte Mathematica solution below (with 4 bytes of initialization)

JavaScript (ES6), 28 bytes
a=>a.map((x,i)=>x-(i%4-1)%2)

The calculation goes like this:
i%4  -1  %2
0    -1  -1
1     0   0
2     1   1
3     2   0

The last bit taking advantage of the fact that in JS, a negative number when modulated will retain its negative sign (i.e. -5 % 3 -> -2, instead of 1 as it would be in Python).

Python 2, 40 bytes
i=2
for x in input():print~-x+i%5%3;i*=2

Try it online!

MATL, 11 8 bytes
Jyn:^Yj+

Try it at MATL Online!
Explanation
J     % Push 1j (imaginary unit)
      % STACK; 1j
y     % Implicit input. Duplicate from below
      % STACK: [-4 3 0 1 7 9 8 -2 11 -88], 1j, [-4 3 0 1 7 9 8 -2 11 -88]
n     % Number of elements
      % STACK: [-4 3 0 1 7 9 8 -2 11 -88], 1j, 10
:     % Range
      % STACK: [-4 3 0 1 7 9 8 -2 11 -88], 1j, [1 2 3 4 5 6 7 8 9 10]
^     % Power, element-wise
      % STACK: [-4 3 0 1 7 9 8 -2 11 -88], [1j -1 -1j 1 1j -1 -1j 1 1j -1]
Yj    % Imaginary part
      % STACK: [-4 3 0 1 7 9 8 -2 11 -88], [1 0 -1 0 1 0 -1 0 1 0]
+     % Add, element-wise. Implicit display
      % STACK: [-3 3 -1 1 8 9 7 -2 12 -88]

R, 29 24 bytes
(l=scan())+Im(1i^seq(l))

Try it online!

Jelly, 16 bytes
-1Jm2$$¦+2Jm4$$¦

Try it online!
heh I'm sure this is too long
Edit
I know a 5 byte solution is possible but my wifi appears to be starting to cut me off so I'll golf this tomorrow. If someone posts the short Jelly solution before I can golf this, that's fine with me; I'll just keep this here for reference as to how bad I am at Jelly lol another way of doing it. I mean, I could just look at the link Phoenix posted in the comments, but since I'm still learning, I don't want to look at the solution until I've figured it out myself. This might cost me reputation but the learning is what I'm here for :)))

LeakyNun did it in 5 in chat: Spoiler

oh .__________.

Dennis got it: https://codegolf.stackexchange.com/a/135145/60042

Python 2, 50 42 bytes
Saved 8 bytes thanks to @Sisyphus!
lambda l:map(sum,zip(l,[1,0,-1,0]*len(l)))

Try it online!
53 bytes
lambda l:[int(x+(1j**i).real)for i,x in enumerate(l)]

Try it online!

lambda l:map(sum,zip(l,[1,0,-1,0]*len(l))) for Python 2

Nice, that saves 5 bytes in Python 3 and then 3 more in Python 2. Thanks!

J, 12 bytes
+1 0 _1 0$~#

Try it online!
Because J's shape operator $ fills cyclically, when we shape it to the length # of the input, it does exactly what we want, and we can just add it to the input ]

You can save a byte by dropping the first ] (ie use a hook)

@Tikkanz nice catch.  i've updated the post.

Haskell, 26 bytes
@Mego beat me to this solution
zipWith(+)$cycle[1,0,-1,0]

Try it online!
This is what Haskell is great at.  This declares a point-free function that zips the input with an infinite list.
Haskell, 56 bytes
Here's a solution that uses complex numbers.  Not very competitive because of the import but never the less pretty cool.
import Data.Complex
zipWith((+).realPart.((0:+1)^))[0..]

Try it online!

Eek! You ninja'd me by 20 seconds!

C++, 93 85 83 63 bytes
auto w=[](auto&i){for(int j=0;j<i.size();j+=2)i[j]+=j%4?-1:1;};

-8 bytes, thanks to this answer, i discovered that lambda parameters can be auto and you can pass with the correct parameter, it will work
-2 bytes thanks to Nevay
-2 bytes thanks to Zacharý
I removed the vector include. You will need to pass as argument to w a container that respect the following conditions :

Have a method called size with no arguments
Have overloaded the subscript operator

STL Containers that respect the following conditions are array, vector, string, map, unordered_map, and maybe others
If outputting by modifying arguments arguments is not allowed, then :
C++, 112 110 bytes
#include<vector>
std::vector<int>w(std::vector<int>i){for(int j=0;j<i.size();j+=2)i[j]+=(j%4)?-1:1;return i;}

Your first one is valid i/o.

You can use j%4 to save 2 bytes.

I don't think you need parens around j%4.

Mathematica, 19 bytes
i=1;#+Im[i*=I]&/@#&

Explanation
i=1;#+Im[i*=I]&/@#&
i=1;                 (* set variable i to 1 *)
               /@#   (* iterate through the input: *)
    #+Im[i   ]&      (* add the imaginary component of i... *)
          *=I        (* multiplying i by the imaginary unit each iteration *)

Note: i=1 appears outside of the function, which is okay per this meta consensus.

But then the function is not necessarily reusable (if after one call of the function i has value different from 1)

@user202729 the meta consensus I linked specifically deals with that issue. It is okay to declare a global variable outside of a function.

Pari/GP, 30 bytes
a->[a[x]+imag(I^x)|x<-[1..#a]]

Try it online!

Japt, 11 10 bytes
Takes advantage of Japt's index wrapping.
Ë+[1TJT]gE

Test it

Explanation
Implicit input of array U.
Ë

Map over the array.
+

To the current element add...
gE

The element at the current index (E)...
[1TJT]

In the array [1,0,-1,0].

Dyalog APL, 13 bytes
⊢+1 0 ¯1 0⍴⍨≢

Try it online!
How?
1 0 ¯1 0 - the array [1, 0, -1, 0]
⍴⍨≢ - reshape to the length of the input, cyclic
⊢+ - vectorized sum with the input

Ruby, 38 bytes
->a{a.zip([1,0,-1,0].cycle).map &:sum}

Try it online!

Perl 6, 28 22 bytes
{((1+0i,×i...)Z+$_)».re}
(*Z-(i*i,*i...*))».re

Try it online!
i*i, *i ... * produces an infinite list of the numbers -1, -i, 1, i repeateded in a cycle.  Those numbers are zipped with subtraction (Z-) with the input list (*), and then the real components of the resulting complex numbers are extracted (».re).

D, 56 bytes
void w(T)(T[]i){for(T j;j<i.length;j+=2)i[j]+=j%4?-1:1;}

Try it online!
This is a port of HatsuPointerKun's C++ answer, so don't forget about them!

C# (.NET Core), 50 bytes
n=>{for(int i=0;i<n.Length;i+=2)n[i]+=i%4<1?1:-1;}

Try it online!
Uses a simple lambda. Modifies the original array and returns the output through reference.

05AB1E, 16 bytes
vy3L2.SR0¸«Nè+})

Try it online!

3L2.SR0¸« is the shortest thing I can think of for sin(x % 4) in 05AB1E.

Actually, 11 bytes
;r⌠╦½*C≈⌡M¥

Try it online! (runs all test cases)
Explanation:
;r⌠╦½*C≈⌡M¥
;r           range(len(input))
  ⌠╦½*C≈⌡M   for each value in range:
   ╦½*C      cos(pi/2*value)
       ≈     floor to integer
          ¥  pairwise addition of the input and the new list

Pyth, 11 bytes
.e+bss^.j)k

Try it online!

Came up with another solution with the same byte count: .e+b@[1Z_1Z

Replace ss with e for -1.

Does that work? .e+be^.j)k didn't seem to work when I tried it.

CJam, 15 bytes
l~_,,[1TW0]f=.+

Try it online!

8th, 96 63 bytes
Code
a:new swap ( swap 90 * deg>rad n:cos int + a:push ) a:each drop

This code leaves resulting array on TOS
Usage and examples
ok> [0,0,0,0,0] a:new swap ( swap 90 n:* deg>rad n:cos n:int n:+ a:push ) a:each drop .
[1,0,-1,0,1]

ok> [-4,3,0,1,7,9,8,-2,11,-88] a:new swap ( swap 90 * deg>rad n:cos int + a:push ) a:each drop .
[-3,3,-1,1,8,9,7,-2,12,-88]

Explanation
We use cos(x) in order get the right sequence [1,0,-1,0]. Each array element's index is multiplied by 90 degrees and then it is passed to cos() function to get the desired "wave factor" to be added to the corresponding item.
: f \ a -- a
  a:new    \ create output array
  swap     \ put input array on TOS
  \ array element's index is passed to cos in order to compute
  \ the "wave factor" to add to each item
  ( swap 90 n:* deg>rad n:cos n:int n:+
  a:push ) \ push new item into output array
  a:each
  drop     \ get rid of input array and leave ouput array on TOS
;

Math.JS, 34 bytes
f(k)=k.map(j(x,y,z)=x+im(i^y[1]))

Explained
f(k)=k.map(j(x,y,z)=x+im(i^y[1]))
f(k)=                               # Define a function f, which takes argument k.
     k.map(                     )   # Map k to a function
           j(x,y,z)=                # Function j. Takes arguments x, y, and z. Where x is the item, y is the index in the form [i], and z is the original list.
                      im(      )    # The imaginary component of...
                         i^y[1]     # i to the power of the index.
                    x+              # x +, which gives our wave.

Try it Online!

Arturo, 33 bytes
$=>[i:0map&=>[&-((i%4)-1)%2'i+1]]

Try it
Port of ETHproductions' JavaScript answer.

Pyt, 9 bytes
ĐŁřπ*₂šƖ+

Try it online!
Đ            implicit input; Đuplicate
 Ł           get Łength
  ř          řangify
   π*₂       multiply by pi/2
      š      take šin
       Ɩ     cast to Ɩnteger
        +    add the two arrays element-wise

Zsh, 34 bytes
for i;echo $[++j%2*(j%4>2?-1:1)+i]

Try it online!

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


text:
Is it a Sphenic Number?
A Sphenic Number is a number that is the product of exactly three distinct primes. The first few Sphenic numbers are 30, 42, 66, 70, 78, 102, 105, 110, 114. This is sequence A007304 in the OEIS.
Your Task:
Write a program or function to determine whether an inputted integer is a Sphenic number.
Input:
An integer between 0 and 10^9, which may or may not be a Sphenic Number.
Output:
A truthy/falsy value indicating whether the input is a Sphenic Number.
Examples:
30  -> true
121 -> false
231 -> true
154 -> true
4   -> false
402 -> true
79  -> false
0   -> false
60  -> false
64  -> false
8   -> false
210 -> false

Scoring:
This is code-golf, shortest code in bytes wins.

Is 60 a sphenic number? 2 × 2 × 3 × 5

@EriktheOutgolfer that's not the product of 3 distinct primes though, that's the product of 3 distinct and 1 duplicate prime.

@Riker I'm not really sure if "3 distinct primes" means "3 primes that are all distinct" or "when uniquified there should remain 3 primes". EDIT: Oh I see, 60 isn't a sphenic number. (waiting for OP clarification)

@EriktheOutgolfer According to the definition of sphenic numbers, 60 is not one of them.  I do not know however if 60 is valid for this challenge.

@WheatWizard, 60 is not a sphenic number (e.g. output/return falsy).

Can we output a falsy value if the input is sphenic and a truthy value if not?

@No, sorry.  Strictly Sphenic=truthy.

You should add a test case with 4 or more prime factors like 210

Related

Brachylog, 6 3 bytes
ḋ≠Ṫ

Try it online!
Explanation
ḋ        The prime factorization of the Input…
 ≠       …is a list of distinct elements…
  Ṫ      …and there are 3 elements

And then there's the one language which has a builtin like ≠.

And the builtin Ṫ as well.

@Zacharý Ṫ is not really a built-in predicate though; it is a built-in variable: a list of 3 variable elements. It's a fairly useful pre-constrained variable in many different challenges.

Congratulations on the shortest answer.

bash, 43 bytes
factor $1|awk '{print $2-$3&&$3-$4&&NF==4}'

Try it online!
Input via command line argument, outputs 0 or 1 to stdout.
Fairly self-explanatory; parses the output of factor to check that the first and second factors are different, the second and third are different (they're in sorted order, so this is sufficient), and there are four fields (the input number and the three factors).

You can remove the  $1 because factor will take input from stdin if none is given on the command-line

MATL, 7 bytes
_YF7BX=

Try it online! Or verify all test cases.
Explanation
_YF   % Implicit input. Nonzero exponents of prime-factor decomposition
7     % Push 7
B     % Convert to binary: gives [1 1 1]
X=    % Is equal? Implicit display

@Suever I was thinking about that, but then falsy ouput becomes uglier (either empty with error or an array with some zeros). Not sure if I should...

X= is the saddest builtin I've ever seen.

C, 88 78 126 58 77 73 + 4 (lm) = 77 bytes
l,j;a(i){for(l=1,j=0;l++<i;fmod(1.*i/l,l)?i%l?:(i/=l,j++):(j=9));l=i==1&&j==3;}

Ungolfed commented explanation:
look, div; //K&R style variable declaration. Useful. Mmm.

a ( num ) { // K&R style function and argument definitions.

  for (
    look = 1, div = 0; // initiate the loop variables.
    look++ < num;) // do this for every number less than the argument:

      if (fmod(1.0 * num / look, look))
      // if num/look can't be divided by look:

        if( !(num % look) ) // if num can divide look
          num /= look, div++; // divide num by look, increment dividers
      else div = 9;
      // if num/look can still divide look
      // then the number's dividers aren't unique.
      // increment dividers number by a lot to return false.

  // l=j==3;
  // if the function has no return statement, most CPUs return the value
  // in the register that holds the last assignment. This is equivalent to this:
  return (div == 3);
  // this function return true if the unique divider count is 3
}

Try it online!

Consider i*1.0/l instead of the cast to float. (And since l,j are global they are initialized to 0 for free, you don't need to do that if the function is only called once.  Not sure what the rule is for that.)

76 bytes

Jelly, 8 bytes
ÆEḟ0⁼7B¤

Try it online!
Uses Luis Mendo's algorithm.
Explanation:
ÆEḟ0⁼7B¤
ÆE       Prime factor exponents
  ḟ0     Remove every 0
    ⁼7B¤ Equal to 7 in base 2?

CJam, 11 bytes
rimFz1=7Yb=

Try it online! Or verify all test cases.
Explanation
Based on my MATL answer.
ri    e# Read integer
mF    e# Factorization with exponents. Gives a list of [factor exponent] lists
z     e# Zip into a list of factors and a list of exponents
1=    e# Get second element: list of exponents
7     e# Push 7
Yb    e# Convert to binary: gives list [1 1 1]
=     e# Are the two lists equal? Implicitly display

Jelly, 6 bytes
ÆE²S=3

Try it online!
How it works
ÆE²S=3  Main link. Argument: n

ÆE      Compute the exponents of n's prime factorization.
  ²     Take their squares.
   S    Take the sum.
    =3  Test the result for equality with 3.

05AB1E, 7 5 bytes
ÓnO3Q

Try it online!
Uses Dennis's algorithm.

3Q can be Í (pop a, push a-2) since only $1$ is truthy.

Ruby, 81 49 46 bytes
Includes 6 bytes for command line options -rprime.
->n{n.prime_division.map(&:last)==[1]*3}

Try it online!

Husk, 6 bytes
≡ḋ3Ẋ≠p

Try it online!
Returns 1 for sphenic numbers and 0 otherwise.
Explanation
≡ḋ3Ẋ≠p    Example input: 30
     p    Prime factors: [2,3,5]
   Ẋ≠     List of absolute differences: [1,2]
≡         Is it congruent to...       ?
 ḋ3           the binary digits of 3: [1,1]

In the last passage, congruence between two lists means having the same length and the same distribution of truthy/falsy values. In this case we are checking that our result is composed by two truthy (i.e. non-zero) values.

Mathematica, 31 bytes
SquareFreeQ@#&&PrimeOmega@#==3&

Since you're already testing for squarefree-ness, PrimeNu will do just as well as PrimeOmega, and is shorter.

Pyth, 9 bytes
&{IPQq3lP

Try it here.

Actually, 7 bytes
w♂N13α=

Try it online!
Explanation:
w♂N13α=
w       Push [prime, exponent] factor pairs
 ♂N     Map "take last element"
   1    Push 1
    3   Push 3
     α  Repeat
      = Equal?

Haskell, 59 bytes
f x=7==sum[6*0^(mod(div x a)a+mod x a)+0^mod x a|a<-[2..x]]

Try it online!

Japt, 14 bytes
k
k@è¥X ÉÃl ¥3

Try it online!

@Oliver That would result in passing a function to Number.k(), which would have no effect and just check if the input has 3 prime factors, not 3 distinct prime factors. That would mean 8 (with three prime factors: 2, 2, 2) would pass despite not being in A007304

Ah, you're right. I was just going by the test cases.

@Oliver Yeah, that really threw me for a loop when working on this solution. I just added 8 to the test cases for that reason.

J, 15 bytes
7&(=2#.~:@q:)~*

Try it online!
Explanation
7&(=2#.~:@q:)~*  Input: integer n
              *  Sign(n)
7&(         )~   Execute this Sign(n) times on n
                 If Sign(n) = 0, this returns 0
          q:       Prime factors of n
       ~:@         Nub sieve of prime factors
    2#.            Convert from base 2
   =               Test if equal to 7

Very nice use of ~: and #.  An alternative could be (7&(=#.@~:@q:)~*) which I find a little easier to read, but is no shorter.

Dyalog APL, 26 bytes
⎕CY'dfns'
((≢,∪)≡3,⊢)3pco⎕

Try it online!

Mathematica, 44 bytes
Plus@@Last/@#==Length@#==3&@FactorInteger@#&

Try it online!

Python 3, 54 53 bytes
lambda n:sum(1>>n%k|7>>k*k%n*3for k in range(2,n))==6

Thanks to @xnor for golfing off 1 byte!
Try it online!

You can check squarefreeness with k*k%n rather than n%k**2

Right, I only need one failure. Thanks!

C, 91 102 bytes, corrected (again), golfed, and tested for real this time:
<strike>s(c){p,f,d;for(p=2,f=d=0;p<c&&!d;){if(c%p==0){c/=p;++f;if(c%p==0)d=1;}++p;}c==p&&f==2&&!d;}</strike>
s(c){int p,f,d;for(p=2,f=d=0;p<c&&!d;){if(c%p==0){c/=p;++f;if(c%p==0)d=1;}++p;}return c==p&&f==2&&!d;}

/* This also works in 93 bytes, but since I forgot about the standard rules barring default int type on dynamic variables, and about the not allowing implicit return values without assignments, I'm not going to take it:
p,f,d;s(c){for(p=2,f=d=0;p<c&&!d;){if(c%p==0){c/=p;++f;if(c%p==0)d=1;}++p;}p=c==p&&f==2&&!d;}

(Who said I knew anything about C? ;-)
Here's the test frame with shell script in comments:
/* betseg's program for sphenic numbers from
*/
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h> /* compile with -lm */

/* l,j;a(i){for(l=1,j=0;l<i;i%++l?:(i/=l,j++));l=i==1&&j==3;} */
#if defined GOLFED
l,j;a(i){for(l=1,j=0;l++<i;fmod((float)i/l,l)?i%l?:(i/=l,j++):(j=9));l=i==1&&j==3;}
#else
int looker, jcount;
int a( intval ) {
  for( looker = 1, jcount = 0;
    looker++ < intval;
    /* Watch odd intvals and even lookers, as well. */
    fmod( (float)intval/looker, looker )
      ? intval % looker /* remainder? */
        ? 0 /* dummy value */
        : ( inval /= looker, jcount++ /* reduce the parameter, count factors */ )
      : ( jcount = 9 /* kill the count */ )
  )
    /* empty loop */;
  looker = intval == 1 && jcount == 3; /* reusue looker for implicit return value */
}
#endif

/* for (( i=0; $i < 100; i = $i + 1 )) ; do echo -n at $i; ./sphenic $i ; done */

I borrowed betseg's previous answer to get to my version.
This is my version of betseg's algorithm, which I golfed to get to my solution:
/* betseg's repaired program for sphenic numbers
*/
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>

int sphenic( int candidate )
{
  int probe, found, dups;
  for( probe = 2, found = dups = 0; probe < candidate && !dups; /* empty update */ )
  {
    int remainder = candidate % probe;
    if ( remainder == 0 )
    {
      candidate /= probe;
      ++found;
      if ( ( candidate % probe ) == 0 )
        dups = 1;
    }
    ++probe;
  }
  return ( candidate == probe ) && ( found == 2 ) && !dups;
}

int main( int argc, char * argv[] ) { /* Make it command-line callable: */
  int parameter;
  if ( ( argc > 1 )
       && ( ( parameter = (int) strtoul( argv[ 1 ], NULL, 0 ) ) < ULONG_MAX ) ) {
    puts( sphenic( parameter ) ? "true" : "false" );
  }
  return EXIT_SUCCESS;
}

/* for (( i=0; $i < 100; i = $i + 1 )) ; do echo -n at $i; ./sphenic $i ; done */

Does it answer the question, now?

Yes, it does. Insert this to link to betseg's answer: [betseg's answer](https://codegolf.stackexchange.com/a/135203/65836). You can also click edit on his answer to suggest an edit to it, if you want, that would include the explanation - no promises on whether it'll be approved or not.

I'm here now, and I fixed my program, it's at 87 bytes now; but your program looks good too.

@betseg Interesting that you used floating point this time. Oh, and thanks for letting me borrow your algorithm. ;-)

@JoelRees i added explanation to my answer, also your answer has a problem i think? it doesn't seem to work correctly: Try It Online

reason of floats: 105 = 357, but 105/2%2 = 0.5, which C interprets as 0.

@betseg I think I called the working uncompressed version and missed the errors mixed with the warnings. (Want to blame it on my pre-C89 compiler, but that's on the other side of the ocean. :-/) I'll fix my code and my count. Nice test rig you have.

J, 23 bytes
0:`((~.-:]*.3=#)@q:)@.*

Try it online!
Handling 8 and 0 basically ruined this one...
q: gives you all the prime factors, but doesn't handle 0.  the rest of it just says "the unique factors should equal the factors" and "the number of them should be 3"

This fails for input 60

@ConorO'Brien thanks.  See my edit -- fixing 60 helped, but i realized i also wasn't handling 0 correctly, and handling that more than doubles the bytes

The last one was my original idea, and that fails for 8.

I have (6=]#@,~.)@q: as a possible solution

@ConorO'Brien ah good point about 8.  yours will fail for 0, though.

@ConorO'Brien well, i fixed all the edge cases, it can hardly be considered golf anymore... sigh.

(6=]#@,~.)@(0:`q:@.*) for 21

@ConorO'Brien, nice.  (6=]#@,~.) is some clever exploitation of the parsing rules.

JavaScript (ES6), 80 bytes
n=>(p=(n,f=2)=>n%f?p(n,f+1):f,(a=p(n))<n&&(b=p(n/=a))<n&&(c=p(n/=b))==n&a<b&b<c)

Using a recursive function to get the smaller factor.
Output 1 if sphenic, false if there are 2 or less factors and 0 otherwise
Test

F=
n=>(p=(n,f=2)=>n%f?p(n,f+1):f,(a=p(n))<n&&(b=p(n/=a))<n&&(c=p(n/=b))==n&a<b&b<c)

;[30,121,231,154,4,402,79,0,60,64,8,210].forEach(
  x=>console.log(x,F(x))
)

Dyalog APL, 51 49 48 46 45 43 bytes
1∊((w=×/)∧⊢≡∪)¨(⊢∘.,∘.,⍨){⍵/⍨2=≢∪⍵∨⍳⍵}¨⍳w←⎕

Try it online! (modified so it can run on TryAPL)
I wanted to submit one that doesn't rely on the dfns namespace whatsoever, even if it is long.

VB.NET (.NET 4.5), 104 bytes
Function A(n)
For i=2To n
If n Mod i=0Then
A+=1
n\=i
End If
If n Mod i=0Then A=4
Next
A=A=3
End Function

I'm using the feature of VB where the function name is also a variable. At the end of execution, since there is no return statement, it will instead pass the value of the 'function'.
The last A=A=3 can be thought of return (A == 3) in C-based languages.
Starts at 2, and pulls primes off iteratively. Since I'm starting with the smallest primes, it can't be divided by a composite number.
Will try a second time to divide by the same prime. If it is (such as how 60 is divided twice by 2), it will set the count of primes to 4 (above the max allowed for a sphenic number).
Try It Online!

-2 bytes by using n\i=n/i instead of n Mod i=0. But is it fair to put Dim i as integer in the header when it's required for the function to work? Function A(n%) costs +1 byte. But if external Dim statements are allowed, then -7 bytes by pseudo-boolean arithmetic.

@Deadcode When I was writing it in Visual Studio, I didn't need to Dim i at all; I could use it directly in the loop. Putting it in the header was just to get the Mono implementation that Try It Online was using to compile.
The shortening for Mod looks awesome though. I'll be sure to add that in!

Python 2, 135 121 bytes

Quite long since this includes all the procedures: prime-check, obtain-prime factors and check sphere number condition.

lambda x:(lambda t:len(t)>2and t[0]*t[1]*t[2]==x)([i for i in range(2,x)if x%i<1and i>1and all(i%j for j in range(2,i))])

Try it online!

Python 2, 59 bytes
lambda x:6==sum(5*(x/a%a+x%a<1)+(x%a<1)for a in range(2,x))

Try it online!

This gives false positives like 48. I had been trying the same thing.

@xnor Fixed, but at the cost of bytes.

Javascript (ES6), 87 bytes
n=>(a=(p=i=>i>n?[]:n%i?p(i+1):[i,...p(i,n/=i)])(2)).length==3&&a.every((n,i)=>n^a[i+1])

Example code snippet:

f=
n=>(a=(p=i=>i>n?[]:n%i?p(i+1):[i,...p(i,n/=i)])(2)).length==3&&a.every((n,i)=>n^a[i+1])

for(k=0;k<10;k++){
  v=[30,121,231,154,4,402,79,0,60,64][k]
  console.log(`f(${v}) = ${f(v)}`)
}

PHP, 66 bytes:
for($p=($n=$a=$argn)**3;--$n;)$a%$n?:$p/=$n+!++$c;echo$c==7&$p==1;

Run as pipe with -nR or try it online.
Infinite loop for 0; insert $n&& before --$n to fix.
breakdown
for($p=($n=$a=$argn)**3;    # $p = argument**3
    --$n;)                  # loop $n from argument-1
    $a%$n?:                     # if $n divides argument
        $p/=$n                      # then divide $p by $n
        +!++$c;                     # and increment divisor count
echo$c==7&$p==1;            # if divisor count is 7 and $p is 1, argument is sphenic

example
argument = 30:
prime factors are 2, 3 and 5
other divisors are 1, 2*3=6, 2*5=10 and 3*5=15
their product: 1*2*3*5*6*10*15 is 27000 == 30**3

J, 15 14 19 bytes
Previous attempt: 3&(=#@~.@q:)~*
Current version: (*/*3=#)@~:@q: ::0:
How it works:
(*/*3=#)@~:@q: ::0:  Input: integer n
               ::0:  n=0 creates domain error in q:, error catch returns 0
            q:       Prime factors of n
         ~:@         Nub sieve of prime factors 1 for first occurrence 0 for second
(*/*3=#)@            Number of prime factors is equal to 3, times the product across the nub sieve (product is 0 if there is a repeated factor or number of factors is not 3)

This passes for cases 0, 8 and 60 which the previous version didn't.

why not 3=#~.q:     for 7characters? From a J session  3=#~.q: 30 ==> 1     and 3=#~.q: 20 ==> 0

Richard, your suggestion gives a false positive for n=60 and creates a domain error for n=0, but my previous version failed for n=60 as well. Your comment prompted me to strive for a correct solution!

Regex (ECMAScript), 46 bytes
^((?=(xx+?)\2*$)(?=(x+)(\3+$))\4(?!\2+$)){3}x$

Try it online!
This works similarly to Match strings whose length is a fourth power and very similarly to part of Is this a consecutive-prime/constant-exponent number:
^
(                   # Loop the following:
    (?=(xx+?)\2*$)  # \2 = smallest prime factor of tail
    (?=
        (x+)(\3+$)  # \3 = tail / {smallest prime factor of tail}; \4 = tool to make tail = \3
    )\4             # tail = \3
    (?!\2+$)        # assert that tail is no longer divisible by \2
){3}                # Execute the loop exactly 3 times
x$                  # assert tail == 1

Thunno 2, 9 bytes
Ƒsfç⁼lp3=

Attempt This Online!
Explanation:
Ƒ          # unique prime factors
 s         # swap so input is back on top
  f        # prime factors
   ç       # apply each to the stack, and wrap results:
    ⁼      #   exactly equal?
     l     #   length
      p    # product
       3=  # equal to 3?

Vyxal, 8 bytes
ǐ₌ÞuL*3=

Try it Online!
Seems Vyxal always beats Thunno 2 by just a byte or two...this is basically the same as my Thunno 2 answer.

Desmos, 96 bytes
f(k)=0^{(3-∑_{n=2}^k0^{mod(k,n)}sgn(∏_{d=3}^nmod(n,d-1))log_n(gcd(k,n^{ceil(log_nk)}))^2)^2}

Try It On Desmos!
Try It On Desmos! - Prettified
Port of Dennis's Jelly answer so make sure to upvote that one too. There is probably a shorter way to go about this though, but this is the most straightforward way I saw that could easily be ported to Desmos.
I might put a longer explanation on how this works if I have time.

Arturo, 43 bytes
$=>[x∧3=size x:=unique<=<=factors.prime&]

Try it!
Simply asks "are its prime factors unique and are there three?"

Forth, 153
: w swap ;
: d 2dup ;
: o rot ;
: sp 0 w 1
begin 1+ d mod 0= if w over / w d mod 0= if o 16 + o o then o 1+ o o then
d > 0= until drop 1 = w 3 = and ;

( 153 including spaces. Spaces are required delimiters in Forth. )
( Test frame for compressed version: )
: testsp
  0 do i 8 .r space
    i sp if ." true" else ." false" then
    cr
  loop
;

( This uses a corrected version of betseg's answer.)
( Uncompressed, with comments: )
: sphenic ( n -- f )
  0 ( counter )
  swap 1 ( counter n probe )
  begin
    1+ ( increment probe )
    2dup mod ( Remainder? )
    0= if
      swap over / ( reduced-n )
      swap ( bring probe back )
      2dup mod 0= if
        rot 128 + rot rot
      then
      rot 1+ rot rot ( count and put count back )
    then ( counter reduced-n probe )
    2dup > 0=
  until
  drop 1 =
  swap 3 = and
;

: testsphenic
  0 do i 8 .r space
    i sphenic if ." true" else ." false" then
    cr
  loop
;

C#, 172 Bytes
I'd appreciate improvement suggestions:
n=>{var r=Enumerable.Range(2,n).Where(i=>Enumerable.Range(2,i-2).All(a=>i%a!=0));return r.SelectMany(x=>r.SelectMany(y=>r.Select(z=>x==z|x==y|y==z?-1:x*y*z))).Contains(n);}

With formatting:
n =>
{
    var r = Enumerable.Range (2, n).Where (i => Enumerable.Range (2, i - 2).All (a => i % a != 0));
    return r.SelectMany (
        x => r.SelectMany (
            y => r.Select (z => x == z | x == y | y == z ? -1 : x * y * z))).Contains (n);
}

And as whole programm:
using System;
using System.Linq;

namespace S
{
    class P
    {
        static void Main ()
        {
            Func<int, bool> s =
                    n =>
                    {
                        var r = Enumerable.Range (2, n).Where (i => Enumerable.Range (2, i - 2).All (a => i % a != 0));
                        return r.SelectMany (
                            x => r.SelectMany (
                                y => r.Select (z => x == z | x == y | y == z ? -1 : x * y * z))).Contains (n);
                    }
                ;

            for (var i = 0; i < 1000; i++)
                if (s (i))
                    Console.WriteLine (i);
            Console.ReadLine ();
        }
    }
}

If you add the byte count of the using directives (which are needed for the code to compile), you'd get 203 Bytes.
Try it online!

Would you be to make a function with a single letter name for Enumerable.Range(2, m)? You call it twice, and it might save some bytes.

@BrianJ The idea doesn't sound bad, but I don't know how I'd do it. Is it possible to define methods inside of statement lambdas?

You can, but I forgot how verbose it becomes. Quick and dirty, I got Func<int, IEnumerable<int>> e = a => { return Enumerable.Range(2, a); };, plus another using.

C#7 122 bytes
bool F(int n){int P(int m,int f=2)=>m%f>0?P(m,f+1):f;int a,b,c;return(a=P(n))<n&&(b=P(n/=a))<n&&(c=P(n/=b))==n&a<b&b<c;}

porting of my JS answer

Perl 6, 43 bytes
{3==grep ->\a{a.is-prime&&$_%%(a^a*a)},^$_}

Try it online!
The grep produces a list of the numbers a up to, but not including, the argument to the function $_, such that:

a is prime (a.is-prime); and
exactly one of a and a*a (a ^ a*a) divide the argument.

The latter condition excludes prime factors that occur in multiplicities of higher than one.

Mathematica, 66 57 bytes
Length@#1==3&&And@@EqualTo[1]/@#2&@@(FactorInteger@#)&

Defines an anonymous function.
 is Transpose.
Explanation
FactorInteger gives a list of pairs of factors and their exponents. E.g. FactorInteger[2250]=={{2,1},{3,2},{5,3}}. This is transposed for ease of use and fed to the function Length@#1==3&&And@@EqualTo[1]/@#2&. The first part, Length@#1==3, checks that there are 3 unique factors, while the second, And@@EqualTo[1]/@#2 checks that all the exponents are 1.

Python 99 bytes
def s(n):a,k=2,0;exec('k+=1-bool(n%a)\nwhile not n%a:n/=a;k+=10**9\na+=1\n'*n);return k==3*10**9+3

First submission. Forgive me if I did something wrong.
Kinda silly, counts the number of factors of n, and then the number of times n is divisible by each (by adding 10**9).
I'm pretty sure there are a few easy ways to cut off ~10-20 characters, but I didn't.
Also this is intractably slow at 10**9. Could be made okay by changing '...a+=1\n'*n to '...a+=1\n'*n**.5, as we only need to go to the square root of n.

Pari/GP, 34 bytes
n->if(n,moebius(n)*omega(n)==-3,0)

Try it online!


text:
Create a binary wall
Given an array of positive integers in base 10, where n > 0, output their representation of a binary wall.
How does this work?

Convert each number to its binary representation.
Pad the representation with leading zeroes to the length of the longest one i.e. 1, 2 -> 1, 10 -> 01, 10.
Create a wall where the 1s are bricks and 0s are missing bricks.

A wall is a block of characters where any printable character represents a brick and a space (ASCII decimal code 32) represents a missing brick. You may choose any character for the brick, it need not be distinct across the wall as long as it isn't a white space character. The missing brick character must be a space. For the example below I have used * for the bricks.
Example
Input:
[ 15, 7, 13, 11 ]

[ 1111, 111, 1101, 1011 ]

[ 1111, 0111, 1101, 1011 ]

Output:
****
 ***
** *
* **

Rules

Input must be taken in base 10, if your language accepts other bases you may not use them.
Leading and trailing new lines are allowed.
Input may be taken as a list of integers, separate arguments or any reasonable format.
Output may be in any reasonable format: new line separated string, array of lines, 2d array etc.
Standard loopholes are disallowed.

Test Cases
Note that in the first test case all of layers have an empty brick at the end.
[ 14, 4, 6, 2 ]

***
 *
 **
  *

[ 1, 2, 4, 8, 16 ]

    *
   *
  *
 *
*

[ 15, 11, 15, 15 ]

****
* **
****
****

[ 11, 10, 9, 8 ]

* **
* *
*  *
*

This is code golf so shortest code wins!

Can the output be an array of lines or a 2d array of chars?

@ovs Sorry thought I'd specified that, yes you can output an array or 2d array etc. Any reasonable format.

In the case of a 2D array, can we use numbers for the bricks instead of characters? e.g. [[1, " ", 1, " "], ...]

@Arnauld Yeah that seems fine.

trailing whitespace is allowed?

@Giuseppe New lines only, otherwise it will be confused for empty bricks.

may not, not cannot :P

What's with the rule about base 10? It's all an int internally anyway, regardless if you parse the number in base 10 or base 2 or base 16… What's the point of this rule?

@therealfarfetchd One of the steps is to convert to base 2, it would be pretty pointless if you already took input in base 2...

What would be different with for example in Java: Integer.parseInt("14", 10) and Integer.parseInt("E", 16)? They all yield int(14). But now I'm thinking you're thinking of not parsing the number at all, in which case, the rule makes sense. But then, again, when not parsing the number you don't have "an array of positive integers", but an array of strings. That probably just threw me off. I think I get it now though.

MATL, 5 bytes
B42*c

Try it online!
Explanation
B     % Implicitly input an array of numbers. Convert to binary.
      % Gives a matrix with each row corresponding to a number
42    % Push 42 (ASCII code of '*')
*     % Multiply
c     % Convert to char. Char 0 is displayed as space. Implicitly display

You may choose any character for the brick, it need not be distinct across the wall as long as it isn't a white space character. yeah that means you probably don't need 42* or something...

@EriktheOutgolfer I could choose any other number, but I do need those three bytes I think.

What if there's a 1-byte builtin for 100 or some other number?

J, 8 bytes
' *'{~#:

Try it online!
Explanation
' *'{~#:  Input: array of integers
      #:  Convert each to binary with left-padding
' *'{~    Use the digits to index into the string ' *'

Oh, so #: is why this beats Jelly.

Jelly, 9 bytes
Bo⁶Uz⁶ZUY

Try it online!
EDIT: HOW J BEAT JELLY DAT IMPOSSIBLE >_<

Octave, 22 bytes
@(x)[dec2bin(x)-16,'']

Try it online
Explanation:
Saved some bytes thanks to Luis Mendo! Also, I didn't notice that I could choose which character to build the wall with, not only *.
@(x)                    % Take the input as a column vector
    dec2bin(x)          % Convert each row of the input to a string with 1 and 0
                        % It gets automatically padded with zeros, to fit the longest number
    dec2bin(x)-16       % Subtract 16, to get from the ASCII-values of 1/0 (48/49)
                        % to 32/33 (space and !)
@(x)[dec2bin(x)-16,'']  % Concatenate with the empty string to convert it to a string.

Or with de2bi:
Explanation:
@(x)                          % Take the input as a column vector
               de2bi(x)       % Convert each row of the input to a binary number.
                              % Gets automatically padded to fit the longest number
            42*de2bi(x)       % Multiply the matrix by 42, which is the ASCII-value for *
           [42*de2bi(x),'']   % Concatenate the matrix with the empty string to convert
                              % it to a string. 0 are automatically displayed as spaces
@(x)fliplr([42*de2bi(x),''])

The following works on TIO, for 7 bytes more:
@(x)fliplr([42*(dec2bin(x)>48),''])

Try it here

Python 3, 88 84 71 74 72 bytes
A lambda that returns a list of Strings, representing each line.
lambda n:[bin(x)[2:].replace(*'0 ').rjust(len(bin(max(n)))-2)for x in n]

Try it online! (link to the newline separated version)
Explanation

lambda n: - Creates an (anonymous) lambda, with a parameter n. Returns implicitly.

[...] - Creates a list comprehension.

bin(x)[2:] - Gets the binary representations of the numbers.

.replace(*'0 ') - Replaces all the occurrences of 0 with a space.

.rjust(len(bin(max(n)))-2) - Pads the binary representations to the length of the longest one.

for x in n - Iterates through n, with the variable x.

Changelog

-1 - 3 bytes thanks to @Rod, -(...)+2 = 2-(...), use of rjust()

Added a version with bin() instead, that was invalid since it didn't work for 1 and 2.

Fixed the bug above using format().

Changed return type to list of Strings, because it was allowed by the OP.

Fixed yet another bug using rjust() and switching back to bin(), spotted and fixed by @Rod.

JavaScript (ES6), 81 79 bytes
Saved 2 bytes by using numbers instead of characters for the bricks, as suggested by Rick Hitchcock
Returns a 2D array with 1's for the bricks.
f=(a,b=[],x=1)=>a.every(n=>n<x)?a.map(n=>b.map(i=>n&i?1:' ')):f(a,[x,...b],x*2)

Test cases

f=(a,b=[],x=1)=>a.every(n=>n<x)?a.map(n=>b.map(i=>n&i?1:' ')):f(a,[x,...b],x*2)

format = a => a.map(s => s.join``).join`\n`

console.log(format(f([ 14, 4, 6, 2 ])))
console.log(format(f([ 1, 2, 4, 8, 16 ])))
console.log(format(f([ 15, 11, 15, 15 ])))
console.log(format(f([ 11, 10, 9, 8 ])))

Ruby, 63 59 bytes
-4 bytes with help from Alexis Andersen
->*n{puts n.map{|i|("%#{('%b'%n.max).size}b"%i).tr'0',' '}}

Try it online!

you don't need the 0 in the string format. you could shave a byte by replacing n.max.to_s(2).size with ('%b'%n.max).size and you don't actually need to replace the 1 with *

@AlexisAndersen thanks :)

05AB1E, 9 bytes
bí.Bí»0ð‡

Try it online!

Beat me by 38 seconds. I had b0ð:í.Bí» for 9 bytes as well.

Haskell, 76 75 74 bytes
f x|all(<1)x=x>>[""]|a<-f$map(`div`2)x=zipWith(++)a$map(cycle[" ","*"]!!)x

Try it online!

R, 87 88 bytes

Wall blocks represented by an 8, because, well lots of eights.
write(ifelse((I=sapply(scan(),intToBits))[(M=max(which(I>0,T)[,1])):1,],8,' '),1,M,,'')

Try it online!
Input integer list is converted to array of bits which are trimmed of trailing 0 bits and reversed.
The reduced array is then output using write and a column width which was determined when the array was trimmed.
ifelse() is the only IF option that works on vectors unfortunately.

@Vlo pointed out you can use 1 rather than "" for the output file in write.

@Giuseppe thanks for the tip

APL (Dyalog), 30 22 20 14 bytes
Saved 6 bytes thanks to @Adám
' *'[⍉2⊥⍣¯1⊢⎕]

Try it online!
(assumes ⎕IO←0 as this is default on many machines)
This takes input as an array and returns a matrix with *s and  s.
Explanation
2⊥⍣¯1⊢⎕       Convert input to binary (returns a transposed matrix of 1s and 0s)
⍉              Transpose
' *'[ ... ]    Index into this string

Save 6 bytes with ' *'[⍉2⊥⍣¯1⊢⎕]

@Adám Thanks for the tips, I didn't know I could remove the ¨.

Python 2, 77 75 bytes
lambda k:[[' *'[i>>y&1]for y in range(len(bin(max(k)))-3,-1,-1)]for i in k]

Try it online!

PowerShell, 100 bytes
$args|%{if(($c=($a=[convert]::ToString($_,2)).length)-gt$l){$l=$c}$a-replace0,' '}|%{$_.padleft($l)}

Try it online!
Ugh, converting to binary in PowerShell is so painful. Plus .lengthy calls to -replace the 0 with spaces, plus a long .padLeft() call to make them all the same .length, all adds up to a long submission.
Golfing suggestions to get below 100 are welcome.

using:

|% Le* instead of .length
|% *ce 0 ' ' instead of -replace0,' '
|% *ft $linstead of .padleft($l)

Try it online!

T-SQL, 290 bytes
declare @ int;select @=max(log(a,2))+1from @i;with t as(select convert(varchar(max),a%2)b,a/2c,@-1m,ROW_NUMBER()over(order by(select 1))r from @i union all select convert(varchar(max),concat(c%2,b))b,c/2c,m-1,r from t where m>0)select replace(b,0,' ')from t where m=0group by r,b order by r

Uses 1 for the brick piece, assumes input comes from table @
Ungolfed, with some explanation
-- assume input is presented in an input table
declare @input table (a int)
insert into @input values (15), (7), (13), (11)

---- start here

-- figure out how many characters are needed, by taking log2
declare @max int
select @max = max(log(a, 2)) + 1
from @input

-- recursive cte
-- will join against itself, recursively finding each digit in the binary string
;with cte as
(
    select
        convert(varchar(max), a % 2) as b, -- is the least significant bit 1 or 0
        a / 2 as c, -- remove least significant bit, for the next run
        @max - 1 as max, -- keep track of iterations left
        ROW_NUMBER() over (order by (select 1)) as rn -- keep the order of the input
    from @input

    union all -- recursive loop
              -- below columns follow the same pattern

    select convert(varchar(max),
        concat(cte.c % 2, cte.b)) as b, -- prepend the current binary string with the newest least significant bit
        cte.c / 2 as c,
        cte.max - 1,
        cte.rn
    from cte
    where cte.max > 0
)
select replace(b, 0, ' ') -- swap 0s for space
from cte
where max = 0 -- only take the last iteration
group by rn, b -- grab each unique input,
               -- need to group by row number so it can be ordered by
               -- need to group by binary string, so it can be selected
order by rn -- sort by the order the input arrived in

Mathematica, 40 bytes
Grid@PadLeft@IntegerDigits[#,2]/. 0->""&

Bricks are 1s
Mathematica, 48 bytes
Grid@PadLeft@IntegerDigits[#,2]/.{0->"",1->"#"}&

Bricks are #

You should only need one slash in the //.. (/. means "replace once", //. means "keep doing the replacement until the thing stops changing".)

You don't need the space after the comma in the IntegerDigits function.

yes,I know,this happens when you copy/paste from notebook.fixed

PHP, 84 bytes
while(++$i<$argc)echo strtr(sprintf("\n%".-~log(max($argv),2).b,$argv[$i]),10,"* ");

Luckily, the bit operation casts the log result to int. float wouldn´t work here.
Try it online.

error_reporting(~E_ALL & ~E_NOTICE); is better, and php8 can't work, maybe should add version in title.

C# (.NET Core), 112+18=130 86+41=127 bytes
a=>a.Select(n=>C.ToString(n,2).Replace("0"," ").PadLeft(C.ToString(a.Max(),2).Length))

Try it online!
The byte count includes 41 bytes from using System.Linq;using C=System.Convert;. Uses 1 as character for the wall. Nonetheless, this is way too long even for C#...

Place in namespace System.Linq{} to save some bytes. Is a.Max() guaranteed to be true (I'm sure it is I'm just not the smartest with binary :P)? Would class Convert{} save any bytes?

If I place the program in a given namespace, shouldn't I submit the whole program instead of just a lambda? I'm not sure about the rules for that...

I've usually just placed in namespace with lambda. I don't think there's ever been a question about it and it is in the C# tips page.

I don't think this is valid, as you can't compile it without using static imports.

@MetaColon you can check the whole code in the TIO link, see that it does not use static imports, but an alias for a certain type.

@CarlosAlejo actually I meant alias using directives.

@MetaColon that's the reason why I added the bytes in using System.Linq;using C=System.Convert; to byte count, as those two using directives are needed for the code to compile.

I know I'm late, but I think saving Convert.ToString(int, int) to a lambda might make this shorter. e.g. var b = (int n) => System.Convert.ToString(n, 2);, making the using unnecassry and letting you do: a=>a.Select(n=>b(n).Replace("0"," ").PadLeft(b(a.Max(),2).Length))

Retina, 63 bytes
.+
$*#<
+`(#+)\1
$1
 #
#
{T`<`_`^(<.+(¶|$))+$
m`^<
 <
(.)<
<$1

Try it online! Explanation:
.+
$*#<

Convert to unary, and suffix a <.
+`(#+)\1
$1
 #
#

Convert to binary.
{T`<`_`^(<.+(¶|$))+$

Once all the <s have reached the left, delete them all.
m`^<
 <

Insert a space before any <s that have already reached the left.
(.)<
<$1

Move all the <s left one step. Rinse and repeat.

Python 3, 92 90 bytes
lambda a:[' '*(len(bin(max(a)))-len(i)-2)+i for i in[bin(i)[2:].replace(*'0 ')for i in a]]

Try it online!
Returns a list of lines. Stacking them up shows they do indeed align properly.
['111 ', ' 1  ', ' 11 ', '  1 ']
>>>
 111
  1
  11
   1

The breakdown
Essentially converts the array to binary, then replaces all 0's with spaces. N number of spaces are added to the front of each line where N = [length of longest line] - [length of line].
-1 bytes Thanks to Mr. Xoder
Try it online!

You can't have leading or trailing spaces in the output.

@TheLethalCoder Oh, must have misread the rules! Thanks for catching that.

90 bytes, replace '0',' ' with *'0 '.

@Mr.Xcoder Ah interesting, would never have thought about that. Thanks!

Clojure, 185 bytes
(fn[i](let[b(map #(Long/toBinaryString %)i)](map #(clojure.string/replace(clojure.string/replace(format(str"%0"(reduce(fn[l i](max l(count i)))0 b)"d")(read-string %))"1""#")"0"" ")b)))

Ungolfed version:
(fn [i]
    (let [b (map #(Long/toBinaryString %) i)]
        (map
            #(clojure.string/replace
                (clojure.string/replace
                    (format
                        (str "%0"
                            (reduce
                                (fn [l i] (max l(count i))) 0 b)
                            "d")
                        (read-string %))
                        "1"
                        "#")
                "0"
                " ")
        b)))

Anonymous function that takes the argument as a list. Returns the lines as list.
Reading the other answers, I bet it could be smaller. clojure.string/replace takes an obscene amount of chars to write..

Java 7, 130 108 88 bytes
Saved 22 thanks to @TheLethalCoder
Saved 20 thanks to @Xanderhall
void a(int[]b){for(int i:b)System.out.println(Long.toBinaryString(i).replace('0',' '));}

Ungolfed:
void a(int[]b){
    for(int i:b)
        System.out.println(Long.toBinaryString(i).replace('0', ' '));
}

Post increment i at b[i] to save a byte. You can keep the output with 1's so no need for the .replace('1','*'). Use Java 8 instead and compile to a lambda to save bytes. If you don't want to do that int[]b saves a byte.

Thank you! Could you please explain what "Post increment i at b[i] to save a byte." means?

i++ evaluates i then increments it (whereas ++i does the opposite) so you can move the i++ out of the for loop and use b[i++] instead. Oh and whilst we're at it you only have one line inside your loop so the braces aren't needed.

True! Amazing, thank you

You can save a few bytes by switching your loop to a foreach loop. for(int x:i) Also, you can use Long.toBinaryString instead of the Integer version to save 3 bytes.

Great Xanderhall! Thank you :)

Might want to actually make Java 7 link to something.

Japt, 33 30 bytes
¡'0p(¡X¤lÃn o)-X¤l)+X¤)£" *"gX

Try it online!
Saved 3 bytes thanks to @Justin Mariner
Explanation
¡                              // map input integers
    (¡X¤lÃn o)                 // longest binary string length
              -X¤l)            // minus current binary string length
 '0p                           // repeat zero
                   +X¤)        // concat with current binary string
                       £       // map chars of binary string
                        " *"gX // swap 0 and 1 with ' ' and '*'

You can drop the last 3 chars to just return an array of strings, and use the -R flag (not added to byte count) to see the newline-joined output: here.

Japt, 11 bytes
m¤z3 z ·r0S

Try it online!
Explanation
m¤z3 z ·r0S  Implicit input of array
m¤           Map the array to binary strings
  z3 z       Rotate right 270° and then right 90°. This adds left padding to each string
       ·r0S  Join with newlines and replace 0s with spaces

Nice exploit with z3 z. Not sure why y y doesn't work there, I'll look into it later...

PowerShell, 98 bytes
$p=$args|%{$n=$_;31..0|?{($n-shr$_)%2}}|sort
$args|%{$n=$_;-join($p[-1]..0|%{' *'[($n-shr$_)%2]})}

Try it online!
The script uses the fact that an integer contains no more than 32 bits.
The first line calculates positions of the bits with 1. The second line renders a binary wall.

Pyth, 16 bytes
j_MC.tm_X.Bd\0\

Try it here. Mind the trailing space.

Python 2, 217 bytes
After 2 hours of coding i decided, that numpy is bad idea for this
import numpy as n
i=n.loadtxt("i")
o=[n.copy(i)]
o[0].fill(10)
while n.count_nonzero(i)>0:
 o.append(i%2+32)
 i=n.vectorize(lambda x:x//2)(i)
print n.fliplr(n.array(o).T).astype('uint8').view('c').tostring().decode()

Usage in Ubuntu
Install numpy
python2 -m pip install numpy

Create file named i with input in format 14 4 6 2
Run
python2 prog.py

Excel VBA, 170 161 Bytes
Golfed
Anonymous VBE immediate window function that that takes input of format 1 2 3 .. n from range [A1] and outputs the corresponding binary wall to the VBE Immediate window via range [B1,C1,2:2]
n=Split([A1]):[A2].Resize(1,UBound(n)+1)=n:[C1]="=Int(1+Log(B1,2))":For Each i In n:[B1]=i:?Replace(Replace([Right(Rept(0,C1)&Dec2Bin(B1),C1)],1,"*"),0," "):Next

Formatted:
n=Split([A1])
[A2].Resize(1,UBound(n)+1)=n
[C1]="=Int(1+Log(B1,2))"
For Each i In n
[B1]=i
?Replace(Replace([Right(Rept(0,C1)&Dec2Bin(B1),C1)],1,"*"),0," ")
Next

Ungolfed
Full Subroutine that takes input of format Array(1, 2, 3...) and outputs the corresponding binary wall to the VBE Immediate window via range [A1,B1,2:2]
Sub a(ByRef n As Variant)
    Let Range("A1").Resize(1,UBound(n)+1) = n
    Let Range("C1").Value = "=Int(1+Log(A1,2))"
    Dim i As Integer
    For Each i In n
        Let Range("A1").Value = i
        Debug.Print Replace(
                            Replace(
                                    [Right( Rept( 0, C1) & Dec2Bin( B1), C1)],
                                    1,
                                    "*"
                            ),
                            0,
                            " "
                    )
    Next
End Sub

8th, 232 254 250 bytes
Code
0 >r a:new swap ( nip 2 base drop >s decimal s:len r> n:max >r a:push ) a:each drop a:new swap ( nip '0 G:c# r@ G:#> s:fmt a:push ) a:each drop rdrop a:new swap ( nip /0/ " " s:replace! a:push ) a:each drop ( nip /1/ "*" s:replace! . cr ) a:each drop

Ungolfed version with comments
\ convert to binary and save longest string length
: f 0 >r a:new swap ( nip 2 base drop >s decimal s:len r> n:max >r a:push ) a:each drop ;

\ pad binary number with zero
: f1 a:new swap ( nip '0 G:c# r@ G:#> s:fmt a:push ) a:each drop rdrop ;

\ replace every 0 with space
: f2 a:new swap ( nip /0/ " " s:replace! a:push ) a:each drop ;

\ replace every 1 with * and print each line of bricks
: f3 ( nip /1/ "*" s:replace! . cr ) a:each drop ;

These words must be invoked in sequence (see example)
Usage and examples
ok> [15,7,13,11] 0 >r a:new swap ( nip 2 base drop >s decimal s:len r> n:max >r a:push ) a:each drop a:new swap ( nip '0 G:c# r@ G:#> s:fmt a:push ) a:each drop rdrop a:new swap ( nip /0/ " " s:replace! a:push ) a:each drop ( nip /1/ "*" s:replace! . cr ) a:each drop
****
 ***
** *
* **

Or more clearly
ok> [15,11,15,15] f f1 f2 f3
****
* **
****
****

Charcoal, 20 bytes
ＷＳ«⸿≔ＩιιＷι«←§ *ι≧÷²ι

Try it online! Link is to verbose version of code. Works by manually converting each input number to binary but printing it in right-to-left order. I take the input as a newline terminated string as Charcoal doesn't have a good way of inputting lists otherwise I would write something like this which unfortunately currently takes 21 bytes:
ＷＳ⊞υＩιＷ⌈υ«Ｅυ﹪κ²↓⸿≧÷²υ

Try it online! Link is to verbose version of code. This version vectorises over the input array, although its output is hardcoded to -s which saves a byte.

Japt, 7 bytes
Outputs an array of lines, using 1 for the bricks
®¤r0SÃù

Try it (footer replaces 1s with *s) or run all test cases
®¤r0SÃù     :Implicit input of array
®           :Map
 ¤          :  To binary string
  r0        :  Replace 0s with
    S       :  Space
     Ã      :End map
      ù     :Left pad each with spaces to the length of the longest

K (ngn/k), 8 bytes
" *"@+2\

Try it online!
Takes input as a list of integers, outputs as a list of strings.

2\ convert (implicit input) to base-2 representation
+ transpose result
" *"@ replace 0's with   and 1's with *

Canvas, 9 bytes
Ｈ２┬！0∙ ╋∔

Try it here!
Uses 1 as the display character.

Perl 5 -MList::Util=max -a, 64 bytes
say$"x((length max@F)-y///c),y/0/ /r for@F=map{sprintf"%b",$_}@F

Try it online!

Vyxal, 9 bytes
bvṅ0ðvVøɽ

Try it Online!
How?
bvṅ0ðvVøɽ
b         # Get the binary representation of each as a list
 vṅ       # Join each by nothing to make them a string
   0ðvV   # Replace all zeros with a space
       øɽ # Prepend leading spaces to each to align it to the right

Uiua SBCS, 9 bytes
⊏:" *"≡⇌⋯

Try it!
⊏:" *"≡⇌⋯
        ⋯  # convert to bits
      ≡⇌   # reverse each row
⊏:" *"     # convert to characters

Pip -l, 14 bytes
Z RZJ R*TBgR0s

Uses 1 as the brick character. Attempt This Online!
Explanation
Z RZJ R*TBgR0s
          g    ; List of command-line args
        TB     ; Convert to binary
           R0s ; Replace 0 with space
      R*       ; Reverse each
   ZJ          ; Transpose, filling missing spots with spaces
  R            ; Reverse
Z              ; Transpose again

JavaScript (Node.js), 72 bytes
f=x=>x.some(t=>t)?f(x.map(t=>t>>1)).map((t,i)=>t+(x[i]&1||' ')):x.fill``

Try it online!

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


text:
When Fibonacci meets the Queens
(inspired by Helka's response to my random pairing of "chess" and "Fibonacci" tags in chat)

Fibonacci
The Fibonacci numbers are one of the more well-known sequences in mathematics, where each number is composed by adding the two previous numbers together. Below is a definition of the zero-indexed sequence:
f(0) = 0
f(1) = 1
f(n) = f(n-1) + f(n-2)

This results in the sequence 0, 1, 1, 2, 3, 5, 8, 13, 21, ... (OEIS link). In this challenge, we'll be focusing on only the strictly-positive values (so 1, 1, 2, 3, ...), and you can choose zero-indexing or one-indexing, but please state which in your submission.
The Fibonacci numbers can be used for a tiling of the plane, by using squares that are successive f(n) in size, and aligning their edges together. The tiling is done in a counter-clockwise fashion, by placing squares in the pattern "right-up-left-down" from the current square. An example of this partial tiling for f(8)=21, with the starting square highlighted in blue, is as follows:

You can see the f(1)=1 as the starting square (highlighted in blue), the f(2)=1 square placed to the right of it, the f(3)=2 square placed up from there, the f(4)=3 square placed left and so on. The next square would be f(9)=21+13=34 and would be placed to the bottom. This is the partial tiling method we'll be using in this challenge.

The Queens
In the game of chess, the most powerful piece is the queen because it can move any number of spaces horizontally, vertically, or diagonally. In the below board diagram, the squares with a black circle show where the queen can move:

We'll define the term coverage as

The percentage of squares that the queen can move to versus the total number of squares, given the queen's particular position on an empty board, and including the queen's own starting position.

For the example moves above, the queen's coverage is 28/64 = 43.75%. If the queen was in the upper-right h8 square, the coverage would be 22/64 = 34.375%. If the queen was in e7, the coverage would be 24/64 = 37.5%.

The Challenge
We're going to use the Fibonacci tiling demonstrated above as our chess board for this challenge. You'll be given two positive integers as input, n and x:

The n represents how large the tiling is. The example tiling above, with the 21 square on the left, is a board of size n = 8 since f(8) = 21 (when zero-indexed).
The x represents which of the Fibonacci squares is used for the queen(s) placement, for calculating the coverage. The queens are placed one-at-a-time on each square in that particular Fibonacci square tile, and the total coverage is the summation of the individual (unique) coverage.

For example, here is an image of n = 8 (the same tiling as above) and x = 4 (corresponding to the f(4) = 3 square, shaded blue). By placing a queen one-at-a-time into each of those nine blue squares, the queens can (combined) cover every square that's shaded orange. The total coverage in this example is therefore 309/714 = 43.28%.

Quite obviously, any time that n = x, the coverage is going to be 100% (for example, with n=8 and x=8, you can see that every square on the entire board is going to be covered at least once). Conversely, with a suitably large n and x=1 or x=2, the coverage is going to approach (but never reach) 0% (for example, with n=8 and x=1, the coverage is a paltry 88/714 = 12.32%).
Given two such input numbers, you must output the coverage percentage, accurate to two decimal places. Please specify how your code handles rounding.

Rules

The input and output can be given in any convenient format, but must be accurate to two decimal places. Please specify how your code handles rounding.
Assume no other pieces are on the board or otherwise interfere with the moves.
Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
If possible, please include a link to an online testing environment so other people can try out your code!
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

Examples
n = 8, x = 4
43.28

n = 8, x = 8
100 or 100.00

n = 8, x = 1
12.32

n = 4, x = 1
66.67

n = 4, x = 2
60 or 60.00

n = 5, x = 3
75 or 75.00

n = 5, x = 1
47.5 or 47.50

My profile picture is semi-relevant

"When Fibonacci met the Queens"? Or "Fibonacci meets the Queens"?

"To escape closure, a fibonacci challenge has to be as good as the previous 2 fibonacci challenges put together." Seems good enough.

@JonathanAllan The title is correct as-is. It's present indicative tense as in "this is what happens when X happens." Compare "When Henry meets Sally for lunch, they always eat hamburgers."

Ah, you mean "When Fibonacci meets the Queens..."!

@JonathanAllan Yes, but SE won't let me have trailing ellipses in the title.

@AdmBorkBork I get309/714 for n=8, x=4. I've double checked it a couple of times, and believe I'm right based on my understanding of the rules. Can you double check if your number is right, or let me know if I misunderstood something?

Note to self: name drop Helka, next time I write a challenge...

@BrianJ Yep. A typo on my notes when I was going through the calculation manually resulted in the mistake spreading. 309 is correct, and I've updated the question. Thanks!

@AdmBorkBork Also, n=8,x=1 I get 88/714

@BrianJ Thanks - that was a mistaken holdover from the sandbox; initially, I had defined coverage to not include the starting position but later changed that and apparently never updated the 87 to an 88. Thanks.

APL(Dyalog Unicode), 61 bytes SBCS
{2⍕100×(+/÷≢)∨⌿⊃∊⍤1⍥{⍉↑(⊢,+/,-/)¨⍸⍵}/1 0⌈{⌽⍉⍺,⍣(≢⍵)⍪⍵}/⌽⍺=⍳⍵}

Try it on APLgolf!
A pretty nice challenge for APL. This is an infix function that takes x on its left and n on its right, and returns the string representation of the rounded percentage. A full program would be 59 bytes (though I don't like using that I/O format because writing tests is cumbersome):
2⍕100×(+/÷≢)∨⌿⊃∊⍤1⍥{⍉↑(⊢,+/,-/)¨⍸⍵}/1 0⌈{⌽⍉⍺,⍣(≢⍵)⍪⍵}/⌽⎕=⍳⎕

How it works
Constructs a boolean matrix representing the grid in question where 1 means a queen, and counts all the cells that share their row, column, diagonal, or anti-diagonal with some 1 cell.
{⌽⍉⍺,⍣(≢⍵)⍪⍵}/⌽⍺=⍳⍵    Part 1: construct the matrix; ⍺←x, ⍵←n
              ⌽⍺=⍳⍵    A boolean vector of length n with x-th from the end
                       marked as 1
{           }/    Reduce from right to left:
   ⍺,⍣(≢⍵)⍪⍵      Attach a square filled with ⍺ on the left of current matrix ⍵
 ⌽⍉               Rotate clockwise once
                  Reduction gives an enclosed matrix

∊⍤1⍥{⍉↑(⊢,+/,-/)¨⍸⍵}/1 0⌈    Part 2: Find possible Queen moves
                     1 0⌈    Get an all-ones matrix and the original matrix
   ⍥{              }/    Apply to each matrix:
                 ⍸⍵      Get all coordinates of ones
       (⊢,+/,-/)¨        For each coord [r, c], get [r, c, r+c, r-c]
                         (rownum, colnum, anti-diag-num, diag-num)
     ⍉↑                  Matrixify and transpose
∊⍤1    For each row, convert each number on its left side as 1 if
       it appears on the right on the same row
       The result is a 4-row matrix with each column representing a cell,
       where a 1 means that cell is reachable by moving in specific direction

2⍕100×(+/÷≢)∨⌿⊃    Part 3: Calculate average
               ⊃    Disclose the enclosed matrix
            ∨⌿     Boolean OR of each column
      (+/÷≢)       Average (reachable cells ÷ all cells)
2⍕100×             Percentage rounded to 2 decimal places

VB.NET, (.NET 4.5), 1238 1229 bytes
-9 bytes thanks to @totallyhuman
Function A(n,x)
Dim g=New List(Of List(Of Long))
g.Add(New List(Of Long))
g(0).Add(1)
For i=2To n
Dim b=1
If i>2Then
Dim w=0,y=1
b=w+y
For j=3To i
w=y
y=b
b=w+y
Next
End If
Select Case i Mod 4
Case 1
For j=1To b
Dim l=New List(Of Long)
For k=1To b
l.Add(i)
Next
g.Add(l)
Next
Case 2
For Each r In g
For j=1To b
r.Add(i)
Next
Next
Case 3
For j=1To b
g.Insert(0,New List(Of Long))
For k=1To b
g(0).Add(i)
Next
Next
Case 0
For Each r In g
For j=1To b
r.Insert(0,i)
Next
Next
End Select
Next
For i=0To g.Count-1
Dim c=g(i)
For j=0To c.Count-1
Dim e=c(j)
If e=x Then
For k=1To Math.Max(g.Count,g(0).Count)
If j-k>=0AndAlso c(j-k)<>x Then c(j-k)=0
If i-k>=0AndAlso g(i-k)(j)<>x Then g(i-k)(j)=0
If j+k<c.Count AndAlso c(j+k)<>x Then c(j+k)=0
If i+k<g.Count AndAlso g(i+k)(j)<>x Then g(i+k)(j)=0
If i-k>=0AndAlso j-k>=0AndAlso g(i-k)(j-k)<>x Then g(i-k)(j-k)=0
If i-k>=0AndAlso j+k<c.Count AndAlso g(i-k)(j+k)<>x Then g(i-k)(j+k)=0
If i+k<g.Count AndAlso j-k>=0AndAlso g(i+k)(j-k)<>x Then g(i+k)(j-k)=0
If i+k<g.Count AndAlso j+k<c.Count AndAlso g(i+k)(j+k)<>x Then g(i+k)(j+k)=0
Next
End If
Next
Next
Dim hits=0
For Each r In g
For Each c In r
If c=x Or c=0Then hits+=1
Next
Next
Return Math.Round(hits*100/(g.Count*g(0).Count),2)
End Function

Simulation of the problem statement. I start by creating the grid, looping through each new fibonacci number to increase the square size. I store the index in each cell, so that it's easy to find where the queens will go in the next step.
Then, I find every cell that should have a queen in it, and mark each threatened square with a zero. I skip the cells where the queens are so that I don't have to worry about backtracking.
At the end, I count up the cells that are cleared, and the cells with queens, and then divide it by the total number of spaces. Multiply by 100 to get the percent, and round to the nearest two decimal places.

Can you not change hits to a shorter variable name? I don't know VB.NET, but I'm assuming that's a variable.

@totallyhuman yep, that's correct. I went through by hand and must have missed that one. Thanks!

Python 2, 524 499 bytes
def Q(n,x):
 global w,h,f;f,R,L=0,range,len
 for d in R(n):s=x-1==d;f=f or[[s]];w=L(f[0]);W,H=R(w),R(L(f));exec"for j in "+("W:f.append([s]*w)","f:\n\tfor k in H:j.append(s)","W:f.insert(0,[s]*w)","f:\n\tfor k in H:j.insert(0,s)","f:0")[d%4-(d==0)]
 w,h=L(f[0]),L(f);l=0,1,-1
 for Y in R(h):
	for X in R(w):exec("""def F(u,v,x,y):
 while(u==v==0)==0<=x<w!=0<=y<h:f[y][x]=1+(f[y][x]!=1);x+=u;y+=v
for s in l:
 for t in l:F(s,t,X,Y)""","")[f[Y][X]!=1]
 q=w*h;return(q-sum(j.count(0)for j in f))*100./q

Try it online!
Defining a function that takes in both the tiling size n and the queen's fibonacci square number x. The ouput percentage is porperly rounded to two decimal places (in the footer, where all output is taking place).
f is a two-dimensional array containing the board information being initiated to 0. Then, the fibonacci chess board is calculated and populated with queens where queens shall be. Those queens are then moved to every place they can be moved; all positions are counted and printed as a percentage of the entire board.

Mathematica 11.1, 336 bytes, 1-based
R=Rectangle[#,+##]&;f=Fibonacci;o=Join@@Outer[##,1]&;r=RegionUnion;s=RegionMeasure;p[1]={0,0};p[i_]:=p[i-1]+{{-f@i,-f[i-2]},{0,-f@i},{f[i-1],0},{f[i-1]-f@i,f[i-1]}}[[i~Mod~4+1]];t[i_]:=r[R[p@#,f@#]&/@Range@i];k[n_,x_]:=Round[100s@RegionIntersection[r[R[#,f@x]&/@((#+p@x)&/@o[1##&,o[List,{-1,0,1},{-1,0,1}],Range[2f@n]])],t@i]/s@t@i,.01]

Usage: k[n, x]. Pay attention that the function is 1-based. Rounding is achieved by Round[100x,0.01]
Basically, p[i] is a function of determining position of each square. And area is calculated by upper-level functions like RegionIntersection, RegionUnion, RegionMeasure