login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Minimum number of rotations for a second maximum cyclic autocorrelation of the first n terms of the characteristic function of primes.
3

%I #14 Jun 08 2022 15:56:21

%S 1,1,1,2,3,2,2,2,2,2,4,2,6,2,8,2,4,2,6,6,6,6,6,4,6,6,6,6,6,2,6,6,6,6,

%T 12,6,6,6,6,6,18,6,6,6,6,6,24,6,6,6,6,6,24,6,6,6,24,6,6,6,6,6,6,6,24,

%U 6,6,6,6,6,24,6,6,6,6,6,24,6,6,6,6,6,30,6,30,6,12,6,30,6,6,6,6,6,30,6,30

%N Minimum number of rotations for a second maximum cyclic autocorrelation of the first n terms of the characteristic function of primes.

%C It seems that most frequent terms among the first ones assume values 1, 2, 6, 30, 210, 2310, . . . Primorials? Several scatter plots of sequences of different lengths suggest this pattern (See Link).

%H Andres Cicuttin, <a href="/A338238/a338238.pdf">Several scatter plots of sequences of different lengths</a>

%e The primes among the first 5 positive integers (1,2,3,4,5) are 2, 3, and 5, then the corresponding characteristic function of primes is (0,1,1,0,1) (See A010051) and the corresponding five possible cyclic autocorrelations are the dot products between (0,1,1,0,1) and its rotations as shown here below:

%e (0,1,1,0,1).(0,1,1,0,1) = 0*0 + 1*1 + 1*1 + 0*0 + 1*1 = 3, (0 rotations)

%e (0,1,1,0,1).(1,0,1,1,0) = 0*1 + 1*0 + 1*1 + 0*1 + 1*0 = 1, (1 rotation)

%e (0,1,1,0,1).(0,1,0,1,1) = 0*0 + 1*1 + 1*0 + 0*1 + 1*1 = 2, (2 rotations)

%e (0,1,1,0,1).(1,0,1,0,1) = 0*1 + 1*0 + 1*1 + 0*0 + 1*1 = 2, (3 rotations)

%e (0,1,1,0,1).(1,1,0,1,0) = 0*1 + 1*1 + 1*0 + 0*1 + 1*0 = 1, (4 rotations)

%e The maximum value of the cyclic autocorrelation is always trivially obtained with zero rotations. In this example, the maximum value is 3 and the second maximum is 2, then a(5)=2 because it is needed a minimum of 2 rotations to obtain the second maximum.

%t nmax = 2^7;

%t b = Table[If[PrimeQ[i], 1, 0], {i, 1, nmax}];

%t tab = Table[Table[b[[1;;n]].RotateRight[b[[1;;n]], j], {j, 1, n-1}], {n, 2, nmax}];

%t tabmaxs = Table[Max[tab[[n]]], {n, 1, nmax-1}];

%t a = Table[First@Position[tab[[j]], tabmaxs[[j]]], {j, 1, nmax-1}] // Flatten

%Y Cf. A010051, A002110, A337802, A299111, A338132.

%K nonn

%O 2,4

%A _Andres Cicuttin_, Oct 17 2020