%I #25 May 27 2019 04:37:28
%S 1,2,0,8,0,12,0,0,0,40,0,48,0,0,0,128,0,108,0,0,0,220,0,0,0,0,0,336,0
%N Costas arrays such that the terms in each row of the difference table are unique modulo n.
%C Permutations of n elements such that each row in the difference table consists of pairwise distinct elements, even when taken modulo n (see example).
%C For n<=29 the nonzero terms a(n) appear for n in A006093 (primes minus 1) and a(n)=A002618(n) (n*phi(n)); omitting the zeros we obtain A104039 (number of primitive roots modulo (p(n))^2, where p(n) is n-th prime).
%C A002618(n) divides a(n) for all n, since (treating elements as integers modulo n) adding or subtracting a constant from each element or multiplying each element by an integer coprime to n preserves distinctness of all values modulo n. - _Charlie Neder_, May 26 2019
%H Scott Rickard, <a href="http://costasarrays.org/">costasarrays.org</a> (information and papers about Costas arrays). [broken link?]
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Costas_array">Costas array</a>.
%e The permutation (10, 9, 2, 8, 6, 1, 3, 7, 4, 5) corresponds to a Costas array:
%e 10 9 2 8 6 1 3 7 4 5 (Permutation: p(1), p(2), p(3), ..., p(n) )
%e -1 -7 6 -2 -5 2 4 -3 1 (step-1 differences: p(2)-p(1), p(3)-p(2), ... )
%e -8 -1 4 -7 -3 6 1 -2 (step-2 differences: p(3)-p(1), p(4)-p(2), ... )
%e -2 -3 -1 -5 1 3 2 (step-3 differences: p(4)-p(1), p(5)-p(2), ... )
%e -4 -8 1 -1 -2 4 ( etc. )
%e -9 -6 5 -4 -1
%e -7 -2 2 -3
%e -3 -5 3
%e -6 -4
%e -5
%e The values in each row are unique also modulo n=10:
%e 10 9 2 8 6 1 3 7 4 5 (Permutation: p(1), p(2), p(3), ..., p(n) )
%e 9 3 6 8 5 2 4 7 1 (step-1 differences: p(2)-p(1), p(3)-p(2), ... )
%e 2 9 4 3 7 6 1 8 (step-2 differences: p(3)-p(1), p(4)-p(2), ... )
%e 8 7 9 5 1 3 2 (step-3 differences: p(4)-p(1), p(5)-p(2), ... )
%e 6 2 1 9 8 4 ( etc. )
%e 1 4 5 6 9
%e 3 8 2 7
%e 7 5 3
%e 4 6
%e 5
%Y Cf. A008404 (Costas arrays), A213270 (Costas arrays that are involutions), A213271 (Costas arrays that are derangements), A213338 (Costas arrays that are cyclic), A213339 (Costas arrays that are connected).
%K nonn,hard,more
%O 1,2
%A _Joerg Arndt_, Jun 08 2012
|