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

A253607 First differences of A253580, when the tree is seen as flattened list.

Original entry on oeis.org

1, -1, 2, 1, -2, -1, 2, 2, 1, -2, -2, -1, 2, 2, 2, 1, -2, -2, -2, -1, 2, 2, 2, 2, 1, -2, -2, -2, -2, -1, 2, 2, 2, 2, 2, 1, -2, -2, -2, -2, -2, -1, 2, 2, 2, 2, 2, 2, 1, -2, -2, -2, -2, -2, -2, -1, 2, 2, 2, 2, 2, 2, 2, 1, -2, -2, -2, -2, -2, -2, -2, -1, 2, 2
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 05 2015

Keywords

Comments

a(n) != 0 and -2 <= a(n) <= +2.
a(n) = 1 iff A253580(n+1) = A253580(n) + 1, marked with X in the table below, where also the erasure of pairs of consecutive terms in A253580 is illustrated;
a(A005563(n)) = 1; a(A028387(n)) = -1;
a(A061885(n)) > 0; a(A064801(n)) < 0.

Examples

			.   n | A253580(n) | a(n) | erased | reappearing
.  ---+------------+------+--------+-------------
.   0 |    X    0  |   1  |      0 |
.   1 |    X    1  |  -1  |      1 |
.   2 |         0  |   2  |        |           0
.   3 |    X    2  |   1  |      2 |
.   4 |    X    3  |  -2  |      3 |
.   5 |         1  |  -1  |        |           1
.   6 |         0  |   2  |        |           0
.   7 |         2  |   2  |        |           2
.   8 |    X    4  |   1  |      4 |
.   9 |    X    5  |  -2  |      5 |
.  10 |         3  |  -2  |        |           3
.  11 |         1  |  -1  |        |           1
.  12 |         0  |   2  |        |           0
.  13 |         2  |   2  |        |           2
.  14 |         4  |   2  |        |           4
.  15 |    X    6  |   1  |      6 |
.  16 |    X    7  |  -2  |      7 |
.  17 |         5  |  -2  |        |           5
.  18 |         3  |  -2  |        |           3
.  19 |         1  |  -1  |        |           1
.  20 |         0  |   2  |        |           0
.  21 |         2  |   2  |        |           2
.  22 |         4  |   2  |        |           4
.  23 |         6  |   2  |        |           6
.  24 |    X    8  |   1  |      8 |
.  25 |    X    9  |  -2  |      9 |             .
		

Crossrefs

Programs

  • Haskell
    a253607 n = a253607_list !! n
    a253607_list = zipWith (-) (tail a253580_list) a253580_list

A014105 Second hexagonal numbers: a(n) = n*(2*n + 1).

Original entry on oeis.org

0, 3, 10, 21, 36, 55, 78, 105, 136, 171, 210, 253, 300, 351, 406, 465, 528, 595, 666, 741, 820, 903, 990, 1081, 1176, 1275, 1378, 1485, 1596, 1711, 1830, 1953, 2080, 2211, 2346, 2485, 2628, 2775, 2926, 3081, 3240, 3403, 3570, 3741, 3916, 4095, 4278
Offset: 0

Views

Author

N. J. A. Sloane, Jun 14 1998

Keywords

Comments

Note that when starting from a(n)^2, equality holds between series of first n+1 and next n consecutive squares: a(n)^2 + (a(n) + 1)^2 + ... + (a(n) + n)^2 = (a(n) + n + 1)^2 + (a(n) + n + 2)^2 + ... + (a(n) + 2*n)^2; e.g., 10^2 + 11^2 + 12^2 = 13^2 + 14^2. - Henry Bottomley, Jan 22 2001; with typos fixed by Zak Seidov, Sep 10 2015
a(n) = sum of second set of n consecutive even numbers - sum of the first set of n consecutive odd numbers: a(1) = 4-1, a(3) = (8+10+12) - (1+3+5) = 21. - Amarnath Murthy, Nov 07 2002
Partial sums of odd numbers 3 mod 4, that is, 3, 3+7, 3+7+11, ... See A001107. - Jon Perry, Dec 18 2004
If Y is a fixed 3-subset of a (2n+1)-set X then a(n) is the number of (2n-1)-subsets of X intersecting Y. - Milan Janjic, Oct 28 2007
More generally (see the first comment), for n > 0, let b(n,k) = a(n) + k*(4*n + 1). Then b(n,k)^2 + (b(n,k) + 1)^2 + ... + (b(n,k) + n)^2 = (b(n,k) + n + 1 + 2*k)^2 + ... + (b(n,k) + 2*n + 2*k)^2 + k^2; e.g., if n = 3 and k = 2, then b(n,k) = 47 and 47^2 + ... + 50^2 = 55^2 + ... + 57^2 + 2^2. - Charlie Marion, Jan 01 2011
Sequence found by reading the line from 0, in the direction 0, 10, ..., and the line from 3, in the direction 3, 21, ..., in the square spiral whose vertices are the triangular numbers A000217. - Omar E. Pol, Nov 09 2011
a(n) is the number of positions of a domino in a pyramidal board with base 2n+1. - César Eliud Lozada, Sep 26 2012
Differences of row sums of two consecutive rows of triangle A120070, i.e., first differences of A016061. - J. M. Bergot, Jun 14 2013 [In other words, the partial sums of this sequence give A016061. - Leo Tavares, Nov 23 2021]
a(n)*Pi is the total length of half circle spiral after n rotations. See illustration in links. - Kival Ngaokrajang, Nov 05 2013
For corresponding sums in first comment by Henry Bottomley, see A059255. - Zak Seidov, Sep 10 2015
a(n) also gives the dimension of the simple Lie algebras B_n (n >= 2) and C_n (n >= 3). - Wolfdieter Lang, Oct 21 2015
With T_(i+1,i)=a(i+1) and all other elements of the lower triangular matrix T zero, T is the infinitesimal generator for unsigned A130757, analogous to A132440 for the Pascal matrix. - Tom Copeland, Dec 13 2015
Partial sums of squares with alternating signs, ending in an even term: a(n) = 0^2 - 1^2 +- ... + (2*n)^2, cf. Example & Formula from Berselli, 2013. - M. F. Hasler, Jul 03 2018
Also numbers k with the property that in the symmetric representation of sigma(k) the smallest Dyck path has a central peak and the largest Dyck path has a central valley, n > 0. (Cf. A237593.) - Omar E. Pol, Aug 28 2018
a(n) is the area of a triangle with vertices at (0,0), (2*n+1, 2*n), and ((2*n+1)^2, 4*n^2). - Art Baker, Dec 12 2018
This sequence is the largest subsequence of A000217 such that gcd(a(n), 2*n) = a(n) mod (2*n) = n, n > 0 up to a given value of n. It is the interleave of A033585 (a(n) is even) and A033567 (a(n) is odd). - Torlach Rush, Sep 09 2019
A generalization of Hasler's Comment (Jul 03 2018) follows. Let P(k,n) be the n-th k-gonal number. Then for k > 1, partial sums of {P(k,n)} with alternating signs, ending in an even term, = n*((k-2)*n + 1). - Charlie Marion, Mar 02 2021
Let U_n(H) = {A in M_n(H): A*A^H = I_n} be the group of n X n unitary matrices over the quaternions (A^H is the conjugate transpose of A. Note that over the quaternions we still have A*A^H = I_n <=> A^H*A = I_n by mapping A and A^H to (2n) X (2n) complex matrices), then a(n) is the dimension of its Lie algebra u_n(H) = {A in M_n(H): A + A^H = 0} as a real vector space. A basis is given by {(E_{st}-E_{ts}), i*(E_{st}+E_{ts}), j*(E_{st}+E_{ts}), k*(E_{st}+E_{ts}): 1 <= s < t <= n} U {i*E_{tt}, j*E_{tt}, k*E_{tt}: t = 1..n}, where E_{st} is the matrix with all entries zero except that its (st)-entry is 1. - Jianing Song, Apr 05 2021

Examples

			For n=6, a(6) = 0^2 - 1^2 + 2^2 - 3^2 + 4^2 - 5^2 + 6^2 - 7^2 + 8^2 - 9^2 + 10^2 - 11^2 + 12^2 = 78. - _Bruno Berselli_, Aug 29 2013
		

References

  • Louis Comtet, Advanced Combinatorics, Reidel, 1974, pp. 77-78. (In the integral formula on p. 77 a left bracket is missing for the cosine argument.)

Crossrefs

Second column of array A094416.
Equals A033586(n) divided by 4.
See Comments of A132124.
Second n-gonal numbers: A005449, A147875, A045944, A179986, A033954, A062728, A135705.
Row sums in triangle A253580.

Programs

Formula

a(n) = 3*Sum_{k=1..n} tan^2(k*Pi/(2*(n + 1))). - Ignacio Larrosa Cañestro, Apr 17 2001
a(n)^2 = n*(a(n) + 1 + a(n) + 2 + ... + a(n) + 2*n); e.g., 10^2 = 2*(11 + 12 + 13 + 14). - Charlie Marion, Jun 15 2003
From N. J. A. Sloane, Sep 13 2003: (Start)
G.f.: x*(3 + x)/(1 - x)^3.
E.g.f.: exp(x)*(3*x + 2*x^2).
a(n) = A000217(2*n) = A000384(-n). (End)
a(n) = A084849(n) - 1; A100035(a(n) + 1) = 1. - Reinhard Zumkeller, Oct 31 2004
a(n) = A126890(n, k) + A126890(n, n-k), 0 <= k <= n. - Reinhard Zumkeller, Dec 30 2006
a(2*n) = A033585(n); a(3*n) = A144314(n). - Reinhard Zumkeller, Sep 17 2008
a(n) = a(n-1) + 4*n - 1 (with a(0) = 0). - Vincenzo Librandi, Dec 24 2010
a(n) = Sum_{k=0.2*n} (-1)^k*k^2. - Bruno Berselli, Aug 29 2013
a(n) = A242342(2*n + 1). - Reinhard Zumkeller, May 11 2014
a(n) = Sum_{k=0..2} C(n-2+k, n-2) * C(n+2-k, n), for n > 1. - J. M. Bergot, Jun 14 2014
a(n) = floor(Sum_{j=(n^2 + 1)..((n+1)^2 - 1)} sqrt(j)). Fractional portion of each sum converges to 1/6 as n -> infinity. See A247112 for a similar summation sequence on j^(3/2) and references to other such sequences. - Richard R. Forberg, Dec 02 2014
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n >= 3, with a(0) = 0, a(1) = 3, and a(2) = 10. - Harvey P. Dale, Feb 10 2015
Sum_{n >= 1} 1/a(n) = 2*(1 - log(2)) = 0.61370563888010938... (A188859). - Vaclav Kotesovec, Apr 27 2016
From Wolfdieter Lang, Apr 27 2018: (Start)
a(n) = trinomial(2*n, 2) = trinomial(2*n, 2*(2*n-1)), for n >= 1, with the trinomial irregular triangle A027907; i.e., trinomial(n,k) = A027907(n,k).
a(n) = (1/Pi) * Integral_{x=0..2} (1/sqrt(4 - x^2)) * (x^2 - 1)^(2*n) * R(4*(n-1), x), for n >= 0, with the R polynomial coefficients given in A127672, and R(-m, x) = R(m, x). [See Comtet, p. 77, the integral formula for q = 3, n -> 2*n, k = 2, rewritten with x = 2*cos(phi).] (End)
a(n) = A002943(n)/2. - Ralf Steiner, Jul 23 2019
a(n) = A000290(n) + A002378(n). - Torlach Rush, Nov 02 2020
a(n) = A003215(n) - A000290(n+1). See Squared Hexagons illustration. Leo Tavares, Nov 23 2021
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/2 + log(2) - 2. - Amiram Eldar, Nov 28 2021

Extensions

Link added and minor errors corrected by Johannes W. Meijer, Feb 04 2010

A196199 Count up from -n to n for n = 0, 1, 2, ... .

Original entry on oeis.org

0, -1, 0, 1, -2, -1, 0, 1, 2, -3, -2, -1, 0, 1, 2, 3, -4, -3, -2, -1, 0, 1, 2, 3, 4, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8
Offset: 0

Views

Author

Keywords

Comments

This sequence contains every integer infinitely often, hence all integer sequences are subsequences.
This is a fractal sequence.
Indeed, if all terms (a(n),a(n+1)) such that a(n+1) does NOT equal a(n)+1 (<=> a(n+1) < a(n)) are deleted, the same sequence is recovered again. See A253580 for an "opposite" yet similar "fractal tree" construction. - M. F. Hasler, Jan 04 2015

Examples

			Table starts:
            0,
        -1, 0, 1,
    -2, -1, 0, 1, 2,
-3, -2, -1, 0, 1, 2, 3,
...
The sequence of fractions A196199/A004737 = 0/1, -1/1, 0/2, 1/1, -2/1, -1/2, 0/3, 1/2, 2/1, -3/1, -2/2, -1/3, 0/4, 1/3, 2/2, 3/1, -4/4. -3/2, ... contains every rational number (infinitely often) [Laczkovich]. - _N. J. A. Sloane_, Oct 09 2013
		

References

  • Miklós Laczkovich, Conjecture and Proof, TypoTex, Budapest, 1998. See Chapter 10.

Crossrefs

Cf. absolute values A053615, A002262, A002260, row lengths A005408, row sums A000004, A071797.

Programs

  • Haskell
    a196199 n k = a196199_row n !! k
    a196199_tabf = map a196199_row [0..]
    a196199_row n = [-n..n]
    b196199 = bFile' "A196199" (concat $ take 101 a196199_tabf) 0
    -- Reinhard Zumkeller, Sep 30 2011
    
  • Maple
    seq(seq(j-k-k^2, j=k^2 .. (k+1)^2-1), k = 0 .. 10); # Robert Israel, Jan 05 2015
    # Alternatively, as a table with rows -n<=k<=n (compare A257564):
    r := n -> (n-(n mod 2))/2: T := (n, k) -> r(n+k) - r(n-k):
    seq(print(seq(T(n, k), k=-n..n)), n=0..6); # Peter Luschny, May 28 2015
  • Mathematica
    Table[Range[-n, n], {n, 0, 9}] // Flatten
    (* or *)
    a[n_] := With[{t = Floor[Sqrt[n]]}, n - t (t + 1)];
    Table[a[n], {n, 0, 99}] (* Jean-François Alcover, Jul 13 2018, after Boris Putievskiy *)
  • PARI
    r=[];for(k=0,8,r=concat(r,vector(2*k+1,j,j-k-1)));r
    
  • Python
    from math import isqrt
    def A196199(n): return n-(t:=isqrt(n))*(t+1) # Chai Wah Wu, Aug 04 2022

Formula

a(n) = n - t*t - t - 1, where t = floor(sqrt(n-1)). - Boris Putievskiy, Jan 28 2013
G.f.: x/(x-1)^2 + 1/(x-1)*sum(k >= 1, 2*k*x^(k^2)). The series is related to Jacobi theta functions. - Robert Israel, Jan 05 2015

A257564 Irregular triangle read by rows: T(n,k) = r(n+k)+r(n-k) with r(n) = (n-(n mod 2))/2 for n>=0 and -n<=k<=n.

Original entry on oeis.org

0, 1, 0, 1, 2, 1, 2, 1, 2, 3, 2, 3, 2, 3, 2, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8
Offset: 0

Views

Author

Peter Luschny, May 28 2015

Keywords

Comments

r(n+k)-r(n-k) is triangle A196199(n,k).

Examples

			Triangle starts:
                 0;
              1, 0, 1;
           2, 1, 2, 1, 2;
        3, 2, 3, 2, 3, 2, 3;
     4, 3, 4, 3, 4, 3, 4, 3, 4;
  5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5;
		

Crossrefs

Programs

  • Maple
    r := n -> (n-(n mod 2))/2: T := (n,k) -> r(n+k) + r(n-k):
    seq(print(seq(T(n,k), k=-n..n)), n=0..6);
  • Sage
    for n in (0..6):
        [(n+k)//2 + (n-k)//2 for k in (-n..n)]

Formula

Sum_{k=-n..n} T(n,k) = 2*n^2 = A001105(n).
Showing 1-4 of 4 results.