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.

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