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-10 of 17 results. Next

A063655 Smallest semiperimeter of integral rectangle with area n.

Original entry on oeis.org

2, 3, 4, 4, 6, 5, 8, 6, 6, 7, 12, 7, 14, 9, 8, 8, 18, 9, 20, 9, 10, 13, 24, 10, 10, 15, 12, 11, 30, 11, 32, 12, 14, 19, 12, 12, 38, 21, 16, 13, 42, 13, 44, 15, 14, 25, 48, 14, 14, 15, 20, 17, 54, 15, 16, 15, 22, 31, 60, 16, 62, 33, 16, 16, 18, 17, 68, 21, 26
Offset: 1

Views

Author

Floor van Lamoen, Jul 24 2001

Keywords

Comments

Similar to A027709, which is minimal perimeter of polyomino of n cells, or equivalently, minimal perimeter of rectangle of area at least n and with integer sides. Present sequence is minimal semiperimeter of rectangle with area exactly n and with integer sides. - Winston C. Yang (winston(AT)cs.wisc.edu), Feb 03 2002
Semiperimeter b+d, d >= b, of squarest (smallest d-b) integral rectangle with area bd = n. That is, b = largest divisor of n <= sqrt(n), d = smallest divisor of n >= sqrt(n). a(n) = n+1 iff n is noncomposite (1 or prime). - Daniel Forgues, Nov 22 2009
From Juhani Heino, Feb 05 2019: (Start)
Basis for any thickness "frames" around the minimal area. Perimeter can be thought as the 0-thick frame, it is obviously 2a(n). Thickness 1 is achieved by laying unit tiles around the area, there are 2(a(n)+2) of them. Thickness 2 comes from the second such layer, now there are 4(a(n)+4) and so on. They all depend only on a(n), so they share this structure:
Every n > 1 is included. (For different thicknesses, every integer that can be derived from these with the respective formula. So, the perimeter has every even n > 2.)
For each square n > 1, a(n) = a(n-1).
a(1), a(2) and a(6) are the only unique values - the others appear multiple times.
(End)
Gives a discrete Uncertainty Principle. A complex function on an abelian group of order n and its Discrete Fourier Transform must have at least a(n) nonzero entries between them. This bound is achieved by the indicator function on a subgroup of size closest to sqrt(n). - Oscar Cunningham, Oct 10 2021
Also two times the median divisor of n, where the median of a multiset is either the middle part (for odd length), or the average of the two middle parts (for even length). The version for mean instead of median is A057020/A057021. Other doubled medians of multisets are: A360005 (prime indices), A360457 (distinct prime indices), A360458 (distinct prime factors), A360459 (prime factors), A360460 (prime multiplicities), A360555 (0-prepended differences). - Gus Wiseman, Mar 18 2023

Examples

			Since 15 = 1*15 = 3*5 and the 3*5 rectangle gives smallest semiperimeter 8, we have a(15)=8.
		

Crossrefs

Positions of odd terms are A139710.
Positions of even terms are A139711.
A000005 counts divisors, listed by A027750.
A000975 counts subsets with integer median.

Programs

  • Maple
    A063655 := proc(n)
        local i,j;
        for i from floor(sqrt(n)) to 1 by -1 do
            j := floor(n/i) ;
            if i*j = n then
                return i+j;
            end if;
        end do:
    end proc:
    seq(A063655(n), n=1..80); # Winston C. Yang, Feb 03 2002
  • Mathematica
    Table[d = Divisors[n]; len = Length[d]; If[OddQ[len], 2*Sqrt[n], d[[len/2]] + d[[1 + len/2]]], {n, 100}] (* T. D. Noe, Mar 06 2012 *)
    Table[2*Median[Divisors[n]],{n,100}] (* Gus Wiseman, Mar 18 2023 *)
  • PARI
    A063655(n) = { my(c=1); fordiv(n,d,if((d*d)>=n,if((d*d)==n,return(2*d),return(c+d))); c=d); (0); }; \\ Antti Karttunen, Oct 20 2017
    
  • Python
    from sympy import divisors
    def A063655(n):
        d = divisors(n)
        l = len(d)
        return d[(l-1)//2] + d[l//2] # Chai Wah Wu, Jun 14 2019

Formula

a(n) = A033676(n) + A033677(n).
a(n) = A162348(2n-1) + A162348(2n). - Daniel Forgues, Sep 29 2014
a(n) = Min_{d|n} (n/d + d). - Ridouane Oudra, Mar 17 2024

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org) and Dean Hickerson, Jul 26 2001

A027434 a(1) = 2; then defined by property that a(n) = smallest number >= a(n-1) such that successive runs have lengths 1,1,2,2,3,3,4,4.

Original entry on oeis.org

2, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18
Offset: 1

Views

Author

Sam Speed (SPEEDS(AT)msci.memphis.edu)

Keywords

Comments

Also the sequence of first skipped terms for Beatty sequences in the family alpha = 1+sqrt(n)-sqrt(n-1). - Alisa Ediger, Jul 20 2016
Optimal cost for one-dimensional Racetrack over a distance n. - Jason Schoeters, Aug 18 2021
If b > 0 and c > 0 are the integer coefficients of a monic quadratic x^2 + b*x + c, it has integer roots if its discriminant d^2 = b^2 - 4c is a perfect square. This sequence is the values of b for increasing b sorted by b then c. The first pair of (b, c) = (2, 1) and has d = A082375(0) = 0. The n-th pair of (b, c) = (a(n), A350634(n)) and has d = A082375(n-1). - Frank M Jackson, Jan 21 2024

References

  • Sam Speed, An integer sequence (preprint).

Crossrefs

Programs

  • Haskell
    a027434 = (+ 1) . a000196 . (subtract 3) . (* 4)
    a027434_list = 2 : concat (map (\x -> replicate (x `div` 2) x) [3..])
    -- Reinhard Zumkeller, Mar 23 2013, Nov 22 2011
    
  • Maple
    A027434:=n->ceil(2*sqrt(n)); seq(A027434(n), n=1..100); # Wesley Ivan Hurt, Mar 01 2014
  • Mathematica
    Table[Ceiling[2*Sqrt[n]], {n, 100}] (* Wesley Ivan Hurt, Mar 01 2014 *)
    Sort[Flatten[Table[#,{#[[1]]/2}]]]&/@Partition[Range[2,20],2]//Flatten (* Harvey P. Dale, Sep 05 2019 *)
    lst = {}; Do[If[IntegerQ[d=Sqrt[b^2-4 c]], AppendTo[lst, b]], {b, 1, 20}, {c, 1, b^2/4}]; lst (* Frank M Jackson, Jan 21 2024 *)
  • PARI
    a(n)=sqrtint(4*n-3)+1 \\ Charles R Greathouse IV, Feb 07 2012
    
  • Python
    from math import isqrt
    def A027434(n): return 1+isqrt((n<<2)-1) # Chai Wah Wu, Jul 27 2022

Formula

a(n) = 1 + floor( sqrt(4*n-3) ) = 1+A000267(n-1).
a(n) = A049068(n) - n.
a(n) = A027709(n)/2. - Tanya Khovanova, Mar 04 2008
a(n) = ceiling(2*sqrt(n)). [Mircea Merca, Feb 07 2012]
a(n) = floor(1+sqrt(n)+sqrt(n-1)). - Alisa Ediger, Jul 20 2016
G.f.: x*(1 + x^(-1/4)*theta_2(x) + theta_3(x))/(2*(1 - x)), where theta_k(x) is the Jacobi theta function. - Ilya Gutkovskiy, Jul 20 2016
a(n) = 1 + floor(sqrt(4*n-1)). - Chai Wah Wu, Jul 27 2022
a(n) = sqrt((A082375(n))^2 + 4*A350634(n+1)). - Frank M Jackson, Jan 21 2024

Extensions

More terms from Courtney Clipp (cclipp(AT)ashland.edu), Dec 08 2004

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

A078633 Smallest number of sticks of length 1 needed to construct n squares with sides of length 1.

Original entry on oeis.org

4, 7, 10, 12, 15, 17, 20, 22, 24, 27, 29, 31, 34, 36, 38, 40, 43, 45, 47, 49, 52, 54, 56, 58, 60, 63, 65, 67, 69, 71, 74, 76, 78, 80, 82, 84, 87, 89, 91, 93, 95, 97, 100, 102, 104, 106, 108, 110, 112, 115, 117, 119, 121, 123, 125, 127, 130, 132, 134, 136, 138, 140, 142
Offset: 1

Views

Author

Mambetov Timur and Takenov Nurdin (timur_teufel(AT)mail.ru), Dec 12 2002

Keywords

Comments

A182834(a(n)) mod 2 = 0, or, where even terms occur in A182834. - Reinhard Zumkeller, Aug 05 2014

Examples

			a(2)=7 because we have following construction:
   _ _
  |_|_|
		

Crossrefs

Programs

  • Haskell
    a078633 n = 2 * n + ceiling (2 * sqrt (fromIntegral n))
    -- Reinhard Zumkeller, Aug 05 2014
    
  • Mathematica
    Table[2n+Ceiling[2Sqrt[n]],{n,70}] (* Harvey P. Dale, Jun 20 2011 *)
  • PARI
    a(n) = 2*n + ceil(2*sqrt(n)); \\ Michel Marcus, Mar 26 2018
    
  • Python
    from math import isqrt
    def A078633(n): return (m:=n<<1)+1+isqrt((m<<1)-1) # Chai Wah Wu, Jul 28 2022

Formula

a(n) = 2*n + ceiling(2*sqrt(n)) = 2*n + A027434(n).
a(n) = (4*n + A027709(n))/2. - Tanya Khovanova, Mar 07 2008

A083479 The natural numbers with all terms of A033638 inserted.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 10, 10, 11, 12, 13, 13, 14, 15, 16, 17, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 26, 26, 27, 28, 29, 30, 31, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 43, 44, 45, 46, 47, 48, 49, 50, 50, 51, 52, 53, 54, 55, 56, 57, 57
Offset: 0

Views

Author

Alford Arnold, Jun 08 2003

Keywords

Comments

Row n of A049597 has a(n+1) nonzero values.
When considering the set of nested parabolas defined by -(x^2) + p*x for integer values of p, a(n) tells us how many parabolas are intersected by the line from (1,n) to (n,n). - Gregory R. Bryant, Apr 01 2013
Number of distinct perimeters for polyominoes with n square cells. - Wesley Prosser, Sep 06 2017

Examples

			There are three 1's, one from the natural numbers and two from A033638.
When viewed as an array the sequence begins:
   0
   1
   1  1
   2  2
   3  3  4
   5  5  6
   7  7  8  9
  10 10 11 12
  13 13 14 15 16
  17 17 18 19 20
  21 21 22 23 24 25
  26 26 27 28 29 30
  ...
		

Crossrefs

Programs

  • Haskell
    a083479 n = a083479_list !! n
    a083479_list = m [0..] a033638_list where
       m xs'@(x:xs) ys'@(y:ys) | x <= y    = x : m xs ys'
                               | otherwise = y : m xs' ys
    -- Reinhard Zumkeller, Apr 06 2012
    
  • Magma
    [n eq 0 select 0 else (n+2)-Ceiling(Sqrt(4*n)): n in [0..100]]; // G. C. Greubel, Feb 17 2024
    
  • Mathematica
    Table[(n + 2) - Ceiling@ Sqrt[4 n] - 2 Boole[n == 0], {n, 0, 73}] (* Michael De Vlieger, Sep 05 2017 *)
  • Maxima
    a(n):=((n+2)-ceiling(sqrt(4*n))); /* Gregory R. Bryant, Apr 01 2013 */
    
  • Python
    from math import isqrt
    def A083479(n): return n+1-isqrt((n<<2)-1) if n else 0 # Chai Wah Wu, Jul 28 2022
    
  • SageMath
    [(n+2)-ceil(sqrt(4*n)) -2*int(n==0) for n in range(101)] # G. C. Greubel, Feb 17 2024

Formula

a(n) = (n+2) - ceiling(sqrt(4*n)), for n > 0. - Gregory R. Bryant, Apr 01 2013
From Wesley Prosser, Sep 06 2017: (Start)
a(n) = (n+2) - A027709(n)/2.
a(n) = (n+2) - A027434(n).
a(n) = (2n+2) - A049068(n).
a(n) = (2n+3) - A080037(n).
(End)

Extensions

Edited and extended by David Wasserman, Nov 16 2004

A123663 Number of shared edges in a spiral of n unit squares.

Original entry on oeis.org

0, 1, 2, 4, 5, 7, 8, 10, 12, 13, 15, 17, 18, 20, 22, 24, 25, 27, 29, 31, 32, 34, 36, 38, 40, 41, 43, 45, 47, 49, 50, 52, 54, 56, 58, 60, 61, 63, 65, 67, 69, 71, 72, 74, 76, 78, 80, 82, 84, 85, 87, 89, 91, 93, 95, 97, 98, 100, 102, 104, 106, 108, 110, 112, 113, 115, 117, 119
Offset: 1

Views

Author

Zacariaz Martinez, Nov 15 2006

Keywords

Comments

If one constructs a square (square 1) and then draws another square of identical size beside it (square 2), the squares share 1 edge. If one then places an identical square above square 2 (instead of continuing in a straight path), there are now 2 shared edges. Continuing this pattern in an outward spiral, one finds that the number of shared edges is 4, 5, 7, ...
Numbers a(n) such that a(n+1) = a(n) + 1 are (except for the leading zero) A074148. Otherwise a(n+1) = a(n) + 2. - Franklin T. Adams-Watters, Oct 17 2014.
This sequence is also the maximal number of shared edges among all polyominoes with n square cells. This is the result of Harary and Harborth cited in the references. Once this is known the formula 2n - ceiling(2*sqrt(n)) comes from geometrical considerations and A027709. Namely, the 4n sides of the n squares making up the polyomino form the perimeter and come together in pairs along shared edges. Hence, 4n = perimeter + 2*shared edges. Maximizing shared edges minimizes perimeter and so maximum shared edges = (4n - minimum perimeter)/2 = (4n - 2ceiling(2*sqrt(n)))/2 = 2n - ceiling(2*sqrt(n)). This interpretation is important to landscape ecologists and is called the aggregation index in the GIS program FRAGSTATS. - Julian F. Fleron, Nov 29 2016
a(n) is also the maximum degree of the cover graphs of lattice quotients of lattice congruences of the weak order on the symmetric group S_n. See Table 1 in the Hoang/Mütze reference in the Links section. - Torsten Muetze, Nov 28 2019
a(n) is also the number of pixels in H_{n-1}, where H_n (a pixelated piece of hyperbola x*y = n) is the set of the (x, y), ordered pairs of positive integers, such that x*y = n or (x*y < n and ((x+1)*y > n or x*(y+1) > n)). - Luc Rousseau, Dec 28 2019

References

  • F. Harary and H. Harborth, Extremal Animals, Journal of Combinatorics, Information & System Sciences, Vol. 1, No 1, 1-8 (1976).

Crossrefs

Cf. A002620.

Programs

  • Maple
    A[1]:= 0:
    for n from 2 to 100 do
      if issqr(2*A[n-1]+1) or issqr(2*A[n-1]+2) then A[n]:= A[n-1]+1
      else A[n]:= A[n-1]+2
      fi
    od:
    seq(A[n],n=1..100); # Robert Israel, Oct 21 2014
  • Mathematica
    FoldList[Plus, 0, t = Table[2, {72}]; t[[ Table[ Ceiling[n/2] Floor[n/2], {n, 2, 16}] ]]--; t] (* Robert G. Wilson v, Jan 19 2007 *)
  • PARI
    a(n)=2*n - sqrtint(4*n-1) - 1 \\ Charles R Greathouse IV, Nov 29 2016
    
  • Python
    from math import isqrt
    def A123663(n): return (m:=n<<1)-1-isqrt((m<<1)-1) # Chai Wah Wu, Jul 28 2022
  • Ruby
    a123663 = [0]; k = 0; a_n = 0; (1..N).to_a.each{ |i| 2.times{ k.times{ a_n += 2; a123663 << a_n }; a_n += 1; a123663 << a_n; }; k += 1}
    

Formula

a(n) = 2n - ceiling(2*sqrt(n)). - Julian F. Fleron, Nov 29 2016
a(n) = a(n-1) + 2 - [n-1 is a square or a pronic number], where [] stands for the Iverson bracket. - Luc Rousseau, Dec 28 2019

Extensions

Extended by Robert G. Wilson v, Jan 19 2007

A235382 a(n) = smallest number of unit squares required to enclose n units of area.

Original entry on oeis.org

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

Views

Author

L. Edson Jeffery, Jan 08 2014

Keywords

Comments

Result attributed to the students Daring, et al., in the links section.

Crossrefs

Programs

Formula

a(n) = 2*ceiling(2*sqrt(n)) + 4.
a(n) = A027709(n) + 4.
a(n) = 2*A027434(n) + 4, n>0.

A342243 Triangle T(n,p) read by rows: the number of n-celled polyominoes with perimeter 2p, 2 <= p <= 1+n.

Original entry on oeis.org

1, 0, 1, 0, 0, 2, 0, 0, 1, 4, 0, 0, 0, 1, 11, 0, 0, 0, 1, 7, 27, 0, 0, 0, 0, 4, 21, 83, 0, 0, 0, 0, 2, 21, 91, 255, 0, 0, 0, 0, 1, 9, 89, 339, 847, 0, 0, 0, 0, 0, 6, 67, 393, 1360, 2829, 0, 0, 0, 0, 0, 1, 45, 325, 1713, 5255, 9734, 0, 0, 0, 0, 0, 1, 23, 275
Offset: 1

Views

Author

R. J. Mathar, Mar 07 2021

Keywords

Examples

			The triangle has rows n=1,2,3,... and columns p=2,3,4,5,...:
  1;
  0, 1;
  0, 0, 2;
  0, 0, 1, 4;
  0, 0, 0, 1, 11;
  0, 0, 0, 1,  7, 27;
  0, 0, 0, 0,  4, 21, 83;
  0, 0, 0, 0,  2, 21, 91, 255;
  0, 0, 0, 0,  1,  9, 89, 339,  847;
  0, 0, 0, 0,  0,  6, 67, 393, 1360, 2829;
  0, 0, 0, 0,  0,  1, 45, 325, 1713, 5255, 9734;
  ...
		

Crossrefs

Cf. A000105 (row sums), A057730 (column sums), A131482 (diagonal), A131487 (skew antidiagonal sums), A027709 (number of leading zeros per row), A100092 (first nonzero in each row).

Formula

A131487(e) = Sum_{e=2*n+p} T(n,p).

A100092 Number of n-celled polyominoes with minimum perimeter.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 4, 2, 1, 6, 1, 1, 11, 4, 2, 1, 11, 6, 1, 1, 28, 11, 4, 2, 1, 35, 11, 6, 1, 1, 65, 28, 11, 4, 2, 1, 73, 35, 11, 6, 1, 1, 147, 65, 28, 11, 4, 2, 1, 182, 73, 35, 11, 6, 1, 1, 321, 147, 65, 28, 11, 4, 2, 1, 374, 182, 73, 35, 11, 6, 1, 1, 678, 321, 147, 65, 28, 11, 4, 2, 1
Offset: 0

Views

Author

Sascha Kurz, Nov 03 2004

Keywords

Comments

An n-celled polyomino has minimum perimeter A027709(n) = 2*ceiling(2*sqrt(n)). - Dmitry Kamenetsky, Feb 27 2017

Examples

			a(9) = 1 because the 3 X 3 square is the unique polyomino with minimum perimeter.
		

Crossrefs

Cf. A027709, A100093, A100094, left nonzero term in row n of A342243.

Programs

  • Mathematica
    (* Warning: some local maxima are precomputed from A100094. *)
    A100094 = {2, 4, 11, 28, 65, 147, 321, 678, 1382, 2738, 5289 (* extend if needed *)};
    amax = Last[A100094]; nmax = 144;
    S[x_] := 1 + Sum[ x^(2*n + 1)*Product[ (x^(2*k - 1) - 1), {k, n}], {n, 0, nmax}] + O[x]^nmax;
    A[x_] = Product[1/(1 - x^k), {k, 1, nmax}] + O[x]^nmax // Normal;
    R[x_] := 1/4 (A[x]^4 + 3A[x^2]^2) + O[x]^nmax;
    Q[x_] := 1/8 (A[x]^4 + 3A[x^2]^2 + 2S[x]^2 A[x^2] + 2A[x^4]) + O[x]^nmax;
    r[k_] := SeriesCoefficient[R[x], {x, 0, k}];
    q[k_] := SeriesCoefficient[Q[x], {x, 0, k}];
    e[n_] := Module[{s, w}, s = Floor[Sqrt[n]]; a94Q[k_] := IntegerQ[w = Sqrt[k + n] - k] && w > 0; Which[Evaluate[Sequence @@ Flatten[Table[{a94Q[k], A100094[[k]]}, {k, 3, Length[A100094]}]]], n == s^2, 1, IntegerQ[t = n - s^2] && 0 < t < s, Sum[r[s - c - c^2 - t], {c, 0, Floor[-1/2 + (1/2)* Sqrt[1 + 4 s - 4 t]]}], n == s^2 + s, 1, IntegerQ[t = n - s^2 - s] && 0 < t <= s, q[s + 1 - t] + Sum[r[s + 1 - c^2 - t], {c, 1, Floor[Sqrt[s + 1 - t]]}], True, Print["error n = ", n]]];
    Select[Table[e[n], {n, 0, nmax}], # <= amax&] (* Jean-François Alcover, Jul 20 2018 *)

Formula

It seems that for m >= 1, 0 <= k <= m-1, we have a(m^2-k) = a(k^2+k+1) = A100094(k) and a(m^2+m-k) = a((k+1)^2+1) = A100093(k+1). If this is true, then a(n) = 1 if and only if n is of the form m^2, m^2 + m - 1 or m^2 + m. - Jianing Song, Aug 10 2021

Extensions

Offset changed to 0 by N. J. A. Sloane, Mar 19 2017

A069813 Maximum number of triangles in polyiamond with perimeter n.

Original entry on oeis.org

1, 2, 3, 6, 7, 10, 13, 16, 19, 24, 27, 32, 37, 42, 47, 54, 59, 66, 73, 80, 87, 96, 103, 112, 121, 130, 139, 150, 159, 170, 181, 192, 203, 216, 227, 240, 253, 266, 279, 294, 307, 322, 337, 352, 367, 384, 399, 416, 433, 450, 467, 486, 503, 522, 541, 560, 579
Offset: 3

Views

Author

Winston C. Yang (winston(AT)cs.wisc.edu), Apr 30 2002

Keywords

Examples

			a(10) = 16 because the maximum number of triangles in a polyiamond of perimeter 10 is 16.
		

Crossrefs

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 65); Coefficients(R!( x^3*(x^2-x-1)*(x^2+1)/((x-1)^3*(x+1)*(x^2+x+1)))); // Marius A. Burtea, Jan 03 2020
  • Maple
    A069813 := proc(n)
        round(n^2/6) ;
        if modp(n,6) <> 0 then
            %-1 ;
        else
            % ;
        end if;
    end proc: # R. J. Mathar, Jul 14 2015
  • Mathematica
    LinearRecurrence[{1, 1, 0, -1, -1, 1}, {1, 2, 3, 6, 7, 10}, 60] (* Jean-François Alcover, Jan 03 2020 *)
  • PARI
    a(n) = round(n^2/6) - (n % 6 != 0) \\ Michel Marcus, Jul 17 2013
    
  • PARI
    Vec(x^3*(x^2-x-1)*(x^2+1)/((x-1)^3*(x+1)*(x^2+x+1)) + O(x^60)) \\ Colin Barker, Jan 19 2015
    

Formula

a(n) = round(n^2/6) - (0 if n = 0 mod 6, 1 else) = A056829(n)-A097325(n).
From Colin Barker, Jan 18 2015: (Start)
a(n) = round((-25 + 9*(-1)^n + 8*exp(-2/3*i*n*Pi) + 8*exp((2*i*n*Pi)/3) + 6*n^2)/36), where i=sqrt(-1).
G.f.: x^3*(1+x-x^2)*(1+x^2) / ((1-x)^3*(1+x)*(1+x+x^2)). (End)
a(n) = A001399(n-3) + A001399(n-4) + A001399(n-6) - A001399(n-7). - R. J. Mathar, Jul 14 2015
Showing 1-10 of 17 results. Next