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.

A380980 Place 2n distinct positive integers on an n-gon, n on the vertices and n on the sides such that the sums of the three values on all sides are equal. a(n) is the minimal sum of all the integers used.

Original entry on oeis.org

21, 38, 55, 81, 105, 140
Offset: 3

Views

Author

Ivan N. Ianakiev, Feb 10 2025

Keywords

Examples

			For n=7 the first 14 positive integers suffice. Their permutation is 1,11,7,8,4,9,6,10,3,14,2,12,5,13 and the sum on each side of the heptagon is 19.
		

Crossrefs

Cf. A380853.

Programs

  • Mathematica
    mod[n_]:=Append[n,First[n]];
    plus[n_]:=Table[mod[n][[i]]+mod[n][[i+1]],{i,1,Length[mod[n]]-1}];
    goodPermutations[n_]:=Select[Permutations[n],Length[plus[#]]==Length[Union[plus[#]]]&];
    min[n_]:=Min[Max/@plus/@goodPermutations[Range[n]]];
    bestPermutation[n_]:=Select[goodPermutations[Range[n]],Max[plus[#]]==min[n]&,1];
    plusBP[n_]:=plus/@bestPermutation[n]; max[n_]:=Max[Max/@plusBP[n]];
    unit[n_]:=max[n]+n+1; sum[n_]:=n*unit[n]-Total@@plusBP[n]+n*(n+1)/2; sum/@Range[3,8]