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.

A345118 a(n) is the sum of the lengths of all the segments used to draw a square of side n representing a basketweave pattern where all the multiple strands are of unit width, the horizontal ones appearing as 1 X 3 rectangles, while the vertical ones as unit area squares.

Original entry on oeis.org

0, 4, 11, 20, 34, 50, 69, 92, 116, 144, 175, 208, 246, 286, 329, 376, 424, 476, 531, 588, 650, 714, 781, 852, 924, 1000, 1079, 1160, 1246, 1334, 1425, 1520, 1616, 1716, 1819, 1924, 2034, 2146, 2261, 2380, 2500, 2624, 2751, 2880, 3014, 3150, 3289, 3432, 3576, 3724
Offset: 0

Views

Author

Stefano Spezia, Jun 08 2021

Keywords

Examples

			Illustrations for n = 1..8:
        _           _ _          _ _ _
       |_|         |_|_|        |_ _ _|
                   |_ _|        |_|_|_|
                                |_ _ _|
    a(1) = 4     a(2) = 11     a(3) = 20
     _ _ _ _     _ _ _ _ _    _ _ _ _ _ _
    |_ _|_|_|   |_ _|_|_ _|  |_|_|_ _ _|_|
    |_|_ _ _|   |_|_ _ _|_|  |_ _ _|_|_ _|
    |_ _|_|_|   |_ _|_|_ _|  |_|_|_ _ _|_|
    |_|_ _ _|   |_|_ _ _|_|  |_ _ _|_|_ _|
                |_ _|_|_ _|  |_|_|_ _ _|_|
                             |_ _ _|_|_ _|
    a(4) = 34    a(5) = 50     a(6) = 69
      _ _ _ _ _ _ _      _ _ _ _ _ _ _ _
     |_|_|_ _ _|_|_|    |_ _|_|_ _ _|_|_|
     |_ _ _|_|_ _ _|    |_|_ _ _|_|_ _ _|
     |_|_|_ _ _|_|_|    |_ _|_|_ _ _|_|_|
     |_ _ _|_|_ _ _|    |_|_ _ _|_|_ _ _|
     |_|_|_ _ _|_|_|    |_ _|_|_ _ _|_|_|
     |_ _ _|_|_ _ _|    |_|_ _ _|_|_ _ _|
     |_|_|_ _ _|_|_|    |_ _|_|_ _ _|_|_|
                        |_|_ _ _|_|_ _ _|
        a(7) = 92           a(8) = 116
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{3,-3,1,-1,3,-3,1},{0,4,11,20,34,50,69},50]
    a[ n_] := (3*n^2 + 5*n)/2 - (-1)^Floor[n/4]*Boole[Mod[n, 4] == 3]; (* Michael Somos, Jan 25 2024 *)
  • PARI
    concat(0, Vec(x*(4 - x - x^2 + 3*x^3 + x^4)/((1 - x)^3*(1 + x^4)) + O(x^40))) \\ Felix Fröhlich, Jun 09 2021
    
  • PARI
    {a(n) = (3*n^2 + 5*n)/2 - (-1)^(n\4)*(n%4==3)}; /* Michael Somos, Jan 25 2024 */

Formula

O.g.f.: x*(4 - x - x^2 + 3*x^3 + x^4)/((1 - x)^3*(1 + x^4)).
E.g.f.: (exp(x)*x*(8 + 3*x) + (-1)^(1/4)*(sinh((-1)^(1/4)*x) - sin((-1)^(1/4)*x)))/2.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) - a(n-4) + 3*a(n-5) - 3*a(n-6) + a(n-7) for n > 6.
a(n) = (n*(5 + 3*n) - (1 - (-1)^n)*sin((n-1)*Pi/4))/2.
a(n) = A211014(n/2) - A000035(n)*A056594((n-3)/2).
a(2*n) = A211014(n).
a(k) = A115067(k+1) for k not congruent to 3 mod 4 (A004773).
From Helmut Ruhland, Jan 29 2024: (Start)
For n > 1: a(n) - (2 * A368052(n+2) + A368052(n+3)) * 2 is periodic for n mod 8, i.e. a(n) = (2 * A368052(n+2) + A368052(n+3)) * 2 + f8(n) with
n mod 8 = 0 1 2 3 4 5 6 7
f8(n) = 0 0 -3 -2 -2 -2 1 0 (End)