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.

Showing 1-4 of 4 results.

A027709 Minimal perimeter of polyomino with n square cells.

Original entry on oeis.org

0, 4, 6, 8, 8, 10, 10, 12, 12, 12, 14, 14, 14, 16, 16, 16, 16, 18, 18, 18, 18, 20, 20, 20, 20, 20, 22, 22, 22, 22, 22, 24, 24, 24, 24, 24, 24, 26, 26, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 30, 30, 30, 30, 30, 30, 30, 32, 32, 32, 32, 32, 32, 32, 32, 34, 34, 34, 34, 34, 34
Offset: 0

Views

Author

Jonathan Custance (jevc(AT)atml.co.uk)

Keywords

Examples

			a(5) = 10 because we can arrange 5 squares into 2 rows, with 2 squares in the top row and 3 squares in the bottom row. This shape has perimeter 10, which is minimal for 5 squares.
		

References

  • F. Harary and H. Harborth, Extremal Animals, Journal of Combinatorics, Information & System Sciences, Vol. 1, No 1, 1-8 (1976).
  • W. C. Yang, Optimal polyform domain decomposition (PhD Dissertation), Computer Sciences Department, University of Wisconsin-Madison, 2003.

Crossrefs

Cf. A000105, A067628 (analog for triangles), A075777 (analog for cubes).
Cf. A135711.
Number of such polyominoes is in A100092.

Programs

  • Haskell
    a027709 0 = 0
    a027709 n = a027434 n * 2  -- Reinhard Zumkeller, Mar 23 2013
    
  • Magma
    [2*Ceiling(2*Sqrt(n)): n in [0..100]]; // Vincenzo Librandi, May 11 2015
    
  • Maple
    interface(quiet=true); for n from 0 to 100 do printf("%d,", 2*ceil(2*sqrt(n))) od;
  • Mathematica
    Table[2*Ceiling[2*Sqrt[n]], {n, 0, 100}] (* Wesley Ivan Hurt, Mar 01 2014 *)
  • Python
    from math import isqrt
    def A027709(n): return 1+isqrt((n<<2)-1)<<1 if n else 0 # Chai Wah Wu, Jul 28 2022

Formula

a(n) = 2*ceiling(2*sqrt(n)).
a(n) = 2*A027434(n) for n > 0. - Tanya Khovanova, Mar 04 2008

Extensions

Edited by Winston C. Yang (winston(AT)cs.wisc.edu), Feb 02 2002

A067628 Minimal perimeter of polyiamond with n triangles.

Original entry on oeis.org

0, 3, 4, 5, 6, 7, 6, 7, 8, 9, 8, 9, 10, 9, 10, 11, 10, 11, 12, 11, 12, 13, 12, 13, 12, 13, 14, 13, 14, 15, 14, 15, 14, 15, 16, 15, 16, 15, 16, 17, 16, 17, 16, 17, 18, 17, 18, 17, 18, 19, 18, 19, 18, 19, 18, 19, 20, 19, 20, 19, 20, 21, 20, 21, 20, 21, 20, 21, 22, 21, 22, 21, 22
Offset: 0

Views

Author

Winston C. Yang (winston(AT)cs.wisc.edu), Feb 02 2002

Keywords

Comments

A polyiamond is a shape made up of n congruent equilateral triangles.

References

  • Frank Harary and Heiko Harborth, Extremal animals, J. Combinatorics Information Syst. Sci., 1(1):1-8, 1976.

Crossrefs

Programs

  • Maple
    interface(quiet=true); for n from 0 to 100 do if (1 = 1) then temp1 := ceil(sqrt(6*n)); end if; if ((temp1 mod 2) = (n mod 2)) then temp2 := 0; else temp2 := 1; end if; printf("%d,", temp1 + temp2); od;
  • PARI
    a(n)=2*ceil((n+sqrt(6*n))/2)-n; \\ Stefano Spezia, Oct 02 2019
    
  • Python
    from math import isqrt
    def A067628(n): return (c:=isqrt(6*n-1)+1)+((c^n)&1) if n else 0 # Chai Wah Wu, Jul 28 2022

Formula

Let c(n) = ceiling(sqrt(6n)). Then a(n) is whichever of c(n) or c(n) + 1 has the same parity as n.
a(n) = 2*ceiling((n + sqrt(6*n))/2) - n (Harary and Harborth, 1976). - Stefano Spezia, Oct 02 2019

A135708 Minimal total number of edges in a polyhex consisting of n hexagonal cells.

Original entry on oeis.org

6, 11, 15, 19, 23, 27, 30, 34, 38, 41, 45, 48, 52, 55, 59, 62, 66, 69, 72, 76, 79, 83, 86, 89, 93, 96, 99, 103, 106, 109, 113, 116, 119, 123, 126, 129, 132, 136, 139, 142, 146, 149, 152, 155, 159, 162, 165, 168, 172, 175, 178, 181, 185, 188, 191, 194, 198, 201, 204, 207, 210
Offset: 1

Views

Author

N. J. A. Sloane, based on an email from Sascha Kurz, Mar 05 2008

Keywords

Comments

The extremal examples were described by Y. S. Kupitz in 1991.

References

  • Y. S. Kupitz, "On the maximal number of appearances of the minimal distance among n points in the plane", in Intuitive geometry: Proceedings of the 3rd international conference held in Szeged, Hungary, 1991; Amsterdam: North-Holland: Colloq. Math. Soc. Janos Bolyai. 63, 217-244.

Crossrefs

Cf. A135711.

Programs

  • Magma
    [3*n+Ceiling(Sqrt(12*n-3)): n in [1..65]]; // Vincenzo Librandi, Oct 30 2016
    
  • Mathematica
    Table[3*n + Ceiling[Sqrt[12*n - 3]], {n,1,25}] (* G. C. Greubel, Oct 29 2016 *)
  • PARI
    a(n) = 3*n + ceil(sqrt(12*n-3)); \\ Michel Marcus, Oct 30 2016
    
  • Python
    from math import isqrt
    def A135708(n): return 3*n+1+isqrt(12*n-4) # Chai Wah Wu, Jul 28 2022

Formula

a(n) = 3*n + ceiling(sqrt(12*n - 3)). - H. Harborth
2*a(n) - A135711(n) = 6n. - Tanya Khovanova, Mar 07 2008

A075777 Minimal surface area of a rectangular solid with volume n and integer sides.

Original entry on oeis.org

6, 10, 14, 16, 22, 22, 30, 24, 30, 34, 46, 32, 54, 46, 46, 40, 70, 42, 78, 48, 62, 70, 94, 52, 70, 82, 54, 64, 118, 62, 126, 64, 94, 106, 94, 66, 150, 118, 110, 76, 166, 82, 174, 96, 78, 142, 190, 80, 126, 90, 142, 112, 214, 90, 142, 100, 158, 178, 238, 94, 246, 190
Offset: 1

Views

Author

Robert A. Stump (bee_ess107(AT)msn.com), Oct 09 2002

Keywords

Comments

To find minimum surface area (incorrect, see below!), let s1_0 = [n^(1/3)]. Find largest integer s1 such that s1 <= s1_0 and s1 | n. Then let s2_0 = [sqrt(n / s1)]. Find largest integer s2 such that s2 <= s2_0 and s2 | (n / s1). Then s3 = n / (s1 * s2). And minimum surface area a(n) = 2 * (s1 * s2 + s1 * s3 + s2 * s3).
The above algorithm is not correct. Consider n=68: algorithm returns (s1,s2,s3) = (4,1,17) for minimal surface area 178. However, (2,2,17) has a surface area of 144. Consider n=246: algorithm gives (6,1,41) but (3,2,41) has a lower surface area. It appears that the algorithm, by picking s1 to be the highest divisor of n, does not get the chance to choose a pair (s1,s2) that is equal or nearly equal. I wrote a Python script for a new algorithm (posted below). However, it is much slower since it loops through every divisor s1 of n and divisor s2 of a given n/s1 while finding and keeping a minimum surface area. (Ceiling is used to avoid a floating point error on the roots.) - Scott B. Farrar, Sep 29 2015

Examples

			a(12) = 32 because side lengths of 2, 2 and 3 will give volume 12 and surface area 32, which is the minimum surface area.
		

Crossrefs

Cf. A135711.

Programs

  • Maple
    N:= 1000: # to get a(1) .. a(N)
    A:= Vector(N,1)*6*N;
    for p1 from 1 to N do
      for p2 from p1 to floor(N/p1) do
         for p3 from p2 to floor(N/p1/p2) do
            n:= p1*p2*p3;
            a:= 2*(p1*p2 + p2*p3 + p1*p3);
            if a < A[n] then A[n]:= a fi
    od od od:
    seq(A[i],i=1..N); # Robert Israel, Sep 30 2015
  • PARI
    a(n) = {s1_0 = floor(n^(1/3)); s1 = s1_0; while (n % s1 != 0, s1--); s2_0 = floor(sqrt(n/s1)); nds1 = n/s1; s2 = s2_0; while (nds1 % s2 != 0, s2--); s3 = n/(s1*s2); return (2 * (s1 * s2 + s1 * s3 + s2 * s3));} \\ Michel Marcus, Apr 14 2013; script based on 1st algorithm now known to give ok terms up to n=67 only
    
  • PARI
    a(n) = {mins = -1; fordiv(n, x, q = n/x; fordiv(q, y, z = q/y; s = 2*(x*y + y*z +x*z); if (mins ==-1, mins =s, mins = min(mins, s)););); mins;} \\ Michel Marcus, Sep 30 2015
    
  • Python
    import math
    def cubestepdown(n):
        s1_0 = int(math.ceil(n ** (1 / 3.0)))
        minSA = -1
        s1 = s1_0
        while s1>=1:
            while n % s1 > 0:
                s1 = s1 - 1
            s1quot = int(n/s1)
            s2_0 = int(math.ceil(math.sqrt(n/s1)))
            s2 = s2_0
            while s2>=1:
                while s1quot % s2 > 0:
                    s2 = s2 - 1
                s3 = int(n / (s1 * s2))
                SA = 2*(s1*s2 + s1*s3 + s2*s3)
                if minSA==-1:
                    minSA = SA
                else:
                    if SAScott B. Farrar, Sep 29 2015
Showing 1-4 of 4 results.