The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A338238 Minimum number of rotations for a second maximum cyclic autocorrelation of the first n terms of the characteristic function of primes. 3
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,4
COMMENTS
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).
LINKS
EXAMPLE
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:
(0,1,1,0,1).(0,1,1,0,1) = 0*0 + 1*1 + 1*1 + 0*0 + 1*1 = 3, (0 rotations)
(0,1,1,0,1).(1,0,1,1,0) = 0*1 + 1*0 + 1*1 + 0*1 + 1*0 = 1, (1 rotation)
(0,1,1,0,1).(0,1,0,1,1) = 0*0 + 1*1 + 1*0 + 0*1 + 1*1 = 2, (2 rotations)
(0,1,1,0,1).(1,0,1,0,1) = 0*1 + 1*0 + 1*1 + 0*0 + 1*1 = 2, (3 rotations)
(0,1,1,0,1).(1,1,0,1,0) = 0*1 + 1*1 + 1*0 + 0*1 + 1*0 = 1, (4 rotations)
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.
MATHEMATICA
nmax = 2^7;
b = Table[If[PrimeQ[i], 1, 0], {i, 1, nmax}];
tab = Table[Table[b[[1;; n]].RotateRight[b[[1;; n]], j], {j, 1, n-1}], {n, 2, nmax}];
tabmaxs = Table[Max[tab[[n]]], {n, 1, nmax-1}];
a = Table[First@Position[tab[[j]], tabmaxs[[j]]], {j, 1, nmax-1}] // Flatten
CROSSREFS
Sequence in context: A031217 A064131 A368859 * A355077 A111497 A220554
KEYWORD
nonn
AUTHOR
Andres Cicuttin, Oct 17 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 17 12:36 EDT 2024. Contains 373445 sequences. (Running on oeis4.)