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-5 of 5 results.

A008133 a(n) = floor(n/3)*floor((n+1)/3).

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 4, 4, 6, 9, 9, 12, 16, 16, 20, 25, 25, 30, 36, 36, 42, 49, 49, 56, 64, 64, 72, 81, 81, 90, 100, 100, 110, 121, 121, 132, 144, 144, 156, 169, 169, 182, 196, 196, 210, 225, 225, 240, 256, 256, 272, 289, 289, 306, 324, 324, 342, 361, 361, 380, 400, 400, 420, 441, 441, 462, 484, 484, 506
Offset: 0

Views

Author

Keywords

Comments

Oblong numbers and squares are subsequences: a(A016789(n)) = A002378(n); a(A008585(n)) = a(A016777(n)) = A000290(n). - Reinhard Zumkeller, Oct 09 2011

Crossrefs

Programs

  • Haskell
    a008133 n = a008133_list !! n
    a008133_list = zipWith (*) (tail ts) ts where ts = map (`div` 3) [0..]
    -- Reinhard Zumkeller, Oct 09 2011
    
  • Magma
    [Floor(n/3)*Floor((n+1)/3): n in [0..60]]; // Vincenzo Librandi, Aug 20 2011
    
  • Mathematica
    Table[Floor[n/3]Floor[(n+1)/3],{n,0,100}] (* or *) LinearRecurrence[{1,0,2,-2,0,-1,1},{0,0,0,1,1,2,4},100] (* Harvey P. Dale, Sep 21 2024 *)
  • PARI
    a(n) = floor(n/3)*floor((n+1)/3); /* Joerg Arndt, Mar 31 2013 */

Formula

From Paul Barry, Sep 14 2003: (Start)
Partial sums of A087509.
a(n+1) = Sum_{j=0..n} Sum_{k=0..j} [mod(j*k, 3)=2], where [] is the Iverson bracket. (End)
Empirical g.f.: -x^3*(x^2+1) / ((x-1)^3*(x^2+x+1)^2). - Colin Barker, Mar 31 2013
From Amiram Eldar, May 10 2025: (Start)
Sum_{n>=3} 1/a(n) = Pi^2/3 + 1.
Sum_{n>=3} (-1)^(n+1)/a(n) = 2*log(2)-1. (End)

A087508 Number of k such that mod(k*n,3) = 1 for 0 <= k <= n.

Original entry on oeis.org

0, 1, 1, 0, 2, 2, 0, 3, 3, 0, 4, 4, 0, 5, 5, 0, 6, 6, 0, 7, 7, 0, 8, 8, 0, 9, 9, 0, 10, 10, 0, 11, 11, 0, 12, 12, 0, 13, 13, 0, 14, 14, 0, 15, 15, 0, 16, 16, 0, 17, 17, 0, 18, 18, 0, 19, 19, 0, 20, 20, 0, 21, 21, 0, 22, 22, 0, 23, 23, 0, 24, 24, 0, 25, 25, 0, 26, 26, 0, 27, 27, 0, 28, 28, 0
Offset: 0

Views

Author

Paul Barry, Sep 11 2003

Keywords

Examples

			a(4) = 2 because k=1 and k=4 satisfy the equation.
		

Crossrefs

Programs

  • Magma
    I:=[0,1,1,0,2,2]; [n le 6 select I[n] else 2*Self(n-3) - Self(n-6): n in [1..100]]; // Vincenzo Librandi, Sep 22 2015
    
  • Mathematica
    LinearRecurrence[{0,0,2,0,0,-1}, {0,1,1,0,2,2}, 100] (* Vincenzo Librandi, Sep 22 2015 *)
    Table[PadRight[{0},3,n],{n,30}]//Flatten (* Harvey P. Dale, Jan 27 2021 *)
  • PARI
    concat(0,Vec((1+x)/(1-x^3)^2 +O(x^99))) \\ Charles R Greathouse IV, Oct 24 2014
    
  • PARI
    a(n) = sum(k=0, n, Mod(k*n, 3)==1); \\ Michel Marcus, Sep 27 2017
    
  • SageMath
    @CachedFunction
    def A087508(n):
        if (n<6): return (0,1,1,0,2,2)[n]
        else: return 2*A087508(n-3) - A087508(n-6)
    [A087508(n) for n in (0..100)] # G. C. Greubel, Sep 02 2022

Formula

a(n) = A000027(n) - A087509(n) - A087507(n).
a(n) = (2/3)*(floor(n/3)+1)*(1-cos(2*Pi*n/3)).
G.f.: x*(1 + x)/(1 - x^3)^2. - Arkadiusz Wesolowski, May 28 2013
a(n) = sin(n*Pi/3)*((4n+6)*sin(n*Pi/3)-sqrt(3)*cos(n*Pi))/9. - Wesley Ivan Hurt, Sep 24 2017

A087507 #{0<=k<=n: k*n is divisible by 3}.

Original entry on oeis.org

1, 1, 1, 4, 2, 2, 7, 3, 3, 10, 4, 4, 13, 5, 5, 16, 6, 6, 19, 7, 7, 22, 8, 8, 25, 9, 9, 28, 10, 10, 31, 11, 11, 34, 12, 12, 37, 13, 13, 40, 14, 14, 43, 15, 15, 46, 16, 16, 49, 17, 17, 52, 18, 18, 55, 19, 19, 58, 20, 20, 61, 21, 21, 64, 22, 22, 67, 23, 23, 70, 24, 24, 73, 25, 25, 76
Offset: 0

Views

Author

Paul Barry, Sep 11 2003

Keywords

Crossrefs

Cf. A016777 (trisection).

Programs

  • PARI
    Vec((2*x^3+x^2+x+1)/((x-1)^2*(x^2+x+1)^2) + O(x^100)) \\ Colin Barker, May 02 2015

Formula

a(n) = sum{k=0..n, if (mod(kn, 3)=0, 1, 0) }.
a(n) = floor(n/3)(5/3+4/3cos(2Pi*/3))+1.
a(n)+A087508(n)+A087509(n) = n.
a(n) = 2*a(n-3)-a(n-6) for n>5. - Colin Barker, May 02 2015
G.f.: (2*x^3+x^2+x+1) / ((x-1)^2*(x^2+x+1)^2). - Colin Barker, May 02 2015

A077814 a(n) = #{0<=k<=n: mod(k*n,4)=2}.

Original entry on oeis.org

0, 0, 1, 1, 0, 1, 3, 2, 0, 2, 5, 3, 0, 3, 7, 4, 0, 4, 9, 5, 0, 5, 11, 6, 0, 6, 13, 7, 0, 7, 15, 8, 0, 8, 17, 9, 0, 9, 19, 10, 0, 10, 21, 11, 0, 11, 23, 12, 0, 12, 25, 13, 0, 13, 27, 14, 0, 14, 29, 15, 0, 15, 31, 16, 0, 16, 33, 17, 0, 17, 35, 18, 0, 18, 37, 19, 0, 19, 39, 20, 0, 20, 41, 21, 0
Offset: 0

Views

Author

John W. Layman, Dec 03 2002

Keywords

Comments

Coefficients in the unique expansion of e/4 = Sum_{n>=1} a(n)/n!, where a(n) satisfies 0<=a(n)

Examples

			a(6) = #{1, 3, 5} = 3.
		

Crossrefs

Programs

  • Mathematica
    a = Table[0, {i, 1, 50}]; x = Exp[1]/4; For[n = 2, n <= 51, n++, { an = 0; While [(x >= (1/n!)) && (an < (n - 1)), {an++, x = x - (1/n!)} ]}; a[[n - 1]] = an;]; a
    LinearRecurrence[{2,-3,4,-3,2,-1},{0,0,1,1,0,1},90] (* Harvey P. Dale, Apr 07 2025 *)

Formula

a(n)=0 if n=4k, a(n)=k if n=4k+1, a(n)=2k+1 if n=4k+2 and a(n)=k+1 if n=4k+3.
a(n) = floor(n!*e/4) - n*floor((n-1)!*e/4). - Benoit Cloitre, Dec 07 2002
a(n) = Sum_{k=0..n} if(mod(k*n, 4)=2, 1, 0). - Paul Barry, Sep 10 2003
O.g.f.: x^2*(1-x+x^2)/((x-1)^2*(1+x^2)^2). - R. J. Mathar, Jun 13 2008
From Wesley Ivan Hurt, May 30 2015: (Start)
a(n) = 2*a(n-1)-3*a(n-2)+4*a(n-3)-3*a(n-4)+2*a(n-5)-a(n-6), n>6.
a(n) = (-1)^((1-2*n-(-1)^n)/4)*((-1)^n-2*n*(-1)^((2*n+3+(-1)^n)/4)+n*(-1)^((1+(-1)^n)/2)+n*(-1)^((2*n+1+(-1)^n)/2)-1)/8. (End)

Extensions

More terms from Benoit Cloitre, Dec 07 2002

A136493 Triangle of coefficients of characteristic polynomials of symmetrical pentadiagonal matrices of the type (1,-1,1,-1,1).

Original entry on oeis.org

1, -1, 1, 1, -2, 0, -1, 3, 0, 0, 1, -4, 1, 2, 0, -1, 5, -3, -5, 1, 1, 1, -6, 6, 8, -5, -2, 1, -1, 7, -10, -10, 14, 4, -4, 0, 1, -8, 15, 10, -29, -4, 12, 0, 0, -1, 9, -21, -7, 50, -4, -30, 4, 4, 0, 1, -10, 28, 0, -76, 28, 61, -20, -15, 2, 1
Offset: 0

Author

Roger L. Bagula, Mar 21 2008

Keywords

Comments

From Georg Fischer, Mar 29 2021: (Start)
The pentadiagonal matrices have 1 in the main diagonal, -1 in the first lower and upper diagonal, 1 in the second lower and upper diagonal, and 0 otherwise.
The linear recurrences that yield A124805, A124806, A124807 and similar can be derived from the rows of this triangle (the first element of a row must be removed and multiplied onto the remaining elements).
This observation extends to other sequences. For example the linear recurrence signature (5,-6,2,4,0) of A124698 "Number of base 5 circular n-digit numbers with adjacent digits differing by 1 or less" can be derived from the coefficients of the characteristic polynomial of a tridiagonal (type -1,1,-1) 5 X 5 matrix.
(End)

Examples

			Triangle begins:
   1;
  -1,   1;
   1,  -2,   0;
  -1,   3,   0,   0;
   1,  -4,   1,   2,   0;
  -1,   5,  -3,  -5,   1,  1;
   1,  -6,   6,   8,  -5, -2,   1;
  -1,   7, -10, -10,  14,  4,  -4,   0;
   1,  -8,  15,  10, -29, -4,  12,   0,   0;
  -1,   9, -21,  -7,  50, -4, -30,   4,   4,  0;
   1, -10,  28,   0, -76, 28,  61, -20, -15,  2,  1;
		

References

  • Anthony Ralston and Philip Rabinowitz, A First Course in Numerical Analysis, 1978, ISBN 0070511586, see p. 256.

Crossrefs

Programs

  • Mathematica
    T[n_, m_]:= Piecewise[{{-1, 1+m==n || m==1+n}, {1, 2+m==n || m==n || m==2+n}}];
    MO[d_]:= Table[T[n, m], {n,d}, {m,d}];
    CL[n_]:= CoefficientList[CharacteristicPolynomial[MO[n], x], x];
    Join[{{1}}, Table[Reverse[CL[n]], {n,10}]]//Flatten
    (* For the signature of A124698 added by Georg Fischer, Mar 29 2021 : *)
    Reverse[CoefficientList[CharacteristicPolynomial[{{1,-1,0,0,0}, {-1, 1,-1,0,0}, {0,-1,1,-1,0}, {0,0,-1,1,-1}, {0,0,0,-1,1}}, x], x]]

Formula

Sum_{k=1..n} T(n, k) = (-1)^(n mod 3) * A087509(n+1) + [n=1].
From G. C. Greubel, Aug 01 2023: (Start)
T(n, n) = A011658(n+2).
T(n, 1) = (-1)^(n-1).
T(n, 2) = A181983(n-1).
T(n, 3) = (-1)^(n-3)*A161680(n-3). (End)

Extensions

Edited by Georg Fischer, Mar 29 2021
Showing 1-5 of 5 results.