%I #48 Jul 29 2023 03:22:07
%S 6,4,6,3,6,4,6,5,6,3,6,4,6,4,6,3,6,4
%N Size of the smallest regular polygon chain for a regular polygon with n sides.
%C Each polygon in a polygon chain shares one edge with both its predecessor and successor polygon. The polygon chain forms a connected cycle.
%H Stuart Anderson, <a href="http://www.squaring.net/polygons/polygon-chains.png"> Smallest regular polygon chains for n= 3 to 16</a>
%H Dan McKinnon, <a href="http://www.mathrecreation.com/2015/07/regular-polygons-in-rings.html">Regular polygons, in rings</a>
%F Empirical observations for n >= 3:
%F a(n) = 3 if n == 0 (mod 6),
%F 4 if n == 4 or 8 (mod 12),
%F 5 if n = 10,
%F 4 if n = 14,
%F 6 otherwise.
%e For n = 6, 3 hexagons can form a ring. See the first link for this and further images.
%o (C++)
%o #include <iostream>
%o using namespace std;
%o int a(int n);
%o int main() {
%o int t = 30; //change to extend the number of terms
%o for (int n = 3; n < t; n++){
%o cout<< "n= "<<n<<" a(n)= "<<a(n)<<endl;
%o }
%o return 0;
%o }
%o int a(int n) {
%o int s =0;
%o if (n%6 == 0) {
%o s = 3;
%o } else if (n == 10) {
%o s = 5;
%o } else if (n == 14) {
%o s = 4;
%o } else if (n%4 == 0) {
%o s = 4;
%o } else {
%o s = 6;
%o }
%o return s;
%o }
%K nonn,more,hear
%O 3,1
%A _Stuart E Anderson_, Jul 05 2021
|