From the literature, showed below, I know two gadgets that provide a way to know if a positive integer (a positive quantity of units) is composite or a prime number. I would like to know if in the literature or from your invention it is possible to show other different gadgets that provide us primality tests.



> 
> **Question.** Do you know different gadgets or mechanisms from the literature that can be used as a primality test? Then, please add the references asnwering my question as a reference request and I try to read it from the literature. Are you able to provide a different gadget from your invention that provide (its idealization as a physical machine) a way to determine if a quantity (of something) is prime or composite? **Many thanks.**
> 
> 
> 


Feel free to provide draws of your machine as companion of your explanation of how and why works it as a primality test.


References:
-----------


[1] A. K. Dewdney, *On the spaghetti computer and other analog gadgets for problem solving*, Scientific American Volume 250  Issue 6 (June 1984), Computer Recreations p. 19-26.


[2] Francisco Javier Díaz Aspe, *Cómo detectar primos usando una cuerda con nudos*, Miniaturas matemáticas de La Gaceta de la RSME, La Gaceta de la Real Sociedad Matemática Española, Núm. 1, Pág. 80 Vol. 22 (2019).



Gadgets as primality tests
I interpret a "gadget" as a physical device that operates in an analog, rather than a digital way (to exclude a computer). The OP asks for "primality tests", but if I may broaden the question to include "prime number generators", there is a variety of such gadgets, collected at [unusual and physical methods for finding prime numbers](http://empslocal.ex.ac.uk/people/staff/mrwatkin//zeta/unusual.htm). 


The gadgets use effects from chemistry ([Biochemical identification of prime numbers](http://empslocal.ex.ac.uk/people/staff/mrwatkin//zeta/toha-soto.pdf)), biology ( [A Biological Generator of Prime Numbers](http://mariomarkus.com/save/biological-primes.pdf), and physics [An optical Eratosthenes' sieve for large prime numbers](https://arxiv.org/abs/1910.10751).


The latter would qualify as a primality test, I cite the abstract and show a figure from that paper:



> 
> We report the first experimental demonstration of prime number sieve
>  via linear optics. The prime numbers distribution is encoded in the
>  intensity zeros of the far field produced by a spatial light modulator
>  hologram, which comprises a set of diffraction gratings whose periods
>  correspond to all prime numbers below 149. To overcome the limited far
>  field illumination window and the discretization error introduced by
>  the finite spatial resolution, we rely on additional diffraction
>  gratings and sequential recordings of the far field. This strategy
>  allows us to optically sieve all prime numbers below $149^2 = 22201$.
> 
> 
> 


![](https://ilorentz.org/beenakker/MO/primality_test.png)


