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.

A332877 Arrange the first n primes in a circle in any order. a(n) is the minimum value of the largest product of two consecutive primes out of all possible orders.

This page as a plain text file.
%I A332877 #91 Jul 05 2020 13:18:19
%S A332877 6,15,21,35,55,77,91,143,187,221,253,323,391,493,551,667,713,899,1073,
%T A332877 1189,1271,1517,1591,1763,1961,2183,2419,2537,2773,3127,3233,3599,
%U A332877 3953,4189,4331,4757,4897,5293,5723,5963,6499,6887,7171,7663,8051,8633,8989,9797,9991,10403,10807,11303
%N A332877 Arrange the first n primes in a circle in any order. a(n) is the minimum value of the largest product of two consecutive primes out of all possible orders.
%C A332877 It might appear that all terms are either the product of two consecutive primes or two primes with a prime in between (A333747). However, 253=11*23 is the first term that is not in that sequence.
%C A332877 The easiest optimal permutation of n primes is probably {p_1, p_n, p_2, p_n-1, …, p_ceiling(n/2)}. - _Ivan N. Ianakiev_, Apr 20 2020
%H A332877 Giovanni Resta, <a href="/A332877/a332877.txt">Examples for a(2)-a(22)</a>
%F A332877 Probably a(n) = A332765(n+1) for n > 4.
%e A332877 Here are the different ways to arrange the first 4 primes in a circle.
%e A332877   2-3
%e A332877   | |  Products: 6, 21, 35, 10. Largest product: 35.
%e A332877   5-7
%e A332877 .
%e A332877   2-3
%e A332877   | |  Products: 6, 15, 35, 14. Largest product: 35.
%e A332877   7-5
%e A332877 .
%e A332877   2-5
%e A332877   | |  Products: 10, 15, 21, 14. Largest product: 21.
%e A332877   7-3
%e A332877 The minimum largest product is 21, so a(4)=21.
%t A332877 primes[n_]:=Prime/@Range[n];
%t A332877 partition[n_]:=Partition[primes[n],UpTo[Ceiling[n/2]]];
%t A332877 riffle[n_]:=Riffle[partition[n][[1]],Reverse[partition[n][[2]]]];
%t A332877 a[n_]:=Max[Table[riffle[n][[i]]*riffle[n][[i+1]],{i,1,n-1}]];
%t A332877 a/@Range[2,60] (* _Ivan N. Ianakiev_, Apr 20 2020 *)
%o A332877 (PARI) a(n) = {my(x = oo); for (k=1, (n-1)!, my(vp = Vec(numtoperm(n, k-1))); vp = apply(x->prime(x), vp); x = min(x, max(vp[1]*vp[n-1], vecmax(vector(n-1, j, vp[j]*vp[j+1]))));); x;} \\ _Michel Marcus_, Apr 14 2020
%Y A332877 Cf. A064796, A332765, A333747.
%K A332877 nonn
%O A332877 2,1
%A A332877 _Bobby Jacobs_, Apr 11 2020
%E A332877 a(12)-a(13) from _Michel Marcus_, Apr 14 2020
%E A332877 a(14) from _Alois P. Heinz_, Apr 15 2020
%E A332877 a(15)-a(22) from _Giovanni Resta_, Apr 19 2020
%E A332877 More terms from _Ivan N. Ianakiev_, Apr 20 2020