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

A079978 Characteristic function of multiples of three.

Original entry on oeis.org

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

Views

Author

Vladimir Baltic, Feb 17 2003

Keywords

Comments

Period 3: repeat [1, 0, 0].
a(n)=1 if n=3k, a(n)=0 otherwise.
Decimal expansion of 1/999.
Number of permutations satisfying -k <= p(i)-i <= r and p(i)-i not in I, i=1..n, with k=1, r=2, I={0,1}.
a(n) is also the number of partitions of n with every part being three (a(0)=1 because the empty partition has no parts). Hence a(n) is also the number of 2-regular graphs on n vertices with each component having girth 3. - Jason Kimberley, Oct 02 2011
Euler transformation of A185013. - Jason Kimberley, Oct 02 2011
If b(0)=0 and for n > 0, b(n)=a(n), then starting at n=0, b(n) is the number of incongruent equilateral triangles formed from the vertices of a regular n-gon. The number of incongruent isosceles triangles (strictly two equal sides) is A174257(n) and the number of incongruent scalene triangles is A069905(n-3) for n > 2, otherwise 0. The total number of incongruent triangles is A069905(n). - Frank M Jackson, Nov 19 2022

References

  • D. H. Lehmer, Permutations with strongly restricted displacements. Combinatorial theory and its applications, II (Proc. Colloq., Balatonfured, 1969), pp. 755-770. North-Holland, Amsterdam, 1970.

Crossrefs

Essentially the same as A022003.
Partial sums are given by A002264(n+3).
Characteristic function of multiples of g: A000007 (g=0), A000012 (g=1), A059841 (g=2), this sequence (g=3), A121262 (g=4), A079998 (g=5), A079979 (g=6), A082784 (g=7). - Jason Kimberley, Oct 14 2011
Cf. A007908, A011655 (bit flipped).

Programs

Formula

a(n) = a(n-3) for n > 2.
G.f.: 1/(1-x^3) = 1/( (1-x)*(1+x+x^2)).
a(n) = (1 + e^(i*Pi*A002487(n)))/2, i=sqrt(-1). - Paul Barry, Jan 14 2005
Additive with a(p^e) = 1 if p = 3, 0 otherwise.
a(n) = ((n+1) mod 3) mod 2. Also: a(n) = (1/2)*(1 + (-1)^(n + floor((n+1)/3))). - Hieronymus Fischer, May 29 2007
a(n) = 1 - A011655(n). - Reinhard Zumkeller, Nov 30 2009
a(n) = (1 + (-1)^(2*n/3) + (-1)^(-2*n/3))/3. - Jaume Oliver Lafont, May 13 2010
For the general case: the characteristic function of numbers that are multiples of m is a(n) = floor(n/m) - floor((n-1)/m), m,n > 0. - Boris Putievskiy, May 08 2013
a(n) = floor( ((n-1) mod 3)/2 ). - Wesley Ivan Hurt, Jun 29 2013
a(n) = 2^(n mod 3) mod 2. - Olivier Gérard, Jul 04 2013
a(n) = (w^(2*n) + w^n + 1)/3, w = (-1 + i*sqrt(3))/2 (w is a primitive 3rd root of unity). - Bogart B. Strauss, Jul 20 2013
E.g.f.: (exp(x) + 2*exp(-x/2)*cos(sqrt(3)*x/2))/3. - Geoffrey Critzer, Nov 03 2014
a(n) = (sin(Pi*(n+1)/3)^2)*(2/3) + sin(Pi*(n+1)*2/3)/sqrt(3). - Mikael Aaltonen, Jan 03 2015
a(n) = (2*n^2 + 1) mod 3. The characteristic function of numbers that are multiples of 2k+1 is (2*k*n^(2*k) + 1) mod (2k+1). Example: A058331(n) mod 3 for k=1, A211412(n) mod 5 for k=2, ... - Eric Desbiaux, Dec 25 2015
a(n) = floor(2*(n-1)/3) - 2*floor((n-1)/3). - Wesley Ivan Hurt, Jul 25 2016
a(n) == A007908(n+1) (mod 3), n >= 0. See A011655 (bit flipped). - Wolfdieter Lang, Jun 12 2017
a(n) = 1/3 + (2/3)*cos((2/3)*n*Pi). - Ridouane Oudra, Jan 22 2021
a(n) = A000217(n+1) mod 3. - Christopher Adams, Jan 05 2025

Extensions

Name simplified by Ralf Stephan, Nov 22 2010
Name changed by Jason Kimberley, Oct 14 2011

A003269 a(n) = a(n-1) + a(n-4) with a(0) = 0, a(1) = a(2) = a(3) = 1.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 3, 4, 5, 7, 10, 14, 19, 26, 36, 50, 69, 95, 131, 181, 250, 345, 476, 657, 907, 1252, 1728, 2385, 3292, 4544, 6272, 8657, 11949, 16493, 22765, 31422, 43371, 59864, 82629, 114051, 157422, 217286, 299915, 413966, 571388, 788674, 1088589, 1502555, 2073943
Offset: 0

Views

Author

Keywords

Comments

This comment covers a family of sequences which satisfy a recurrence of the form a(n) = a(n-1) + a(n-m), with a(n) = 1 for n = 0..m-1. The generating function is 1/(1-x-x^m). Also a(n) = Sum_{i=0..n/m} binomial(n-(m-1)*i, i). This family of binomial summations or recurrences gives the number of ways to cover (without overlapping) a linear lattice of n sites with molecules that are m sites wide. Special case: m=1: A000079; m=4: A003269; m=5: A003520; m=6: A005708; m=7: A005709; m=8: A005710.
For this family of sequences, a(n+1) is the number of compositions of n+1 into parts 1 and m. For n>=m, a(n-m+1)is the number of compositions of n in which each part is greater than m or equivalently, in which parts 1 through m are excluded. - Gregory L. Simay, Jul 14 2016
For this family of sequences, let a(m,n) = a(n-1) + a(n-m). Then the number of compositions of n having m as a least summand is a(m, n-m) - a(m+1, n-m-1). - Gregory L. Simay, Jul 14 2016
For n>=3, a(n-3) = number of compositions of n in which each part is >=4. - Milan Janjic, Jun 28 2010
For n>=1, number of compositions of n into parts == 1 (mod 4). Example: a(8)=5 because there are 5 compositions of 8 into parts 1 or 5: (1,1,1,1,1,1,1,1), (1,1,1,5), (1,1,5,1), (1,5,1,1), (5,1,1,1). - Adi Dani, Jun 16 2011
a(n+1) is the number of compositions of n into parts 1 and 4. - Joerg Arndt, Jun 25 2011
The compositions of n in which each natural number is colored by one of p different colors are called p-colored compositions of n. For n>=4, 2*a(n-3) equals the number of 2-colored compositions of n with all parts >= 4, such that no adjacent parts have the same color. - Milan Janjic, Nov 27 2011
Number of permutations satisfying -k<=p(i)-i<=r and p(i)-i not in I, i=1..n, with k=1, r=3, I={1,2}. - Vladimir Baltic, Mar 07 2012
a(n+4) equals the number of binary words of length n having at least 3 zeros between every two successive ones. - Milan Janjic, Feb 07 2015
From Clark Kimberling, Jun 13 2016: (Start)
Let T* be the infinite tree with root 0 generated by these rules: if p is in T*, then p+1 is in T* and x*p is in T*.
Let g(n) be the set of nodes in the n-th generation, so that g(0) = {0}, g(1) = {1}, g(2) = {2,x}, g(3) = {3, 2*x, x+1, x^2}, etc.
Let T(r) be the tree obtained by substituting r for x.
If N is a positive integer such that r = N^(1/4) is not an integer, then the number of (not necessarily distinct) integers in g(n) is A003269(n), for n > = 1. See A274142. (End)

Examples

			G.f.: x + x^2 + x^3 + x^4 + 2*x^5 + 3*x^6 + 4*x^7 + 5*x^8 + 7*x^9 + 10*x^10 + ...
The number of compositions of 12 having 4 as a least summand is a(4, 12 -4 + 1) - a(5, 12 - 5 + 1) = A003269(9) - A003520(8) = 7-4 = 3. The compositions are (84), (48) and (444). - _Gregory L. Simay_, Jul 14 2016
		

References

  • A. Brousseau, Fibonacci and Related Number Theoretic Tables. Fibonacci Association, San Jose, CA, 1972, p. 120.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

See A017898 for an essentially identical sequence.
Row sums of A180184.

Programs

  • Haskell
    a003269 n = a003269_list !! n
    a003269_list = 0 : 1 : 1 : 1 : zipWith (+) a003269_list
                                              (drop 3 a003269_list)
    -- Reinhard Zumkeller, Feb 27 2011
    
  • Magma
    I:=[0,1,1,1]; [n le 4 select I[n] else Self(n-1) + Self(n-4) :n in [1..50]]; // Marius A. Burtea, Sep 13 2019
    
  • Maple
    with(combstruct): SeqSetU := [S, {S=Sequence(U), U=Set(Z, card > 3)}, unlabeled]: seq(count(SeqSetU, size=j), j=4..51);
    seq(add(binomial(n-3*k,k),k=0..floor(n/3)),n=0..47); # Zerinvary Lajos, Apr 03 2007
    A003269:=z/(1-z-z**4); # Simon Plouffe in his 1992 dissertation
    ZL:=[S, {a = Atom, b = Atom, S = Prod(X,Sequence(Prod(X,b))), X = Sequence(b,card >= 3)}, unlabelled]: seq(combstruct[count](ZL, size=n), n=3..50); # Zerinvary Lajos, Mar 26 2008
    M:= Matrix(4, (i,j)-> if j=1 then [1,0,0,1][i] elif (i=j-1) then 1 else 0 fi); a:= n-> (M^(n))[1,2]; seq(a(n), n=0..48); # Alois P. Heinz, Jul 27 2008
  • Mathematica
    a[0]= 0; a[1]= a[2]= a[3]= 1; a[n_]:= a[n]= a[n-1] + a[n-4]; Table[a[n], {n,0,50}]
    CoefficientList[Series[x/(1-x-x^4), {x,0,50}], x] (* Zerinvary Lajos, Mar 29 2007 *)
    Table[Sum[Binomial[n-3*i-1,i], {i,0,(n-1)/3}], {n,0,50}]
    LinearRecurrence[{1,0,0,1}, {0,1,1,1}, 50] (* Robert G. Wilson v, Jul 12 2014 *)
    nxt[{a_,b_,c_,d_}]:={b,c,d,a+d}; NestList[nxt,{0,1,1,1},50][[;;,1]] (* Harvey P. Dale, May 27 2024 *)
  • PARI
    {a(n) = polcoeff( if( n<0, (1 + x^3) / (1 + x^3 - x^4), 1 / (1 - x - x^4)) + x * O(x^abs(n)), abs(n))} /* Michael Somos, Jul 12 2003 */
    
  • SageMath
    @CachedFunction
    def a(n): return ((n+2)//3) if (n<4) else a(n-1) + a(n-4) # a = A003269
    [a(n) for n in (0..50)] # G. C. Greubel, Jul 25 2022

Formula

G.f.: x/(1-x-x^4).
G.f.: -1 + 1/(1-Sum_{k>=0} x^(4*k+1)).
a(n) = a(n-3) + a(n-4) + a(n-5) + a(n-6) for n>4.
a(n) = floor(d*c^n + 1/2) where c is the positive real root of -x^4+x^3+1 and d is the positive real root of 283*x^4-18*x^2-8*x-1 (c=1.38027756909761411... and d=0.3966506381592033124...). - Benoit Cloitre, Nov 30 2002
Equivalently, a(n) = floor(c^(n+3)/(c^4+3) + 1/2) with c as defined above (see A086106). - Greg Dresden and Shuer Jiang, Aug 31 2019
a(n) = term (1,2) in the 4 X 4 matrix [1,1,0,0; 0,0,1,0; 0,0,0,1; 1,0,0,0]^n. - Alois P. Heinz, Jul 27 2008
From Paul Barry, Oct 20 2009: (Start)
a(n+1) = Sum_{k=0..n} C((n+3*k)/4,k)*((1+(-1)^(n-k))/2 + cos(Pi*n/2))/2;
a(n+1) = Sum_{k=0..n} C(k,floor((n-k)/3))(2*cos(2*Pi*(n-k)/3)+1)/3. (End)
a(n) = Sum_{j=0..(n-1)/3} binomial(n-1-3*j,j) (cf. A180184). - Vladimir Kruchinin, May 23 2011
A017817(n) = a(-4 - n) * (-1)^n. - Michael Somos, Jul 12 2003
G.f.: Q(0)*x/2, where Q(k) = 1 + 1/(1 - x*(2*k+1 + x^3)/( x*(2*k+2 + x^3) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 29 2013
Appears a(n) = hypergeometric([1/4-n/4,1/2-n/4,3/4-n/4,1-n/4], [1/3-n/3,2/3-n/3,1-n/3], -4^4/3^3) for n>=10. - Peter Luschny, Sep 18 2014

Extensions

Additional comments from Yong Kong (ykong(AT)curagen.com), Dec 16 2000
Initial 0 prepended by N. J. A. Sloane, Apr 09 2008

A002524 Number of permutations of length n within distance 2 of a fixed permutation.

Original entry on oeis.org

1, 1, 2, 6, 14, 31, 73, 172, 400, 932, 2177, 5081, 11854, 27662, 64554, 150639, 351521, 820296, 1914208, 4466904, 10423761, 24324417, 56762346, 132458006, 309097942, 721296815, 1683185225, 3927803988, 9165743600, 21388759708, 49911830577, 116471963129
Offset: 0

Views

Author

Keywords

Comments

From Torleiv Kløve, Jan 09 2009: (Start)
Let V(d,n) be the number of permutations of length n within distance d of a fixed permutation. For d=1,2,3,4,...,10 these are A000045, A002524, A002526, A072856, A154654, A154655, A154656, A154657, A154658, A154659. The generating function is a rational function f_d(z)/g_d(z) (see the Kløve report referenced here). For d<=6, deg g_d = 2^{d-1} + binomial(2*d,d)/2 and deg f_d(z) = deg g_d(z)-2d. As a table:
d deg g_d deg f_d
1 2 0
2 5 1
3 14 8
4 43 35
5 142 132
6 494 482
(End)
For positive n, a(n) equals the permanent of the n X n matrix with 1's along the five central diagonals, and 0's everywhere else. - John M. Campbell, Jul 09 2011

References

  • D. H. Lehmer, Permutations with strongly restricted displacements. Combinatorial theory and its applications, II (Proc. Colloq., Balatonfured, 1969), pp. 755-770. North-Holland, Amsterdam, 1970.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • R. P. Stanley, Enumerative Combinatorics I, Example 4.7.16, p. 253.

Crossrefs

Column k=2 of A306209.

Programs

  • Magma
    I:=[1,1,2,6,14]; [n le 5 select I[n] else 2*Self(n-1) +2*Self(n-3) -Self(n-5): n in [1..41]]; // G. C. Greubel, Jan 21 2022
    
  • Mathematica
    CoefficientList[Series[(1-x)/(1-2*x-2*x^3+x^5), {x,0,50}], x] (* Vladimir Joseph Stephan Orlovsky, Jun 24 2011 *)
  • PARI
    a(n)=if(n,([0,1,0,0,0; 0,0,1,0,0; 0,0,0,1,0; 0,0,0,0,1; -1,0,2,0,2]^n*[1;1;2;6;14])[1,1],1) \\ Charles R Greathouse IV, Jul 28 2015
    
  • Sage
    [( (1-x)/(1-2*x-2*x^3+x^5) ).series(x,n+1).list()[n] for n in (0..40)] # G. C. Greubel, Jan 21 2022

Formula

G.f.: (1-x)/(1-2*x-2*x^3+x^5). - Simon Plouffe in his 1992 dissertation.

Extensions

Typo in comment corrected by Vaclav Kotesovec, Dec 01 2012

A072827 Number of permutations satisfying i-2<=p(i)<=i+3, i=1..n.

Original entry on oeis.org

1, 2, 6, 18, 46, 115, 301, 792, 2068, 5380, 14020, 36581, 95413, 248786, 648714, 1691686, 4411530, 11503991, 29998953, 78228640, 203998184, 531969064, 1387222648, 3617479225, 9433351129, 24599481138, 64148406350, 167280683834
Offset: 1

Views

Author

Vladimir Baltic, Jul 21 2002

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1,2,3,5,6,-1,-1,0,-1,-1},{1,2,6,18,46,115,301,792,2068,5380},30] (* Harvey P. Dale, Aug 15 2014 *)
  • PARI
    a(n)=([0,1,0,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,1,0,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,1,0,0; 0,0,0,0,0,0,0,0,1,0; 0,0,0,0,0,0,0,0,0,1; -1,-1,0,-1,-1,6,5,3,2,1]^(n-1)*[1;2;6;18;46;115;301;792;2068;5380])[1,1] \\ Charles R Greathouse IV, Jul 28 2015

Formula

Recurrence: a(n) = a(n-1)+2*a(n-2)+3*a(n-3)+5*a(n-4)+6*a(n-5)-a(n-6)-a(n-7)-a(n-9)-a(n-10).
G.f.: (1-x^5-x^3-x^2)/(x^10+x^9+x^7+x^6-6*x^5-5*x^4-3*x^3-2*x^2-x+1). [Corrected by Georg Fischer, May 15 2019]

A072850 Number of permutations satisfying i-2<=p(i)<=i+4, i=1..n.

Original entry on oeis.org

1, 2, 6, 18, 54, 146, 391, 1081, 3004, 8320, 22984, 63424, 175176, 484113, 1337721, 3695886, 10210702, 28209954, 77940078, 215337554, 594943087, 1643728129, 4541349672, 12547013504, 34665373744, 95774808224, 264610227072
Offset: 1

Views

Author

Vladimir Baltic, Jul 25 2002

Keywords

Crossrefs

Formula

Recurrence: a(n) = a(n - 1) + 2*a(n - 2) + 4*a(n - 3) + 6*a(n - 4) + 10*a(n - 5) + 12*a(n - 6) - 4*a(n - 7) - 6*a(n - 8) - 6*a(n - 9) - 2*a(n - 11) - 2*a(n - 12) + a(n - 14) + a(n - 15).
G.f.: - (x^9 + x^7 - 2*x^6 - 2*x^4 - 2*x^3 - x^2 + 1)/(x^15 + x^14 - 2*x^12 - 2*x^11 - 6*x^9 - 6*x^8 - 4*x^7 + 12*x^6 + 10*x^5 + 6*x^4 + 4*x^3 + 2*x^2 + x - 1)

A080014 Number of permutations satisfying -k<=p(i)-i<=r and p(i)-i not in I, i=1..n, with k=2, r=2, I={1}.

Original entry on oeis.org

1, 1, 1, 3, 6, 10, 18, 35, 65, 119, 221, 412, 764, 1416, 2629, 4881, 9057, 16807, 31194, 57894, 107442, 199399, 370065, 686799, 1274617, 2365544, 4390184, 8147680, 15121161, 28063153, 52082017, 96658283, 179386750, 332921362, 617864098
Offset: 0

Views

Author

Vladimir Baltic, Jan 24 2003

Keywords

References

  • D. H. Lehmer, Permutations with strongly restricted displacements. Combinatorial theory and its applications, II (Proc. Colloq., Balatonfured, 1969), pp. 755-770. North-Holland, Amsterdam, 1970.

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1,1,1,1,-1,-1},{1,1,1,3,6,10},40] (* Harvey P. Dale, Mar 10 2024 *)
  • PARI
    Vec(-(x^2-1)/(x^6+x^5-x^4-x^3-x^2-x+1)+O(x^99)) \\ Charles R Greathouse IV, Jun 12 2015

Formula

Recurrence: a(n) = a(n-1)+a(n-2)+a(n-3)+a(n-4)-a(n-5)-a(n-6).
G.f.: -(x^2-1)/(x^6+x^5-x^4-x^3-x^2-x+1).

A079955 Number of permutations satisfying -k<=p(i)-i<=r and p(i)-i not in I, i=1..n, with k=1, r=5, I={0,2,3}.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 2, 2, 3, 3, 5, 6, 9, 11, 15, 19, 26, 34, 46, 60, 80, 105, 140, 185, 246, 325, 431, 570, 756, 1001, 1327, 1757, 2328, 3083, 4085, 5411, 7169, 9496, 12580, 16664, 22076, 29244, 38741, 51320, 67985, 90060, 119305, 158045, 209366, 277350, 367411
Offset: 0

Views

Author

Vladimir Baltic, Feb 19 2003

Keywords

Comments

Number of compositions (ordered partitions) of n into elements of the set {2,5,6}.

References

  • D. H. Lehmer, Permutations with strongly restricted displacements. Combinatorial theory and its applications, II (Proc. Colloq., Balatonfured, 1969), pp. 755-770. North-Holland, Amsterdam, 1970.

Crossrefs

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 50); Coefficients(R!( 1/(1-x^2-x^5-x^6) )); // G. C. Greubel, Dec 11 2019
    
  • Maple
    seq(coeff(series(1/(1-x^2-x^5-x^6), x, n+1), x, n), n = 0..50); # G. C. Greubel, Dec 11 2019
  • Mathematica
    LinearRecurrence[{0, 1, 0, 0, 1, 1}, {1, 0, 1, 0, 1, 1}, 51] (* Jean-François Alcover, Dec 11 2019 *)
  • PARI
    a(n) = ([0,1,0,0,0,0; 0,0,1,0,0,0; 0,0,0,1,0,0; 0,0,0,0,1,0; 0,0,0,0,0,1; 1,1,0,0,1,0]^n*[1;0;1;0;1;1])[1,1] \\ Charles R Greathouse IV, Jul 28 2015
    
  • Sage
    def A079955_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( 1/(1-x^2-x^5-x^6) ).list()
    A079955_list(50) # G. C. Greubel, Dec 11 2019

Formula

a(n) = a(n-2) + a(n-5) + a(n-6).
G.f.: 1/(1 - x^2 - x^5 - x^6).

A079998 The characteristic function of the multiples of five.

Original entry on oeis.org

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

Views

Author

Vladimir Baltic, Feb 10 2003

Keywords

Comments

Number of permutations satisfying -k <= p(i) - i <= r and p(i) - i not in I, i = 1..n, with k = 2, r = 3, I = {-1, 0, 1, 2}.
a(n) = 1 if n = 5k, a(n) = 0 otherwise. Also, number of permutations satisfying -k <= p(i) - i <= r and p(i) - i not in I, i = 1..n, with k = 1, r = 4, I = {0, 1, 2, 3}.
a(n) is also the number of partitions of n with each part being five (a(0) = 1 because the empty partition has no parts to test equality with five). Hence a(n) is also the number of 2-regular graphs on n vertices with each component having girth exactly five. - Jason Kimberley, Oct 02 2011
This sequence is the Euler transformation of A185015. - Jason Kimberley, Oct 02 2011

References

  • D. H. Lehmer, Permutations with strongly restricted displacements. Combinatorial theory and its applications, II (Proc. Colloq., Balatonfured, 1969), pp. 755-770. North-Holland, Amsterdam, 1970.

Crossrefs

Characteristic function of multiples of g: A000007 (g = 0), A000012 (g = 1), A059841 (g = 2), A079978 (g = 3), A121262 (g = 4), this sequence (g = 5), A079979 (g = 6), A082784 (g = 7). - Jason Kimberley, Oct 14 2011

Programs

Formula

Recurrence: a(n) = a(n-5). G.f.: -1/(x^5 - 1).
a(n) = 1 - A011558(n); a(A008587(n)) = 1; a(A047201(n)) = 0. - Reinhard Zumkeller, Nov 30 2009
a(n) = floor(1/2*cos(2*n*Pi/5) + 1/2). - Gary Detlefs, May 16 2011
a(n) = floor(n/5) - floor((n-1)/5). - Tani Akinari, Oct 21 2012
a(n) = binomial(n - 1, 4) mod 5. - Wesley Ivan Hurt, Oct 06 2014

Extensions

More terms from Antti Karttunen, Dec 21 2017

A079979 Characteristic function of multiples of six.

Original entry on oeis.org

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

Views

Author

Vladimir Baltic, Feb 17 2003

Keywords

Comments

Period 6: repeat [1, 0, 0, 0, 0, 0].
a(n)=1 if n=6k, a(n)=0 otherwise.
Decimal expansion of 1/999999.
Number of permutations satisfying -k <= p(i)-i <= r and p(i)-i not in I, i=1..n, with k=3, r=3, I={-2,-1,0,1,2}.
Also, number of permutations satisfying -k <= p(i)-i <= r and p(i)-i not in I, i=1..n, with k=1, r=5, I={0,1,2,3,4}.
a(n) is also the number of partitions of n such that each part is six (a(0)=1 because the empty partition has no parts to test equality with six). Hence a(n) is also the number of 2-regular graphs on n vertices with each part having girth exactly six. - Jason Kimberley, Oct 10 2011
This sequence is the Euler transformation of A185016. - Jason Kimberley, Oct 10 2011

References

  • D. H. Lehmer, Permutations with strongly restricted displacements. Combinatorial theory and its applications, II (Proc. Colloq., Balatonfured, 1969), pp. 755-770. North-Holland, Amsterdam, 1970.

Crossrefs

Characteristic function of multiples of g: A000007 (g=0), A000012 (g=1), A059841 (g=2), A079978 (g=3), A121262 (g=4), A079998 (g=5), this sequence (g=6), A082784 (g=7).

Programs

Formula

a(n) = a(n-6).
G.f.: 1/(1-x^6).
a(n) = floor((1/2)*cos(n*Pi/3) + 1/2). - Gary Detlefs, May 16 2011
a(n) = floor(n/6) - floor((n-1)/6). - Tani Akinari, Oct 23 2012
a(n) = (((((v^n - w^n)^2)*(2 - (-1)^n)*(w^(2*n) + w^n - 3))^2 - 144)^2)/20736, where w = (-1+i*sqrt(3))/2, v = (1+i*sqrt(3))/2. - Bogart B. Strauss, Sep 20 2013
E.g.f.: (2*cos(sqrt(3)*x/2)*cosh(x/2) + cosh(x))/3. - Vaclav Kotesovec, Feb 15 2015

Extensions

More terms from Antti Karttunen, Dec 22 2017

A306209 Number A(n,k) of permutations of [n] within distance k of a fixed permutation; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 3, 1, 1, 1, 2, 6, 5, 1, 1, 1, 2, 6, 14, 8, 1, 1, 1, 2, 6, 24, 31, 13, 1, 1, 1, 2, 6, 24, 78, 73, 21, 1, 1, 1, 2, 6, 24, 120, 230, 172, 34, 1, 1, 1, 2, 6, 24, 120, 504, 675, 400, 55, 1, 1, 1, 2, 6, 24, 120, 720, 1902, 2069, 932, 89, 1, 1, 1, 2, 6, 24, 120, 720, 3720, 6902, 6404, 2177, 144, 1
Offset: 0

Views

Author

Alois P. Heinz, Jan 29 2019

Keywords

Comments

A(n,k) counts permutations p of [n] such that |p(j)-j| <= k for all j in [n].

Examples

			A(4,1) = 5: 1234, 1243, 1324, 2134, 2143.
A(5,2) = 31: 12345, 12354, 12435, 12453, 12534, 12543, 13245, 13254, 13425, 13524, 14235, 14253, 14325, 14523, 21345, 21354, 21435, 21453, 21534, 21543, 23145, 23154, 24135, 24153, 31245, 31254, 31425, 31524, 32145, 32154, 34125.
Square array A(n,k) begins:
  1,  1,   1,    1,    1,     1,     1,     1,     1, ...
  1,  1,   1,    1,    1,     1,     1,     1,     1, ...
  1,  2,   2,    2,    2,     2,     2,     2,     2, ...
  1,  3,   6,    6,    6,     6,     6,     6,     6, ...
  1,  5,  14,   24,   24,    24,    24,    24,    24, ...
  1,  8,  31,   78,  120,   120,   120,   120,   120, ...
  1, 13,  73,  230,  504,   720,   720,   720,   720, ...
  1, 21, 172,  675, 1902,  3720,  5040,  5040,  5040, ...
  1, 34, 400, 2069, 6902, 17304, 30960, 40320, 40320, ...
		

Crossrefs

Rows n=1-2 give: A000012, A040000.
Main diagonal gives A000142.
A(2n,n) gives A048163(n+1).
A(2n+1,n) gives A092552(n+1).
A(n,floor(n/2)) gives A306267.
A(n+2,n) gives A001564.
Cf. A130152.

Programs

  • Mathematica
    A[0, _] = 1;
    A[n_ /; n > 0, k_] := A[n, k] = Permanent[Table[If[Abs[i - j] <= k, 1, 0], {i, 1, n}, {j, 1, n}]];
    Table[A[n - k, k], {n, 0, 12}, {k, n, 0, -1 }] // Flatten (* Jean-François Alcover, Oct 18 2021, after Alois P. Heinz in A130152 *)

Formula

A(n,k) = Sum_{j=0..k} A130152(n,j) for n > 0, A(0,k) = 1.
Showing 1-10 of 87 results. Next