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!)
A337327 Maximum value of the cyclic self-convolution of the first n terms of the characteristic function of primes. 2
0, 1, 2, 2, 3, 2, 4, 3, 3, 3, 4, 4, 6, 5, 4, 4, 6, 5, 8, 7, 6, 6, 8, 7, 8, 7, 6, 6, 8, 7, 10, 9, 8, 8, 8, 8, 10, 9, 8, 8, 10, 10, 12, 12, 10, 11, 12, 12, 12, 13, 12, 12, 14, 13, 14, 13, 12, 12, 12, 12, 14, 13, 12, 13, 12, 14, 14, 15, 12, 14, 14, 16, 16, 18 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
Andres Cicuttin, Graph of first 2^10 terms
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 self-convolutions are the dot products between (0,1,1,0,1) and the rotations of its mirrored version as shown below:
(0,1,1,0,1).(1,0,1,1,0) = 0*1 + 1*0 + 1*1 + 0*1 + 1*0 = 1,
(0,1,1,0,1).(0,1,0,1,1) = 0*0 + 1*1 + 1*0 + 0*1 + 1*1 = 2,
(0,1,1,0,1).(1,0,1,0,1) = 0*1 + 1*0 + 1*1 + 0*0 + 1*1 = 2,
(0,1,1,0,1).(1,1,0,1,0) = 0*1 + 1*1 + 1*0 + 0*1 + 1*0 = 1,
(0,1,1,0,1).(0,1,1,0,1) = 0*0 + 1*1 + 1*1 + 0*0 + 1*1 = 3.
Then a(5)=3 because 3 is the maximum among the five values.
MATHEMATICA
b[n_]:=Table[If[PrimeQ[i], 1, 0], {i, 1, n}];
Table[Max@Table[b[n].RotateRight[Reverse[b[n]], j], {j, 0, n-1}], {n, 1, 100}]
PROG
(PARI) a(n) = vecmax(vector(n, k, sum(i=1, n, isprime(n-i+1)*isprime(1+(i+k)%n)))); \\ Michel Marcus, Aug 26 2020
CROSSREFS
Sequence in context: A163870 A327664 A155043 * A065770 A297113 A086375
KEYWORD
nonn,look
AUTHOR
Andres Cicuttin, Aug 23 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 May 12 12:33 EDT 2024. Contains 372480 sequences. (Running on oeis4.)