cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A338238 #14 Jun 08 2022 15:56:21
%S A338238 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 A338238 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 A338238 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 A338238 Minimum number of rotations for a second maximum cyclic autocorrelation of the first n terms of the characteristic function of primes.
%C A338238 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 A338238 Andres Cicuttin, <a href="/A338238/a338238.pdf">Several scatter plots of sequences of different lengths</a>
%e A338238 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 A338238 (0,1,1,0,1).(0,1,1,0,1) = 0*0 + 1*1 + 1*1 + 0*0 + 1*1 = 3, (0 rotations)
%e A338238 (0,1,1,0,1).(1,0,1,1,0) = 0*1 + 1*0 + 1*1 + 0*1 + 1*0 = 1, (1 rotation)
%e A338238 (0,1,1,0,1).(0,1,0,1,1) = 0*0 + 1*1 + 1*0 + 0*1 + 1*1 = 2, (2 rotations)
%e A338238 (0,1,1,0,1).(1,0,1,0,1) = 0*1 + 1*0 + 1*1 + 0*0 + 1*1 = 2, (3 rotations)
%e A338238 (0,1,1,0,1).(1,1,0,1,0) = 0*1 + 1*1 + 1*0 + 0*1 + 1*0 = 1, (4 rotations)
%e A338238 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 A338238 nmax = 2^7;
%t A338238 b = Table[If[PrimeQ[i], 1, 0], {i, 1, nmax}];
%t A338238 tab = Table[Table[b[[1;;n]].RotateRight[b[[1;;n]], j], {j, 1, n-1}], {n, 2, nmax}];
%t A338238 tabmaxs = Table[Max[tab[[n]]], {n, 1, nmax-1}];
%t A338238 a = Table[First@Position[tab[[j]], tabmaxs[[j]]], {j, 1, nmax-1}] // Flatten
%Y A338238 Cf. A010051, A002110, A337802, A299111, A338132.
%K A338238 nonn
%O A338238 2,4
%A A338238 _Andres Cicuttin_, Oct 17 2020