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 55 results. Next

A204249 Permanent of the n-th principal submatrix of A003057.

Original entry on oeis.org

1, 2, 17, 336, 12052, 685080, 56658660, 6428352000, 958532774976, 181800011433600, 42745508545320000, 12203347213269273600, 4158410247782904833280, 1667267950805177583582720, 776990110000329481864608000, 416483579190482716042690560000
Offset: 0

Views

Author

Clark Kimberling, Jan 14 2012

Keywords

Comments

I have proved that for any odd prime p we have a(p) == p (mod p^2). - Zhi-Wei Sun, Aug 30 2021

Crossrefs

Programs

  • Maple
    with(LinearAlgebra):
    a:= n-> `if`(n=0, 1, Permanent(Matrix(n, (i, j)-> i+j))):
    seq(a(n), n=0..16);  # Alois P. Heinz, Nov 14 2016
  • Mathematica
    f[i_, j_] := i + j;
    m[n_] := Table[f[i, j], {i, 1, n}, {j, 1, n}]
    TableForm[m[8]] (* 8x8 principal submatrix *)
    Flatten[Table[f[i, n + 1 - i],
      {n, 1, 12}, {i, 1, n}]]  (* A003057 *)
    Permanent[m_] :=
      With[{a = Array[x, Length[m]]},
       Coefficient[Times @@ (m.a), Times @@ a]];
    Table[Permanent[m[n]], {n, 1, 15}]  (* A204249 *)
  • PARI
    {a(n) = matpermanent(matrix(n, n, i, j, i+j))}
    for(n=0, 20, print1(a(n), ", ")) \\ Vaclav Kotesovec, Dec 21 2018

Formula

From Vaclav Kotesovec, Dec 01 2016: (Start)
a(n) ~ c * d^n * (n!)^2 / sqrt(n), where d = A278300 = 2.455407482284127949... and c = 1.41510164826...
a(n) ~ c * d^n * n^(2*n + 1/2), where d = A278300/exp(2) = 0.332303267076220516... and c = 8.89134588451...
(End)

Extensions

a(0)=1 prepended and one more term added by Alois P. Heinz, Nov 14 2016

A204168 Array: row n shows the coefficients of the characteristic polynomial of the n-th principal submatrix of (i+j), as in A003057.

Original entry on oeis.org

2, -1, -1, -6, 1, 0, 6, 12, -1, 0, 0, -20, -20, 1, 0, 0, 0, 50, 30, -1, 0, 0, 0, 0, -105, -42, 1, 0, 0, 0, 0, 0, 196, 56, -1, 0, 0, 0, 0, 0, 0, -336, -72, 1, 0, 0, 0, 0, 0, 0, 0, 540, 90, -1, 0, 0, 0, 0, 0, 0, 0, 0, -825, -110, 1
Offset: 1

Views

Author

Clark Kimberling, Jan 12 2012

Keywords

Comments

Let p(n)=p(n,x) be the characteristic polynomial of the n-th principal submatrix. The zeros of p(n) are real, and they interlace the zeros of p(n+1). See A202605 and A204016 for guides to related sequences.

Examples

			Top of the array:
 2....-1
-1....-6.....1
 0.....6.....12....-1
 0.....0....-20....-20...1
		

References

  • (For references regarding interlacing roots, see A202605.)

Crossrefs

Programs

  • Mathematica
    f[i_, j_] := i + j;
    m[n_] := Table[f[i, j], {i, 1, n}, {j, 1, n}]
    TableForm[m[8]] (* 8x8 principal submatrix *)
    Flatten[Table[f[i, n + 1 - i],
      {n, 1, 15}, {i, 1, n}]]  (* A003057 *)
    p[n_] := CharacteristicPolynomial[m[n], x];
    c[n_] := CoefficientList[p[n], x]
    TableForm[Flatten[Table[p[n], {n, 1, 10}]]]
    Table[c[n], {n, 1, 12}]
    Flatten[%]                 (* A204168 *)
    TableForm[Table[c[n], {n, 1, 10}]]

A377104 E.g.f. A(x) satisfies [x^n] A(x)^A003057(n) = 0 for n >= 2, where A003057 is "n appears n-1 times.".

Original entry on oeis.org

1, 1, -1, 4, -26, 240, -2850, 41160, -703640, 13889400, -310575720, 7752286080, -213867376800, 6462828372000, -212276818353600, 7528584190327200, -286677285603508800, 11667274390189017600, -505448781205934966400, 23223347244920039817600, -1127925105189437053699200, 57737023232409594718444800
Offset: 0

Views

Author

Paul D. Hanna, Oct 31 2024

Keywords

Examples

			E.g.f.: A(x) = 1 + x - x^2/2! + 4*x^3/3! - 26*x^4/4! + 240*x^5/5! - 2850*x^6/6! + 41160*x^7/7! - 703640*x^8/8! + 13889400*x^9/9! - 310575720*x^10/10! + 7752286080*x^11/11! - 213867376800*x^12/12! + 6462828372000*x^13/13! - 212276818353600*x^14/14! + 7528584190327200*x^15/15! + ...
RELATED TABLE.
The table of coefficients of x^k/k! in A(x)^n begins
n\k 0  1   2    3    4    5      6      7        8         9          10
1: [1, 1, -1,   4, -26, 240, -2850, 41160, -703640, 13889400, -310575720, ...];
2: [1, 2,  0,   2, -14, 140, -1720, 25060, -434280,  8662080, -194885040, ...];
3: [1, 3,  3,   0,   0,  30,  -480,  7560, -147000,  3136560,  -73364760, ...];
4: [1, 4,  8,   4,   4,   0,     0,     0,  -21560,   618240,  -16205280, ...];
5: [1, 5, 15,  20,  10,  20,    50, -1400,       0,        0,          0, 0, -1684359600, ...];
6: [1, 6, 24,  54,  54,  60,   120, -1260,  -11760,   -31920,    2000880, -65585520, 0, 0, 0, 0, 0, 24502922005161600, ...];
...
in which there are (n-1) contiguous zeros in row n starting at k = (n-1)*(n-2)/2 + 2 for n >= 2.
Equivalently, [x^n] A(x)^A003057(n) = 0 for n >= 2, where
A003057 = [2, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, ...] (offset 2).
		

Crossrefs

Cf. A003057.

Programs

  • PARI
    {A003057(n) = round( sqrt(2*(n-1)) ) + 1}
    {a(n) = my(V=[1,1,0],A); for(i=0,n, V = concat(V,0); A = Ser(V); m = #V-2;
    V[#V-1] = -polcoef(A^A003057(m), m)/A003057(m) ); n!*polcoef(A,n)}
    for(n=1,30,print1(a(n),", "))

A023531 a(n) = 1 if n is of the form m(m+3)/2, otherwise 0.

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
Offset: 0

Views

Author

Clark Kimberling, Jun 14 1998

Keywords

Comments

Can be read as table: a(n,m) = 1 if n = m >= 0, else 0 (unit matrix).
a(n) = number of 1's between successive 0's (see also A005614, A003589 and A007538). - Eric Angelini, Jul 06 2005
Triangle T(n,k), 0 <= k <= n, read by rows, given by A000004 DELTA A000007 where DELTA is the operator defined in A084938. - Philippe Deléham, Jan 03 2009
Sequence B is called a reverse reluctant sequence of sequence A, if B is triangle array read by rows: row number k lists first k elements of the sequence A in reverse order.
A023531 is reverse reluctant sequence of sequence A000007. - Boris Putievskiy, Jan 11 2013
Also the Bell transform (and the inverse Bell transform) of 0^n (A000007). For the definition of the Bell transform see A264428. - Peter Luschny, Jan 19 2016
This is the turn sequence of the triangle spiral. To form the spiral: go a unit step forward, turn left a(n)*120 degrees, and repeat. The triangle sides are the runs of a(n)=0 (no turn). The sequence can be generated by a morphism with a special symbol S for the start of the sequence: S -> S,1; 1 -> 0,1; 0->0. The expansion lengthens each existing side and inserts a new unit side at the start. See the Fractint L-system in the links to draw the spiral this way. - Kevin Ryde, Dec 06 2019

Examples

			As a triangle:
       1
      0 1
     0 0 1
    0 0 0 1
   0 0 0 0 1
  0 0 0 0 0 1
G.f. = 1 + x^2 + x^5 + x^9 + x^14 + x^20 + x^27 + x^35 + x^44 + x^54 + ...
From _Kevin Ryde_, Dec 06 2019: (Start)
.
              1            Triangular spiral: start at S;
             / \             go a unit step forward,
            0   0   .        turn left a(n)*120 degrees,
           /     \   .       repeat.
          0   1   0   .
         /   / \   \   \   Each side's length is 1 greater
        0   0   0   0   0    than that of the previous side.
       /   /     \   \   \
      0   0   S---1   0   0
     /   /             \   \
    0   1---0---0---0---1   0
   /                         \
  1---0---0---0---0---0---0---1
(End)
		

Crossrefs

Programs

  • Haskell
    a023531 n = a023531_list !! n
    a023531_list = concat $ iterate ([0,1] *) [1]
    instance Num a => Num [a] where
       fromInteger k = [fromInteger k]
       (p:ps) + (q:qs) = p + q : ps + qs
       ps + qs         = ps ++ qs
       (p:ps) * qs'@(q:qs) = p * q : ps * qs' + [p] * qs
        *                = []
    -- Reinhard Zumkeller, Apr 02 2011
    
  • Maple
    seq(op([0$m,1]),m=0..10); # Robert Israel, Jan 18 2015
    # alternative
    A023531 := proc(n)
        option remember ;
        local m,t ;
        for m from 0 do
            t := m*(m+3)/2 ;
            if t > n then
                return 0 ;
            elif t = n then
                return 1 ;
            end if;
        end do:
    end proc:
    seq(A023531(n),n=0..40) ; # R. J. Mathar, May 15 2025
  • Mathematica
    If[IntegerQ[(Sqrt[9+8#]-3)/2],1,0]&/@Range[0,100] (* Harvey P. Dale, Jul 27 2011 *)
    a[ n_] := If[ n < 0, 0, Boole @ IntegerQ @ Sqrt[ 8 n + 9]]; (* Michael Somos, May 17 2014 *)
    a[ n_] := SeriesCoefficient[ (EllipticTheta[ 2, 0, x^(1/2)] / (2 x^(1/8)) - 1) / x, {x, 0, n}]; (* Michael Somos, May 17 2014 *)
  • PARI
    {a(n) = if( n<0, 0, issquare(8*n + 9))}; /* Michael Somos, May 17 2014 */
    
  • PARI
    A023531(n)=issquare(8*n+9) \\ M. F. Hasler, Apr 12 2018
    
  • Python
    from math import isqrt
    def A023531(n): return int((k:=n+1<<1)==(m:=isqrt(k))*(m+1)) # Chai Wah Wu, Nov 09 2024
  • Sage
    def A023531_row(n) :
        if n == 0: return [1]
        return [0] + A023531_row(n-1)
    for n in (0..9): print(A023531_row(n))  # Peter Luschny, Jul 22 2012
    

Formula

If (floor(sqrt(2*n))-(2*n/(floor(sqrt(2*n)))) = -1, 1, 0). - Gerald Hillier, Sep 11 2005
a(n) = 1 - A023532(n); a(n) = 1 - mod(floor(((10^(n+2) - 10)/9)10^(n+1 - binomial(floor((1+sqrt(9+8n))/2), 2) - (1+floor(log((10^(n+2) - 10)/9, 10))))), 10). - Paul Barry, May 25 2004
a(n) = floor((sqrt(9+8n)-1)/2) - floor((sqrt(1+8n)-1)/2). - Paul Barry, May 25 2004
a(n) = round(sqrt(2n+3)) - round(sqrt(2n+2)). - Hieronymus Fischer, Aug 06 2007
a(n) = ceiling(2*sqrt(2n+3)) - floor(2*sqrt(2n+2)) - 1. - Hieronymus Fischer, Aug 06 2007
From Franklin T. Adams-Watters, Jun 29 2009: (Start)
G.f.: (1/2 x^{-1/8}theta_2(0,x^{1/2}) - 1)/x, where theta_2 is a Jacobi theta function.
G.f. for triangle: Sum T(n,k) x^n y^k = 1/(1-x*y). Sum T(n,k) x^n y^k / n! = Sum T(n,k) x^n y^k / k! = exp(x*y). Sum T(n,k) x^n y^k / (n! k!) = I_0(2*sqrt(x*y)), where I is the modified Bessel function of the first kind. (End)
a(n) = A000007(m), where m=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Jan 11 2013
The row polynomials are p(n,x) = x^n = (-1)^n n!Lag(n,-n,x), the normalized, associated Laguerre polynomials of order -n. As the prototypical Appell sequence with e.g.f. exp(x*y), its raising operator is R = x and lowering operator, L = d/dx, i.e., R p(n,x) = p(n+1,x), and L p(n,x) = n * p(n-1,x). - Tom Copeland, May 10 2014
a(n) = A010054(n+1) if n >= 0. - Michael Somos, May 17 2014
a(n) = floor(sqrt(2*(n+1)+1/2)-1/2) - floor(sqrt(2*n+1/2)-1/2). - Mikael Aaltonen, Jan 18 2015
a(n) = A003057(n+3) - A003057(n+2). - Robert Israel, Jan 18 2015
a(A000096(n)) = 1; a(A007701(n)) = 0. - Reinhard Zumkeller, Feb 14 2015
Characteristic function of A000096. - M. F. Hasler, Apr 12 2018
Sum_{k=1..n} a(k) ~ sqrt(2*n). - Amiram Eldar, Jan 13 2024

A204016 Symmetric matrix based on f(i,j) = max(j mod i, i mod j), by antidiagonals.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Jan 10 2012

Keywords

Comments

A204016 represents the matrix M given by f(i,j) = max{(j mod i), (i mod j)} for i >= 1 and j >= 1. See A204017 for characteristic polynomials of principal submatrices of M, with interlacing zeros.
Guide to symmetric matrices M based on functions f(i,j) and characteristic polynomial sequences (c.p.s.) with interlaced zeros:
f(i,j)..........................M.........c.p.s.
C(i+j,j)........................A007318...A045912
min(i,j)........................A003983...A202672
max(i,j)........................A051125...A203989
(i+j)*min(i,j)..................A203990...A203991
|i-j|...........................A049581...A203993
max(i-j+1,j-i+1)................A143182...A203992
min(i-j+1,j-i+1)................A203994...A203995
min(i(j+1),j(i+1))..............A203996...A203997
max(i(j+1)-1,j(i+1)-1)..........A203998...A203999
min(i(j+1)-1,j(i+1)-1)..........A204000...A204001
min(2i+j,i+2j)..................A204002...A204003
max(2i+j-2,i+2j-2)..............A204004...A204005
min(2i+j-2,i+2j-2)..............A204006...A204007
max(3i+j-3,i+3j-3)..............A204008...A204011
min(3i+j-3,i+3j-3)..............A204012...A204013
min(3i-2,3j-2)..................A204028...A204029
1+min(j mod i, i mod j).........A204014...A204015
max(j mod i, i mod j)...........A204016...A204017
1+max(j mod i, i mod j).........A204018...A204019
min(i^2,j^2)....................A106314...A204020
min(2i-1, 2j-1).................A157454...A204021
max(2i-1, 2j-1).................A204022...A204023
min(i(i+1)/2,j(j+1)/2)..........A106255...A204024
gcd(i,j)........................A003989...A204025
gcd(i+1,j+1)....................A204030...A204111
min(F(i+1),F(j+1)),F=A000045....A204026...A204027
gcd(F(i+1),F(j+1)),F=A000045....A204112...A204113
gcd(L(i),L(j)),L=A000032........A204114...A204115
gcd(2^i-1,2^j-2)................A204116...A204117
gcd(prime(i),prime(j))..........A204118...A204119
gcd(prime(i+1),prime(j+1))......A204120...A204121
gcd(2^(i-1),2^(j-1))............A144464...A204122
max(floor(i/j),floor(j/i))......A204123...A204124
min(ceiling(i/j),ceiling(j/i))..A204143...A204144
Delannoy matrix.................A008288...A204135
max(2i-j,2j-i)..................A204154...A204155
-1+max(3i-j,3j-i)...............A204156...A204157
max(3i-2j,3j-2i)................A204158...A204159
floor((i+1)/2)..................A204164...A204165
ceiling((i+1)/2)................A204166...A204167
i+j.............................A003057...A204168
i+j-1...........................A002024...A204169
i*j.............................A003991...A204170
..abbreviation below: AOE means "all 1's except"
AOE f(i,i)=i....................A204125...A204126
AOE f(i,i)=A000045(i+1).........A204127...A204128
AOE f(i,i)=A000032(i)...........A204129...A204130
AOE f(i,i)=2i-1.................A204131...A204132
AOE f(i,i)=2^(i-1)..............A204133...A204134
AOE f(i,i)=3i-2.................A204160...A204161
AOE f(i,i)=floor((i+1)/2).......A204162...A204163
...
Other pairs (M, c.p.s.): (A204171, A204172) to (A204183, A204184)
See A202695 for a guide to choices of symmetric matrix M for which the zeros of the characteristic polynomials are all positive.

Examples

			Northwest corner:
  0 1 1 1 1 1 1 1
  0 1 2 2 2 2 2 2
  1 2 0 3 3 3 3 3
  1 2 3 0 4 4 4 4
  1 2 3 4 0 5 5 5
  1 2 3 4 5 0 6 6
  1 2 3 4 5 6 0 7
		

Crossrefs

Programs

  • Mathematica
    f[i_, j_] := Max[Mod[i, j], Mod[j, i]];
    m[n_] := Table[f[i, j], {i, 1, n}, {j, 1, n}]
    TableForm[m[8]] (* 8x8 principal submatrix *)
    Flatten[Table[f[i, n + 1 - i],
    {n, 1, 12}, {i, 1, n}]]  (* A204016 *)
    p[n_] := CharacteristicPolynomial[m[n], x];
    c[n_] := CoefficientList[p[n], x]
    TableForm[Flatten[Table[p[n], {n, 1, 10}]]]
    Table[c[n], {n, 1, 12}]
    Flatten[%]               (* A204017 *)
    TableForm[Table[c[n], {n, 1, 10}]]

A161680 a(n) = binomial(n,2): number of size-2 subsets of {0,1,...,n} that contain no consecutive integers.

Original entry on oeis.org

0, 0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465, 496, 528, 561, 595, 630, 666, 703, 741, 780, 820, 861, 903, 946, 990, 1035, 1081, 1128, 1176, 1225, 1275, 1326, 1378
Offset: 0

Views

Author

Jaroslav Krizek, Jun 16 2009

Keywords

Comments

Essentially the same as A000217: zero followed by A000217. - Joerg Arndt, Jul 26 2015
Count of entries <= n in A003057.
a(n) is the number of size-2 subsets of [n+1] that contain no consecutive integers, a(n+1) is the n-th triangular number. - Dennis P. Walsh, Mar 30 2011
Construct the n-th row of Pascal's triangle (A007318) from the preceding row, starting with row 0 = 1. a(n) is the sequence consisting of the total number of additions required to compute the triangle in this way up to row n. Copying a term does not count as an addition. - Douglas Latimer, Mar 05 2012
a(n-1) is also the number of ordered partitions (compositions) of n >= 1 into exactly 3 parts. - Juergen Will, Jan 02 2016
a(n+2) is also the number of weak compositions (ordered weak partitions) of n into exactly 3 parts. - Juergen Will, Jan 19 2016
In other words, this is the number of relations between entities, for example between persons: Two persons (n = 2) will have one relation (a(n) = 1), whereas four persons will have six relations to each other, and 20 persons will have 190 relations between them. - Halfdan Skjerning, May 03 2017
This also describes the largest number of intersections between n lines of equal length sequentially connected at (n-1) joints. The joints themselves do not count as intersection points. - Joseph Rozhenko, Oct 05 2021
The lexicographically earliest infinite sequence of nonnegative integers with monotonically increasing differences (that are also nonnegative integers). - Joe B. Stephen, Jul 22 2023

Examples

			A003057 starts 2, 3, 3, 4, 4,..., so there are a(0)=0 numbers <= 0, a(1)=0 numbers <= 1, a(2)=1 number <= 2, a(3)=3 numbers <= 3 in A003057.
For n=4, a(4)=6 since there are exactly 6 size-2 subsets of {0,1,2,3,4} that contain no consecutive integers, namely, {0,2}, {0,3}, {0,4}, {1,3}, {1,4}, and {2,4}.
		

Crossrefs

Programs

  • Magma
    a003057:=func< n | Round(Sqrt(2*(n-1)))+1 >; S:=[]; m:=2; count:=0; for n in [2..2000] do if a003057(n) lt m then count+:=1; else Append(~S, count); m+:=1; end if; end for; S; // Klaus Brockhaus, Nov 30 2010
    
  • Maple
    seq(binomial(n,2),n=0..50);
  • Mathematica
    Join[{a = 0}, Table[a += n, {n, 0, 100}]] (* Vladimir Joseph Stephan Orlovsky, Jun 12 2011 *)
    f[n_] := n(n-1)/2; Array[f, 54, 0] (* Robert G. Wilson v, Jul 26 2015 *)
    Binomial[Range[0,60],2] (* or *) LinearRecurrence[{3,-3,1},{0,0,1},60] (* Harvey P. Dale, Apr 14 2017 *)
  • PARI
    a(n)=n*(n-1)/2 \\ Charles R Greathouse IV, Jun 17 2017

Formula

a(n) = (n^2 - n)/2 = n*(n - 1)/2.
a(n) = A000124(n-1)-1 = A000217(n-1).
a(n) = a(n-1)+n-1 (with a(0)=a(1)=0). - Vincenzo Librandi, Nov 30 2010
Compositions: C(n,3) = binomial(n-1,n-3) = binomial(n-1,2), n>0. - Juergen Will, Jan 02 2015
G.f.: x^2/(1-x)^3. - Dennis P. Walsh, Mar 30 2011
G.f. with offset 1: Compositions: (x+x^2+x^3+...)^3 = (x/(1-x))^3. - Juergen Will, Jan 02 2015
a(n-1) = 6*n*s(1,n), n >= 1, where s(h,k) are the Dedekind sums. For s(1,n) see A264388(n)/A264389(n), also for references. - Wolfdieter Lang, Jan 11 2016
a(n) = A244049(n+1) + A004125(n+1). - Omar E. Pol, Mar 25 2021
a(n) = A000290(n+1) - A034856(n+1). - Omar E. Pol, Mar 30 2021
E.g.f.: exp(x)*x^2/2. - Stefano Spezia, Dec 19 2021

Extensions

Definition rephrased, offset set to 0 by R. J. Mathar, Aug 03 2010

A007401 Add n-1 to n-th term of 'n appears n times' sequence (A002024).

Original entry on oeis.org

1, 3, 4, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76
Offset: 1

Views

Author

Keywords

Comments

Complement of A000096 = increasing sequence of positive integers excluding n*(n+3)/2. - Jonathan Vos Post, Aug 13 2005
As a triangle: (1; 3,4; 6,7,8; 10,11,12,13; ...), Row sums = A127736: (1, 7, 21, 46, 85, 141, 217, ...). - Gary W. Adamson, Oct 25 2007
Odd primes are a subsequence except 5, cf. A004139. - Reinhard Zumkeller, Jul 18 2011
A023532(a(n)) = 1. - Reinhard Zumkeller, Dec 04 2012
T(n,k) = ((n+k)^2+n-k)/2 - 1, n,k > 0, read by antidiagonals. - Boris Putievskiy, Jan 14 2013
A023531(a(n)) = 0. - Reinhard Zumkeller, Feb 14 2015

Examples

			From _Boris Putievskiy_, Jan 14 2013: (Start)
The start of the sequence as table:
   1,  3,  6, 10, 15, 21, 28, ...
   4,  7, 11, 16, 22, 29, 37, ...
   8, 12, 17, 23, 30, 38, 47, ...
  13, 18, 24, 31, 39, 48, 58, ...
  19, 25, 32, 40, 49, 59, 70, ...
  26, 33, 41, 50, 60, 71, 83, ...
  34, 42, 51, 61, 72, 84, 97, ...
  ...
The start of the sequence as triangle array read by rows:
   1;
   3,  4;
   6,  7,  8;
  10, 11, 12, 13;
  15, 16, 17, 18, 19;
  21, 22, 23, 24, 25, 26;
  28, 29, 30, 31, 32, 33, 34;
  ...
Row number r contains r numbers r*(r+1)/2, r*(r+1)/2+1, ..., r*(r+1)/2+r-1. (End)
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a007401 n = a007401_list !! n
    a007701_list = [x | x <- [0..], a023531 x == 0]
    -- Reinhard Zumkeller, Feb 14 2015, Dec 04 2012
    
  • Mathematica
    f[n_] := n + Floor[ Sqrt[2n] - 1/2]; Array[f, 66]; (* Robert G. Wilson v, Feb 13 2011 *)
  • PARI
    a(n)=n+floor(sqrt(n+n)-1/2) \\ Charles R Greathouse IV, Feb 13 2011
    
  • PARI
    for(m=1,9, for(n=m*(m+1)/2,(m^2+3*m-2)/2, print1(n", "))) \\ Charles R Greathouse IV, Feb 13 2011
    
  • Python
    from math import isqrt
    def A007401(n): return n-1+(isqrt(n<<3)+1>>1) # Chai Wah Wu, Oct 18 2022

Formula

From Boris Putievskiy, Jan 14 2013: (Start)
a(n) = A014132(n) - 1.
a(n) = A003057(n)^2 - A114327(n) - 1.
a(n) = ((t+2)^2 + i - j)/2-1, where
i = n-t*(t+1)/2,
j = (t*t+3*t+4)/2-n,
t = floor((-1+sqrt(8*n-7))/2). (End)

A014132 Complement of triangular numbers (A000217); also array T(n,k) = ((n+k)^2 + n-k)/2, n, k > 0, read by antidiagonals.

Original entry on oeis.org

2, 4, 5, 7, 8, 9, 11, 12, 13, 14, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79
Offset: 1

Views

Author

Keywords

Comments

Numbers that are not triangular (nontriangular numbers).
Also definable as follows: a(1)=2; for n>1, a(n) is smallest integer greater than a(n-1) such that the condition "n and a(a(n)) have opposite parities" can always be satisfied. - Benoit Cloitre and Matthew Vandermast, Mar 10 2003
Record values in A256188 that are greater than 1. - Reinhard Zumkeller, Mar 26 2015
From Daniel Forgues, Apr 10 2015: (Start)
With n >= 1, k >= 1:
t(n+k) - k, 1 <= k <= n+k-1, n >= 1;
t(n+k-1) + n, 1 <= n <= n+k-1, k >= 1;
where t(n+k) = t(n+k-1) + (n+k) is the (n+k)-th triangular number, while the number of compositions of n+k into 2 parts is C(n+k-1, 2-1) = n+k-1, the number of nontriangular numbers between t(n+k-1) and t(n+k), just right!
Related to Hilbert's Infinite Hotel:
0) All rooms, numbered through the positive integers, are full;
1) An infinite number of trains, each containing an infinite number of passengers, arrives: i.e., a 2-D lattice of pairs of positive integers;
2) Move occupant of room m, m >= 1, to room t(m) = m*(m+1)/2, where t(m) is the m-th triangular number;
3) Assign n-th passenger from k-th train to room t(n+k-1) + n, 1 <= n <= n+k-1, k >= 1;
4) Everybody has his or her own room, no room is empty, for m >= 1.
If situation 1 happens again, repeat steps 2 and 3, you're back to 4.
(End)
1711 + 2*a(n)*(58 + a(n)) is prime for n<=21. The terms that do not have this property start 29,32,34,43,47,58,59,60,62,63,65,68,70,73,... - Benedict W. J. Irwin, Nov 22 2016
Also numbers k with the property that in the symmetric representation of sigma(k) both Dyck paths have a central peak or both Dyck paths have a central valley. (Cf. A237593.) - Omar E. Pol, Aug 28 2018

Examples

			From _Boris Putievskiy_, Jan 14 2013: (Start)
Start of the sequence as a table (read by antidiagonals, right to left), where the k-th row corresponds to the k-th column of the triangle (shown thereafter):
   2,  4,  7, 11, 16, 22, 29, ...
   5,  8, 12, 17, 23, 30, 38, ...
   9, 13, 18, 24, 31, 39, 48, ...
  14, 19, 25, 32, 40, 49, 59, ...
  20, 26, 33, 41, 50, 60, 71, ...
  27, 34, 42, 51, 61, 72, 84, ...
  35, 43, 52, 62, 73, 85, 98, ...
  (...)
Start of the sequence as a triangle (read by rows), where the i elements of the i-th row are t(i) + 1 up to t(i+1) - 1, i >= 1:
   2;
   4,  5;
   7,  8,  9;
  11, 12, 13, 14;
  16, 17, 18, 19, 20;
  22, 23, 24, 25, 26, 27;
  29, 30, 31, 32, 33, 34, 35;
  (...)
Row number i contains i numbers, where t(i) = i*(i+1)/2:
  t(i) + 1, t(i) + 2, ..., t(i) + i = t(i+1) - 1
(End) [Edited by _Daniel Forgues_, Apr 11 2015]
		

Crossrefs

Cf. A000124 (left edge: quasi-triangular numbers), A000096 (right edge: almost-triangular numbers), A006002 (row sums), A001105 (central terms).
Cf. A242401 (subsequence).
Cf. A145397 (the non-tetrahedral numbers).

Programs

  • Haskell
    a014132 n = n + round (sqrt $ 2 * fromInteger n)
    a014132_list = filter ((== 0) . a010054) [0..]
    -- Reinhard Zumkeller, Dec 12 2012
    
  • Magma
    IsTriangular:=func< n | exists{ k: k in [1..Isqrt(2*n)] | n eq (k*(k+1) div 2)} >; [ n: n in [1..90] | not IsTriangular(n) ]; // Klaus Brockhaus, Jan 04 2011
    
  • Mathematica
    f[n_] := n + Round[Sqrt[2n]]; Array[f, 71] (* or *)
    Complement[ Range[83], Array[ #(# + 1)/2 &, 13]] (* Robert G. Wilson v, Oct 21 2005 *)
    DeleteCases[Range[80],?(OddQ[Sqrt[8#+1]]&)] (* _Harvey P. Dale, Jul 24 2021 *)
  • PARI
    a(n)=if(n<1,0,n+(sqrtint(8*n-7)+1)\2)
    
  • PARI
    isok(n) = !ispolygonal(n,3); \\ Michel Marcus, Mar 01 2016
    
  • Python
    from math import isqrt
    def A014132(n): return n+(isqrt((n<<3)-7)+1>>1) # Chai Wah Wu, Jun 17 2024

Formula

a(n) = n + round(sqrt(2*n)).
a(a(n)) = n + 2*floor(1/2 + sqrt(2n)) + 1.
a(n) = a(n-1) + A035214(n), a(1)=2.
a(n) = A080036(n) - 1.
a(n) = n + A002024(n). - Vincenzo Librandi, Jul 08 2010
A010054(a(n)) = 0. - Reinhard Zumkeller, Dec 10 2012
From Boris Putievskiy, Jan 14 2013: (Start)
a(n) = A007401(n)+1.
a(n) = A003057(n)^2 - A114327(n).
a(n) = ((t+2)^2 + i - j)/2, where
i = n-t*(t+1)/2,
j = (t*t+3*t+4)/2-n,
t = floor((-1+sqrt(8*n-7))/2). (End)
A248952(a(n)) < 0. - Reinhard Zumkeller, Oct 20 2014
a(n) = A256188(A004202(n)). - Reinhard Zumkeller, Mar 26 2015
From Robert Israel, Apr 20 2015 (Start):
a(n) = A118011(n) - n.
G.f.: x/(1-x)^2 + x/(1-x) * Sum(j>=0, x^(j*(j+1)/2)) = x/(1-x)^2 + x^(7/8)/(2-2*x) * Theta2(0,sqrt(x)), where Theta2 is a Jacobi theta function. (End)
G.f. as array: x*y*(2 - 2*y + x^2*y + y^2 - x*(1 + y))/((1 - x)^3*(1 - y)^3). - Stefano Spezia, Apr 22 2024

Extensions

Following Alford Arnold's comment: keyword tabl and correspondent crossrefs added by Reinhard Zumkeller, Dec 12 2012
I restored the original definition. - N. J. A. Sloane, Jan 27 2019

A206284 Numbers that match irreducible polynomials over the nonnegative integers.

Original entry on oeis.org

3, 6, 9, 10, 12, 18, 20, 22, 24, 27, 28, 30, 36, 40, 42, 44, 46, 48, 50, 52, 54, 56, 60, 66, 68, 70, 72, 76, 80, 81, 88, 92, 96, 98, 100, 102, 104, 108, 112, 114, 116, 118, 120, 124, 126, 130, 132, 136, 140, 144, 148, 150, 152, 154, 160, 162, 164, 168, 170
Offset: 1

Views

Author

Clark Kimberling, Feb 05 2012

Keywords

Comments

Starting with 1, which encodes 0-polynomial, each integer m encodes (or "matches") a polynomial p(m,x) with nonnegative integer coefficients determined by the prime factorization of m. Write m = prime(1)^e(1) * prime(2)^e(2) * ... * prime(k)^e(k); then p(m,x) = e(1) + e(2)x + e(3)x^2 + ... + e(k)x^k.
Identities:
p(m*n,x) = p(m,x) + p(n,x),
p(m*n,x) = p(gcd(m,n),x) + p(lcm(m,n),x),
p(m+n,x) = p(gcd(m,n),x) + p((m+n)/gcd(m,n),x), so that if A003057 is read as a square matrix, then
p(A003057,x) = p(A003989,x) + p(A106448,x).
Apart from powers of 3, all terms are even. - Charles R Greathouse IV, Feb 11 2012
Contains 2*p^m and p*2^m if p is an odd prime and m is in A052485. - Robert Israel, Oct 09 2016

Examples

			Polynomials having nonnegative integer coefficients are matched to the positive integers as follows:
   m    p(m,x)    irreducible
  ---------------------------
   1    0         no
   2    1         no
   3    x         yes
   4    2         no
   5    x^2       no
   6    1+x       yes
   7    x^3       no
   8    3         no
   9    2x        yes
  10    1+x^2     yes
		

Crossrefs

Cf. A052485, A206285 (complement), A206296.
Positions of ones in A277322.
Terms of A277318 form a proper subset of this sequence. Cf. also A277316.
Other sequences about factorization in the same polynomial ring: A206442, A284010.
Polynomial multiplication using the same encoding: A297845.

Programs

  • Maple
    P:= n -> add(f[2]*x^(numtheory:-pi(f[1])-1), f =  ifactors(n)[2]):
    select(irreduc @ P, [$1..200]); # Robert Israel, Oct 09 2016
  • Mathematica
    b[n_] := Table[x^k, {k, 0, n}];
    f[n_] := f[n] = FactorInteger[n]; z = 400;
    t[n_, m_, k_] := If[PrimeQ[f[n][[m, 1]]] && f[n][[m, 1]]
    == Prime[k], f[n][[m, 2]], 0];
    u = Table[Apply[Plus,
        Table[Table[t[n, m, k], {k, 1, PrimePi[n]}], {m, 1,
          Length[f[n]]}]], {n, 1, z}];
    p[n_, x_] := u[[n]].b[-1 + Length[u[[n]]]]
    Table[p[n, x], {n, 1, z/4}]
    v = {}; Do[n++; If[IrreduciblePolynomialQ[p[n, x]],
    AppendTo[v, n]], {n, z/2}]; v  (* A206284 *)
    Complement[Range[200], v]      (* A206285 *)
  • PARI
    is(n)=my(f=factor(n));polisirreducible(sum(i=1, #f[,1], f[i,2]*'x^primepi(f[i,1]-1))) \\ Charles R Greathouse IV, Feb 12 2012

Extensions

Introductory comments edited by Antti Karttunen, Oct 09 2016 and Peter Munn, Aug 13 2022

A080036 a(n) = n + round(sqrt(2*n)) + 1.

Original entry on oeis.org

1, 3, 5, 6, 8, 9, 10, 12, 13, 14, 15, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 36, 38, 39, 40, 41, 42, 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 85, 86
Offset: 0

Views

Author

N. J. A. Sloane, Mar 14 2003

Keywords

Comments

Sequence (without first term) is the complement of A000124 (central polygonal numbers). - Jaroslav Krizek, Jun 16 2009
a(n) is the Ramsey core number rc(2,n). The Ramsey core number rc(s,t) is the smallest n such that for all edge 2-colorings of K_n, either the factor induced by the first color contains an s-core or the second factor contains a t-core. (A k-core is a subgraph with minimum degree at least k.) - Allan Bickle, Mar 29 2023

Examples

			For order 5, one of the two factors has at least 5 edges, and so contains a cycle.   For order 4, K_4  decomposes into two paths.  Thus rc(2,2)=5.
		

References

  • R. Klein and J. Schönheim, Decomposition of K_{n} into degenerate graphs, In Combinatorics and Graph Theory Hefei 6-27, April 1992. World Scientific. Singapore, New Jersey, London, Hong Kong, 141-1

Crossrefs

Equals A014132 + 1. Cf. A080037.
Different from A105206.
Cf. A361261 (array of rc(s,t)), A361684 (rc(n,n)).

Programs

  • Magma
    [n + Round(Sqrt(2*n)) + 1: n in [0..80]]; // Vincenzo Librandi, Jan 20 2015
    
  • Mathematica
    Table[(n + Round[Sqrt[2 n]] + 1), {n, 0, 80}] (* Vincenzo Librandi, Jan 20 2015 *)
  • PARI
    A080036(n)=n+round(sqrt(2*n))+1 \\ M. F. Hasler, Jan 13 2015
    
  • Python
    from math import isqrt
    def A080036(n): return (k:=isqrt(m:=n<<1))+int((m<<2)>(k<<2)*(k+1)+1)+n+1 # Chai Wah Wu, Jul 26 2022

Formula

a(0)=1, a(1)=3; for n>1, a(n)=a(n-1)+1 if n is already in the sequence, a(n)=a(n-1)+2 otherwise.
a(n) = A003057(n+1) + n. - Jaroslav Krizek, Jun 16 2009
a(n) = ceiling(n + 1/2 + sqrt(2*(n-1)+9/4)). - Allan Bickle, Mar 29 2023
Showing 1-10 of 55 results. Next