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

A056827 a(n) = floor(n^2/6).

Original entry on oeis.org

0, 0, 0, 1, 2, 4, 6, 8, 10, 13, 16, 20, 24, 28, 32, 37, 42, 48, 54, 60, 66, 73, 80, 88, 96, 104, 112, 121, 130, 140, 150, 160, 170, 181, 192, 204, 216, 228, 240, 253, 266, 280, 294, 308, 322, 337, 352, 368, 384, 400, 416, 433, 450, 468, 486, 504
Offset: 0

Views

Author

N. J. A. Sloane, Sep 02 2000

Keywords

Comments

a(n-1) represents the floor of the area under the polygon connecting the lattice points (n, floor(n/3)) from 0..n, n>0 (see example). - Wesley Ivan Hurt, Jun 06 2014

Examples

			5|                                             .__.__.
.|                                            /|  |  |
4|                                    .__.__./_|__|__|
.|                                   /|  |  |  |  |  |
3|                           .__.__./_|__|__|__|__|__|
.|                          /|  |  |  |  |  |  |  |  |
2|                  .__.__./_|__|__|__|__|__|__|__|__|
.|                 /|  |  |  |  |  |  |  |  |  |  |  |
1|         .__.__./_|__|__|__|__|__|__|__|__|__|__|__|
.|        /|  |  |  |  |  |  |  |  |  |  |  |  |  |  |
0|.__.__./_|__|__|__|__|__|__|__|__|__|__|__|__|__|__|_________________
  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17   .. n
  0  0  0  1  2  4  6  8 10 13 16 20 24 28 32 37 42 48   .. a(n)
     0  0  0  1  2  4  6  8 10 13 16 20 24 28 32 37 42   .. a(n-1) <--
		

Crossrefs

Programs

Formula

From R. J. Mathar, Nov 22 2008: (Start)
G.f.: x^3*(1+x^2)/((1+x)*(1-x)^3*(1+x+x^2)*(1-x+x^2)).
a(n+1) - a(n) = A123919(n). (End)
a(n) = floor( (1/2) * Sum_{i=1..n+1} (ceiling(i/3) + floor(i/3) - 1) ). - Wesley Ivan Hurt, Jun 06 2014
Sum_{n>=3} 1/a(n) = 15/8 + Pi^2/36 - Pi/(4*sqrt(3)) + tan(Pi/(2*sqrt(3)))*Pi/(2*sqrt(3)). - Amiram Eldar, Aug 13 2022

A123920 Number of numbers congruent to 2 or 4 mod 6 between n and 2n inclusive.

Original entry on oeis.org

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

Views

Author

Giovanni Teofilatto, Oct 29 2006

Keywords

Crossrefs

Cf. A123919.

Programs

  • GAP
    a:=[1,2,1,2,2,2,3];; for n in [8..80] do a[n]:=a[n-1]+a[n-6]-a[n-7]; od; a; # G. C. Greubel, Aug 07 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 80); Coefficients(R!( x*(1+x-x^2+x^3)/((1-x)*(1-x^6)) )); // G. C. Greubel, Aug 07 2019
    
  • Maple
    seq(coeff(series(x*(1+x-x^2+x^3)/((1-x)*(1-x^6)), x, n+1), x, n), n = 1..80); # G. C. Greubel, Aug 07 2019
  • Mathematica
    f[n_]:= Floor[n/2] - Floor[n/6]; Table[f[2n] - f[n-1], {n, 80}] (* Robert G. Wilson v *)
    Table[Count[Range[n,2n],?(MemberQ[{2,4},Mod[#,6]]&)],{n,80}] (* _Harvey P. Dale, Mar 25 2019 *)
    LinearRecurrence[{1,0,0,0,0,1,-1}, {1,2,1,2,2,2,3}, 80] (* G. C. Greubel, Aug 07 2019 *)
  • PARI
    my(x='x+O('x^80)); Vec(x*(1+x-x^2+x^3)/((1-x)*(1-x^6))) \\ G. C. Greubel, Aug 07 2019
    
  • Sage
    def A123920_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( x*(1+x-x^2+x^3)/((1-x)*(1-x^6)) ).list()
    a=A123920_list(80); a[1:] # G. C. Greubel, Aug 07 2019
    

Formula

a(n) = 2k - 1 for n = {6k - 5, 6k - 3}, where k = 1,2,3,... a(n) = 2k for n = {6k - 4, 6k - 2, 6k - 1, 6k}, where k = 1,2,3,... - Alexander Adamchuk, Nov 08 2006
G.f.: x*(1+x-x^2+x^3)/((1-x)*(1-x^6)). - G. C. Greubel, Aug 07 2019

Extensions

Corrected and extended by Robert G. Wilson v, Oct 29 2006
More terms from Alexander Adamchuk, Nov 08 2006
Showing 1-2 of 2 results.