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.

Previous Showing 11-20 of 58 results. Next

A054925 a(n) = ceiling(n*(n-1)/4).

Original entry on oeis.org

0, 0, 1, 2, 3, 5, 8, 11, 14, 18, 23, 28, 33, 39, 46, 53, 60, 68, 77, 86, 95, 105, 116, 127, 138, 150, 163, 176, 189, 203, 218, 233, 248, 264, 281, 298, 315, 333, 352, 371, 390, 410, 431, 452, 473, 495, 518, 541, 564, 588, 613, 638, 663, 689, 716, 743, 770, 798
Offset: 0

Views

Author

N. J. A. Sloane, May 24 2000

Keywords

Comments

Number of edges in "median" graph - gives positions of largest entries in rows of table in A054924.
Form the clockwise spiral starting 0,1,2,....; then A054925(n+1) interleaves 2 horizontal (A033951, A033991) and 2 vertical (A007742, A054552) branches. A bisection is A014848. - Paul Barry, Oct 08 2007
Consider the standard 4-dimensional Euclidean lattice. We take 1 step along the positive x-axis, 2 along the positive y-axis, 3 along the positive z-axis, 4 along the positive t-axis, and then back round to the x-axis. This sequence gives the floor of the Euclidean distance to the origin after n steps. - Jon Perry, Apr 16 2013
Jon Perry's JavaScript code is explained by A238604. - Michael Somos, Mar 01 2014
Ceiling of the area under the polygon connecting the lattice points (n, floor(n/2)) from 0..n. - Wesley Ivan Hurt, Jun 09 2014
Ceiling of one-half of each triangular number. - Harvey P. Dale, Oct 03 2016
For n > 2, also the edge cover number of the (n-1)-triangular honeycomb queen graph. - Eric W. Weisstein, Jul 14 2017
Conjecture: For n>11, there always exists a prime number p such that a(n)Raul Prisacariu, Sep 01 2024
For n = 1 up to at least n = 13, also the lower matching number of the triangular honeycomb bishop graph. - Eric W. Weisstein, Dec 13 2024
Conjecturally, apart from the first term, the sequence terms are the exponents in the expansion of Sum_{n >= 0} q^(3*n) * (Product_{k >= 2*n+1} 1 - q^k) = 1 - q - q^2 + q^3 + q^5 - q^8 - q^11 + + - - .... Cf. A039825. - Peter Bala, Apr 13 2025

Examples

			a(6) = 8; ceiling(6*(6-1)/4) = ceiling(30/4) = 8.
G.f. = x^2 + 2*x^3 + 3*x^4 + 5*x^5 + 8*x^6 + 11*x^7 + 14*x^8 + 18*x^9 + 23*x^10 + ...
		

Crossrefs

Programs

  • JavaScript
    p=new Array(0,0,0,0);
    for (a=0;a<100;a++) {
    p[a%4]+=a;
    document.write(Math.floor(Math.sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]+p[3]*p[3]))+", ");
    } /* Jon Perry, Apr 16 2013 */
    
  • Magma
    [ Ceiling(n*(n-1)/4) : n in [0..50] ]; // Wesley Ivan Hurt, Jun 09 2014
    
  • Magma
    I:=[0,0,1,2,3]; [n le 5 select I[n] else 3*Self(n-1)-4*Self(n-2)+4*Self(n-3)-3*Self(n-4)+Self(n-5): n in [1..60]]; // Vincenzo Librandi, Jul 14 2015
  • Maple
    seq(ceil(binomial(n,2)/2), n=0..57); # Zerinvary Lajos, Jan 12 2009
  • Mathematica
    Table[Ceiling[(n^2 - n)/4], {n, 0, 20}] (* Wesley Ivan Hurt, Nov 01 2013 *)
    LinearRecurrence[{3, -4, 4, -3, 1}, {0, 0, 1, 2, 3}, 60] (* Vincenzo Librandi, Jul 14 2015 *)
    Join[{0}, Ceiling[#/2] &/ @ Accumulate[Range[0, 60]]] (* Harvey P. Dale, Oct 03 2016 *)
    Ceiling[Binomial[Range[0, 20], 2]/2] (* Eric W. Weisstein, Dec 13 2024 *)
    Table[Ceiling[Binomial[n, 2]/2], {n, 0, 20}] (* Eric W. Weisstein, Dec 13 2024 *)
    Table[(1 + (n - 1) n - Cos[n Pi/2] - Sin[n Pi/2])/4, {n, 0, 20}] (* Eric W. Weisstein, Dec 13 2024 *)
    CoefficientList[Series[x^2 (-1 + x - x^2)/((-1 + x)^3 (1 + x^2)), {x, 0, 20}], x] (* Eric W. Weisstein, Dec 13 2024 *)
  • PARI
    {a(n) = ceil( n * (n-1)/4)}; /* Michael Somos, Feb 11 2004 */
    
  • Sage
    [ceil(binomial(n,2)/2) for n in range(0,58)] # Zerinvary Lajos, Dec 01 2009
    

Formula

Euler transform of length 6 sequence [ 2, 0, 1, 1, 0, -1]. - Michael Somos, Sep 02 2006
From Michael Somos, Feb 11 2004: (Start)
G.f.: x^2 * (x^2 - x + 1) / ((1 - x)^3 * (1 + x^2)) = x^2 * (1 - x^6) / ((1 - x)^2 * (1 - x^3) * (1 - x^4)).
a(1-n) = a(n).
A011848(n) = a(-n). (End)
From Michael Somos, Mar 01 2014: (Start)
a(n + 4) = a(n) + 2*n + 3.
a(n+1) = floor( sqrt( A238604(n))). (End)
a(n) = A011848(n) + A133872(n+2). - Wesley Ivan Hurt, Jun 09 2014
Sum_{n>=2} 1/a(n) = 4 - Pi + 2*Pi*sinh(sqrt(7)*Pi/4)/(sqrt(7)*(1/sqrt(2)+cosh(sqrt(7)*Pi/4))). - Amiram Eldar, Dec 23 2024

A077854 Expansion of 1/((1-x)*(1-2*x)*(1+x^2)).

Original entry on oeis.org

1, 3, 6, 12, 25, 51, 102, 204, 409, 819, 1638, 3276, 6553, 13107, 26214, 52428, 104857, 209715, 419430, 838860, 1677721, 3355443, 6710886, 13421772, 26843545, 53687091, 107374182, 214748364, 429496729, 858993459, 1717986918, 3435973836, 6871947673
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Comments

Partial sums of A007910. - Mircea Merca, Dec 27 2010
This is the decimal representation of the middle column of "Rule 54" elementary cellular automaton. - Karl V. Keller, Jr., Sep 26 2021
This same sequence (except that the offset is changed to 4) is 2^n with the final digit chopped off. - J. Lowell, May 11 2022

Examples

			The sequence in hexadecimal shows the pattern
1, 3, 6, c,
19, 33, 66, cc,
199, 333, 666, ccc,
1999, 3333, 6666, cccc,
19999, 33333, 66666, ccccc,
199999, 333333, 666666, cccccc,
1999999, 3333333, 6666666, ccccccc,
19999999, 33333333, 66666666, cccccccc,
... - _Armands Strazds_, Oct 09 2014
		

Crossrefs

Equals A007909(n+3) - [n congruent 2, 3 mod 4].
Cf. A130306, A043291 (subsequence); A000975, A007910, A133872, A259661 (binary).

Programs

  • Haskell
    import Data.Bits (xor)
    a077854 n = a077854_list !! n
    a077854_list = scanl1 xor $ tail a000975_list :: [Integer]
    -- Reinhard Zumkeller, Jan 04 2013
    
  • Magma
    [Round((2^(n+4)-5)/10): n in [0..40]]; // Vincenzo Librandi, Jun 25 2011
    
  • Maple
    a := proc(n) option remember; if n=0 then RETURN(1); fi; if n=1 then RETURN(3); fi; if n=2 then RETURN(6); fi; if n=3 then RETURN(12); fi; 3*a(n-1)-3*a(n-2)+3*a(n-3)-2*a(n-4); end;
    seq(iquo(2^n,5),n=3..35); # Zerinvary Lajos, Apr 20 2008
  • Mathematica
    CoefficientList[Series[1/((1 - x) (1 - 2 x) (1 + x^2)), {x, 0, 32}], x] (* Michael De Vlieger, Mar 29 2016 *)
    LinearRecurrence[{3,-3,3,-2},{1,3,6,12},40] (* Harvey P. Dale, Feb 06 2019 *)
  • PARI
    a(n)=(16<Charles R Greathouse IV, Sep 23 2012
    
  • PARI
    Vec(1/(1-3*x+3*x^2-3*x^3+2*x^4)+O(x^99)) \\ Derek Orr, Oct 26 2014
    
  • Python
    print([2**(n+3)//5 for n in range(50)]) # Karl V. Keller, Jr., Sep 26 2021

Formula

a(n) = 3*a(n-1) - 3*a(n-2) + 3*a(n-3) - 2*a(n-4), with initial values a(0) = 1, a(1) = 3, a(2) = 6, a(3) = 12.
a(n) = (1/10)*(2^(n+4) + (-1)^floor(n/2) - 2*(-1)^floor((n+1)/2) - 5).
Row sums of A130306. - Gary W. Adamson, May 20 2007
a(n) = floor(2^(n+3)/5). - Gary Detlefs, Sep 06 2010
a(n) = round((2^(n+4)-5)/10) = floor((2^(n+3)-1)/5) = ceiling((2^(n+3)-4)/5) = round((2^(n+3)-2)/5); a(n) = a(n-4) + 3*2^(n-1), n > 3. - Mircea Merca, Dec 27 2010
a(n) = 2^(n+1) - 1 - a(n-2); a(n) = a(n-1)/2 for n == 2, 3 (mod 4); a(n) = (a(n-1)-1)/2 for n == 0, 1 (mod 4). - Arie Bos, Apr 06 2013
a(n) = floor(A000975(n+2)*3/5). - Armands Strazds, Oct 18 2014
a(n) = Sum_{k=1..n+3} floor(1 + sin(k*Pi/2 + 3*Pi/4))*2^(n-k+3). - Andres Cicuttin, Mar 28 2016
a(n) = (-15 + 3*2^(3+n) + 2^(1 + n - 4*floor((1+n)/4)) + 2^(2 + n - 4*floor((2+n)/4)))/15. - Andres Cicuttin, Mar 28 2016
a(n) = (16*2^n+(-1)^((2*n-1+(-1)^n)/4)-2*(-1)^((2*n+1-(-1)^n)/4)-5)/10. - Wesley Ivan Hurt, Apr 01 2016

A104698 Triangle read by rows: T(n,k) = Sum_{j=0..n-k} binomial(k, j)*binomial(n-j+1, k+1).

Original entry on oeis.org

1, 2, 1, 3, 4, 1, 4, 9, 6, 1, 5, 16, 19, 8, 1, 6, 25, 44, 33, 10, 1, 7, 36, 85, 96, 51, 12, 1, 8, 49, 146, 225, 180, 73, 14, 1, 9, 64, 231, 456, 501, 304, 99, 16, 1, 10, 81, 344, 833, 1182, 985, 476, 129, 18, 1, 11, 100, 489, 1408, 2471, 2668, 1765, 704, 163, 20, 1, 12
Offset: 0

Views

Author

Gary W. Adamson, Mar 19 2005

Keywords

Comments

The n-th column of the triangle is the binomial transform of the n-th row of A081277, followed by zeros. Example: column 3, (1, 6, 19, 44, ...) = binomial transform of row 3 of A081277: (1, 5, 8, 4, 0, 0, 0, ...). A104698 = reversal by rows of A142978. - Gary W. Adamson, Jul 17 2008
This sequence is jointly generated with A210222 as an array of coefficients of polynomials u(n,x): initially, u(1,x)=v(1,x)=1; for n > 1, u(n,x) = x*u(n-1,x) + v(n-1) + 1 and v(n,x) = 2x*u(n-1,x) + v(n-1,x) + 1. See the Mathematica section at A210222. - Clark Kimberling, Mar 19 2012
This Riordan triangle T appears in a formula for A001100(n, 0) = A002464(n), for n >= 1. - Wolfdieter Lang, May 13 2025

Examples

			The Riordan triangle T begins:
  n\k  0   1   2    3    4    5    6   7   8  9 10 ...
  ----------------------------------------------------
  0:   1
  1:   2   1
  2:   3   4   1
  3:   4   9   6    1
  4:   5  16  19    8    1
  5:   6  25  44   33   10    1
  6:   7  36  85   96   51   12    1
  7:   8  49 146  225  180   73   14   1
  8:   9  64 231  456  501  304   99  16   1
  9:  10  81 344  833 1182  985  476 129  18  1
  10: 11 100 489 1408 2471 2668 1765 704 163 20  1
  ... reformatted and extended by _Wolfdieter Lang_, May 13 2025
From _Wolfdieter Lang_, May 13 2025: (Start)
Zumkeller recurrence (adapted for offset [0,0]): 19 = T(4, 2) = T(2, 1) + T(3, 1) + T(3,3) = 4 + 9 + 6 = 19.
A-sequence recurrence: 19 = T(4, 2) = 1*T(3. 1) + 2*T(3. 2) - 2*T(3, 3) = 9 + 12 - 2 = 19.
Z-sequence recurrence: 5 = T(4, 0) = 2*T(3, 0) - 1*T(3, 1) + 2*T(3, 2) - 6*T(3, 3) = 8 - 9 + 12 + 6 = 5.
Boas-Buck recurrence: 19 = T(4, 2) = (1/2)*((2 + 0)*T(2, 2) + (2 + 2*2)*T(3, 2)) = (1/2)*(2 + 36) = 19. (End)
		

Crossrefs

Diagonal sums are A008937(n+1).
Cf. A048739 (row sums), A008288, A005900 (column 3), A014820 (column 4)
Cf. A081277, A142978 by antidiagonals, A119328, A110271 (matrix inverse).

Programs

  • Haskell
    a104698 n k = a104698_tabl !! (n-1) !! (k-1)
    a104698_row n = a104698_tabl !! (n-1)
    a104698_tabl = [1] : [2,1] : f [1] [2,1] where
       f us vs = ws : f vs ws where
         ws = zipWith (+) ([0] ++ us ++ [0]) $
              zipWith (+) ([1] ++ vs) (vs ++ [0])
    -- Reinhard Zumkeller, Jul 17 2015
  • Maple
    A104698 := proc(n, k) add(binomial(k, j)*binomial(n-j+1, n-k-j), j=0..n-k) ; end proc:
    seq(seq(A104698(n, k), k=0..n), n=0..15); # R. J. Mathar, Sep 04 2011
    T := (n, k) -> binomial(n + 1, k + 1)*hypergeom([-k, k - n], [-n - 1], -1):
    for n from 0 to 9 do seq(simplify(T(n, k)), k = 0..n) od;
    T := proc(n, k) option remember; if k = 0 then n + 1 elif k = n then 1 else T(n-2, k-1) + T(n-1, k-1) + T(n-1, k) fi end: # Peter Luschny, May 13 2025
  • Mathematica
    u[1, ] = 1; v[1, ] = 1;
    u[n_, x_] := u[n, x] = x u[n-1, x] + v[n-1, x] + 1;
    v[n_, x_] := v[n, x] = 2 x u[n-1, x] + v[n-1, x] + 1;
    Table[CoefficientList[u[n, x], x], {n, 1, 11}] // Flatten (* Jean-François Alcover, Mar 10 2019, after Clark Kimberling *)
  • PARI
    T(n,k)=sum(j=0,n-k,binomial(k,j)*binomial(n-j+1,k+1)) \\ Charles R Greathouse IV, Jan 16 2012
    

Formula

The triangle is extracted from the product A * B; A = [1; 1, 1; 1, 1, 1; ...], B = [1; 1, 1; 1, 3, 1; 1, 5, 5, 1; ...] both infinite lower triangular matrices (rest of the terms are zeros). The triangle of matrix B by rows = A008288, Delannoy numbers.
From Paul Barry, Jul 18 2005: (Start)
Riordan array (1/(1-x)^2, x(1+x)/(1-x)) = (1/(1-x), x)*(1/(1-x), x(1+x)/(1-x)).
T(n, k) = Sum_{j=0..n} Sum_{i=0..j-k} C(j-k, i)*C(k, i)*2^i.
T(n, k) = Sum_{j=0..k} Sum_{i=0..n-k-j} (n-k-j-i+1)*C(k, j)*C(k+i-1, i). (End)
T(n, k) = binomial(n+1, k+1)*2F1([-k, k-n], [-n-1], -1) where 2F1 is a Gaussian hypergeometric function. - R. J. Mathar, Sep 04 2011
T(n, k) = T(n-2, k-1) + T(n-1, k-1) + T(n-1, k) for 1 < k < n; T(n, 0) = n + 1; T(n, n) = 1. - Reinhard Zumkeller, Jul 17 2015
From Wolfdieter Lang, May 13 2025: (Start)
The Riordan triangle T = (1/(1 - x)^2, x*(1 + x)/(1 - x)) has the o.g.f. G(x, y) = 1/((1 - x)*(1 - x - y*x*(1+x))) for the row polynomials R(n, y) = Sum_{k=0..n} T(n, k)*y^k.
The o.g.f. for column k is G(k, x) = (1/(1 - x)^2)*(x*(1 + x)/(1 - x))^k, for k >= 0.
The o.g.f. for the diagonal m is D(m, x) = N(m, x)/(1 - x)^(m+1), with the numerator polynomial N(m, x) = Sum_{k=0..floor(m/2)} A034867(m, k)*x^(2*k) for m >= 0.
The row sums with o.g.f. R(x) = 1/((1 -x)*(1 - 2*x -x^2) give A048739.
The alternating row sums with o.g.f. 1/((1 - x)(1 + x^2)) give A133872.
The A-sequence for this Riordan triangle has o.g.f. A(x) = 1 + x + sqrt(1 + 6*x + x^2))/2 giving A112478(n). Hence T(n, k) = Sum_{j=0..n-k} A112478(j)*T(n-1, k-1+j), for n >= 1, k >= 1, T(n, k) = 0 for n < k, and T(0, 0) = 1.
The Z-sequence has o.g.f. (5 + x - sqrt(1 + 6*x + x^2))/2 = 3 + x - A(x) giving Z(n) = {2, -1, -A112478(n >= 2)}. Hence T(n, 0) = Sum_{j=0..n-1} Z(j)*T(n-1, j), for n >= 1. For A- and Z-sequences of Riordan triangles see a W. Lang link at A006232 with references.
The Boas-Buck sequences alpha and beta for the Riordan triangle T (see A046521 for the Aug 10 2017 comment and reference) are alpha(n) = A040000(n+1) = repeat{2} and beta(n) = A010673(n+1) = repeat{2,0}. Hence the recurrence for column T(n, k){n>=k}, with input T(k, k) = 1, for k >= 0, is T(n, k) = (1/(n-k)) * Sum{j=k..n-1} (2 + k*(1 + (-1)^(n-1-j))) *T(j,k), for n >= k+1. (End)

A133622 a(n) = 1 if n is odd, a(n) = n/2+1 if n is even.

Original entry on oeis.org

1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 1, 11, 1, 12, 1, 13, 1, 14, 1, 15, 1, 16, 1, 17, 1, 18, 1, 19, 1, 20, 1, 21, 1, 22, 1, 23, 1, 24, 1, 25, 1, 26, 1, 27, 1, 28, 1, 29, 1, 30, 1, 31, 1, 32, 1, 33, 1, 34, 1, 35, 1, 36, 1, 37, 1, 38, 1, 39, 1, 40, 1, 41, 1, 42, 1, 43, 1, 44, 1
Offset: 1

Views

Author

Hieronymus Fischer, Sep 30 2007

Keywords

Comments

a(n) is the count of terms a(n+1) present so far in the sequence, with a(n+1) included in the count; example: a(1) = 1 "says" that there is 1 term "2" so far in the sequence; a(2) = 2 "says" that there are 2 terms "1" so far in the sequence... etc. This comment was inspired by A039617. - Eric Angelini, Mar 03 2020

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a133622 n = (1 - m) * n' + 1 where (n', m) = divMod n 2
    a133622_list = concat $ transpose [[1, 1 ..], [2 ..]]
    -- Reinhard Zumkeller, Feb 20 2015
    
  • Maple
    seq([1,n][],n=2..100); # Robert Israel, May 27 2016
  • Mathematica
    Riffle[Range[2,50],1,{1,-1,2}] (* Harvey P. Dale, Jan 19 2013 *)
  • PARI
    a(n)=if(n%2,1,n/2+1) \\ Charles R Greathouse IV, Sep 02 2015

Formula

a(n)=1+(binomial(n+1,2)mod n)=1+(binomial(n+1,n-1)mod n).
a(n)=binomial(n+2,2) mod n = binomial(n+2,n) mod n for n>2.
a(n)=1+(1+(-1)^n)*n/4.
a(n)=1+(A000217(n) mod n).
a(n)=a(n-2)+1, if n is even, a(n)=a(n-2) if n is odd.
a(n)=a(n-2)+1-(n mod 2)=a(n-2)+(1+(-1)^n)/2 for n>2.
a(n)=(a(n-3)+a(n-2))/a(n-1) for n>3.
G.f.: g(x)=x(1+2x-x^2-x^3)/(1-x^2)^2.
G.f.: (Q(0)-1-x)/x^2, where Q(k)= 1 + (k+1)*x/(1 - x/(x + (k+1)/Q(k+1))); (continued fraction). - Sergei N. Gladkovskii, Apr 23 2013
a(n) = 2*a(n-2)-a(n-4) for n > 4. - Chai Wah Wu, May 26 2016
E.g.f.: exp(x) - 1 + x*sinh(x)/2. - Robert Israel, May 27 2016

A131078 Periodic sequence (1, 1, 1, 1, 0, 0, 0, 0).

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, following a suggestion of Paul Curtz, Jun 14 2007

Keywords

Crossrefs

Period 2*k: repeat k ones followed by k zeros: A000035(n+1) (k=1), A133872(n) (k=2), A088911 (k=3), this sequence (k=4), and A112713(n-1) (k=5).

Programs

  • Magma
    m:=105; [ [1, 1, 1, 1, 0, 0, 0, 0][ (n-1) mod 8 + 1 ]: n in [1..m] ];
    
  • Magma
    &cat[[1, 1, 1, 1, 0, 0, 0,0]: n in [0..10]]; // Vincenzo Librandi, May 31 2015
    
  • Magma
    [Floor((1+(-1)^((2*n+11-(-1)^n+2*(-1)^((2*n+5-(-1)^n)/4))/8))/2): n in [1..60]]; // Vincenzo Librandi, May 31 2015
    
  • PARI
    {m=105; for(n=1, m, print1((n-1)%8<4, ","))}
    
  • Python
    def A131078(n): return int(not n-1&4) # Chai Wah Wu, Jan 31 2023

Formula

a(1) = a(2) = a(3) = a(4) = 1, a(5) = a(6) = a(7) = a(8) = 0; for n > 8, a(n) = a(n-8).
G.f.: x/((1-x)*(1+x^4)).
a(n) = floor(((n+4) mod 8)/4). [Gary Detlefs, May 17 2011]
From Wesley Ivan Hurt, May 30 2015: (Start)
a(n) = a(n-1)-a(n-4)+a(n-5), n>5.
a(n) = (1+(-1)^((2*n+11-(-1)^n+2*(-1)^((2*n+5-(-1)^n)/4))/8))/2. (End)
From Ridouane Oudra, Nov 17 2019: (Start)
a(n) = binomial(n+3,4) mod 2
a(n) = floor((n+3)/4) - 2*floor((n+3)/8). (End)

A064706 Square of permutation defined by A003188.

Original entry on oeis.org

0, 1, 2, 3, 5, 4, 7, 6, 10, 11, 8, 9, 15, 14, 13, 12, 20, 21, 22, 23, 17, 16, 19, 18, 30, 31, 28, 29, 27, 26, 25, 24, 40, 41, 42, 43, 45, 44, 47, 46, 34, 35, 32, 33, 39, 38, 37, 36, 60, 61, 62, 63, 57, 56, 59, 58, 54, 55, 52, 53, 51, 50, 49, 48, 80, 81, 82, 83, 85, 84, 87, 86
Offset: 0

Views

Author

N. J. A. Sloane, Oct 13 2001

Keywords

Comments

Inverse of sequence A064707 considered as a permutation of the nonnegative integers.
Not the same as A100282: a(n) = A100282(n) = A100280(A100280(n)) only for n < 64. - Reinhard Zumkeller, Nov 11 2004

Crossrefs

Cf. A064707 (inverse), A165211 (mod 2).
Cf. also A054238, A163233, A302846.

Programs

  • MATLAB
    A = 1; for i = 1:7 B = A(end:-1:1); A = [A (B + length(A))]; end A(A) - 1
    
  • Mathematica
    Array[BitXor[#, Floor[#/4]] &, 72, 0] (* Michael De Vlieger, Apr 14 2018 *)
  • PARI
    a(n)=bitxor(n,n\4)
    
  • PARI
    { for (n=0, 1000, write("b064706.txt", n, " ", bitxor(n, n\4)) ) } \\ Harry J. Smith, Sep 22 2009
    
  • Python
    def A064706(n): return n^ n>>2 # Chai Wah Wu, Jun 29 2022
  • R
    maxn <- 63 # by choice
    b <- c(1,0,0)
    for(n in 4:maxn) b[n] <- b[n-1] - b[n-2] + b[n-3]
    # c(1,b) is A133872
    a <- 1
    for(n in 1:maxn) {
    a[2*n  ] <- 2*a[n] + 1 - b[n]
    a[2*n+1] <- 2*a[n] +     b[n]
    }
    (a <- c(0,a))
    # Yosu Yurramendi, Oct 25 2020
    

Formula

a(n) = A003188(A003188(n)).
a(n) = n XOR floor(n/4), where XOR is binary exclusive OR. - Paul D. Hanna, Oct 25 2004
a(n) = A233280(A180201(n)), n > 0. - Yosu Yurramendi, Apr 05 2017
a(n) = A000695(A003188(A059905(n))) + 2*A000695(A003188(A059906(n))). - Antti Karttunen, Apr 14 2018

Extensions

More terms from David Wasserman, Aug 02 2002

A084101 Expansion of (1+x)^2/((1-x)*(1+x^2)).

Original entry on oeis.org

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

Views

Author

Paul Barry, May 15 2003

Keywords

Comments

Partial sums of A084099. Inverse binomial transform of A000749 (without leading zeros).
From Klaus Brockhaus, May 31 2010: (Start)
Periodic sequence: Repeat 1, 3, 3, 1.
Interleaving of A010684 and A176040.
Continued fraction expansion of (7 + 5*sqrt(29))/26.
Decimal expansion of 121/909.
a(n) = A143432(n+3) + 1 = 2*A021913(n+1) + 1 = 2*A133872(n+3) + 1.
a(n) = A165207(n+1) - 1.
First differences of A047538.
Binomial transform of A084102. (End)
From Wolfdieter Lang, Feb 09 2012: (Start)
a(n) = A045572(n+1) (Modd 5) := A203571(A045572(n+1)), n >= 0.
For general Modd n (not to be confused with mod n) see a comment on A203571. The nonnegative members of the five residue classes Modd 5, called [m] for m=0,1,...,4, are shown in the array A090298 if there the last row is taken as class [0] after inclusion of 0.
(End)

Examples

			From _Wolfdieter Lang_, Feb 09 2012: (Start)
Modd 5 of nonnegative odd numbers restricted mod 5:
A045572: 1, 3, 7, 9, 11, 13, 17, 19, 21, 23, ...
Modd 5:  1, 3, 3, 1,  1,  3,  3,  1,  1,  3, ...
(End)
		

Crossrefs

Cf. A084102.
Cf. A010684 (repeat 1, 3), A176040 (repeat 3, 1), A178593 (decimal expansion of (7+5*sqrt(29))/26), A143432 (expansion of (1+x^4)/((1-x)*(1+x^2))), A021913 (repeat 0, 0, 1, 1), A133872 (repeat 1, 1, 0, 0), A165207 (repeat 2, 2, 4, 4), A047538 (congruent to 0, 1, 4 or 7 mod 8), A084099 (expansion of (1+x)^2/(1+x^2)), A000749 (expansion of x^3/((1-x)^4-x^4)). - Klaus Brockhaus, May 31 2010

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 100); Coefficients(R!( (1+x)^2/((1-x)*(1+x^2)) )); // G. C. Greubel, Feb 28 2019
    
  • Mathematica
    CoefficientList[Series[(1+x)^2/((1-x)(1+x^2)),{x,0,110}],x] (* or *) PadRight[{},110,{1,3,3,1}] (* Harvey P. Dale, Nov 21 2012 *)
  • PARI
    x='x+O('x^100); Vec((1+x)^2/((1-x)*(1+x^2))) \\ Altug Alkan, Dec 24 2015
    
  • Sage
    ((1+x)^2/((1-x)*(1+x^2))).series(x, 100).coefficients(x, sparse=False) # G. C. Greubel, Feb 28 2019

Formula

a(n) = binomial(3, n mod 4). - Paul Barry, May 25 2003
From Klaus Brockhaus, May 31 2010: (Start)
a(n) = a(n-4) for n > 3; a(0) = a(3) = 1, a(1) = a(2) = 3.
a(n) = (4 - (1+i)*i^n - (1-i)*(-i)^n)/2 where i = sqrt(-1). (End)
E.g.f.: 2*exp(x) + sin(x) - cos(x). - Arkadiusz Wesolowski, Nov 04 2017
a(n) = 2 - (-1)^(n*(n+1)/2). - Guenther Schrack, Feb 26 2019

A159916 Triangle T(m,n) = number of subsets of {1,...,m} with n elements having an odd sum, 1 <= n <= m.

Original entry on oeis.org

1, 1, 1, 2, 2, 0, 2, 4, 2, 0, 3, 6, 4, 2, 1, 3, 9, 10, 6, 3, 1, 4, 12, 16, 16, 12, 4, 0, 4, 16, 28, 32, 28, 16, 4, 0, 5, 20, 40, 60, 66, 44, 16, 4, 1, 5, 25, 60, 100, 126, 110, 60, 20, 5, 1, 6, 30, 80, 160, 236, 236, 160, 80, 30, 6, 0, 6, 36, 110, 240, 396, 472, 396, 240, 110, 36, 6, 0
Offset: 1

Views

Author

M. F. Hasler, Apr 30 2009

Keywords

Comments

One could extend the triangle to include values for m=0 and/or n=0, but these correspond to empty sets and would always be 0. The first odd value for odd m and 1

Examples

			The triangle starts:
(m=1) 1,
(m=2) 1,1,
(m=3) 2,2,0,
(m=4) 2,4,2,0,
(m=5) 3,6,4,2,1,
...
T(5,3)=4, since the set {1,2,3,4,5} has four 3-element subsets having an odd sum of elements, namely {1,2,4}, {1,3,5}, {2,3,4} and {2,4,5}.
		

Crossrefs

T(2n,n) gives A110145.

Programs

  • Maple
    b:= proc(n, s) option remember; expand(
          `if`(n=0, s, b(n-1, s)+x*b(n-1, irem(s+n, 2))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(b(n, 0)):
    seq(T(n), n=1..15);  # Alois P. Heinz, Feb 04 2017
  • Mathematica
    b[n_, s_] := b[n, s] = Expand[If[n==0, s, b[n-1, s] + x*b[n-1, Mod[s+n, 2]] ]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 1, n}]][b[n, 0]];
    Table[T[n], {n, 1, 15}] // Flatten (* Jean-François Alcover, Nov 17 2017, after Alois P. Heinz *)
  • PARI
    T(n,k)=sum( i=2^k-1,2^n-2^(n-k), norml2(binary(i))==k & sum(j=0,n\2, bittest(i,2*j))%2 )

Formula

T(m,m) = A133872(m-1), T(m,1) = A004526(m+1).
T(n,k) = A007318(n,k) - A282011(n,k). - Alois P. Heinz, Feb 06 2017

A133911 Number of prime factors (counted with multiplicity) of the period numbers defined by A133900.

Original entry on oeis.org

0, 2, 2, 4, 2, 5, 2, 6, 4, 6, 2, 8, 2, 6, 5, 8, 2, 9, 2, 8, 5, 7, 2, 10, 4, 7, 6, 8, 2, 12, 2, 10, 6, 8, 5, 12, 2, 8, 6, 11, 2, 12, 2, 9, 8, 8, 2, 13, 4, 10, 6, 9, 2, 12, 5, 11, 6, 8, 2, 14, 2, 8, 8, 12, 5, 13, 2, 10, 6, 13, 2, 14, 2, 9, 8, 10, 5, 13, 2, 13, 8, 10, 2, 17, 5, 9, 7, 11, 2, 16, 5, 10, 7, 9
Offset: 1

Author

Hieronymus Fischer, Oct 20 2007

Keywords

Examples

			a(6)=5, since A133900(6)=72=2*2*2*3*3.
a(12)=8, since A133900(12)=864=2*2*2*2*2*3*3*3.
		

Formula

a(n)=A001222(A133900(n)).

A211955 Triangle of coefficients of a polynomial sequence related to the Morgan-Voyce polynomials A085478.

Original entry on oeis.org

1, 1, 1, 1, 3, 2, 1, 6, 10, 4, 1, 10, 30, 28, 8, 1, 15, 70, 112, 72, 16, 1, 21, 140, 336, 360, 176, 32, 1, 28, 252, 840, 1320, 1056, 416, 64, 1, 36, 420, 1848, 3960, 4576, 2912, 960, 128, 1, 45, 660, 3696, 10296, 16016, 14560, 7680, 2176, 256
Offset: 0

Author

Peter Bala, Apr 30 2012

Keywords

Comments

Let b(n,x) = Sum_{k = 0..n} binomial(n+k,2*k)*x^k denote the Morgan-Voyce polynomials of A085478. This triangle lists the coefficients (in ascending powers of x) of the related polynomial sequence R(n,x) := (1/2)*b(n,2*x) + 1/2. Several sequences already in the database are of the form (R(n,x))n>=0 for a fixed value of x. These include A101265 (x = 1), A011900 (x = 2), A182432 (x = 3), A054318 (x = 4) as well as signed versions of A133872 (x = -1), A109613(x = -2), A146983 (x = -3) and A084159 (x = -4).
The polynomials R(n,x) factorize in the ring Z[x] as R(n,x) = P(n,x)*P(n+1,x) for n >= 1: explicitly, P(2*n,x) = 1/2*(b(2*n,2*x) + 1)/b(n,2*x) and P(2*n+1,x) = b(n,2*x). The coefficients of P(n,x) occur in several tables in the database, although without the connection to the Morgan-Voyce polynomials being noted - see A211956 for more details. In terms of T(n,x), the Chebyshev polynomials of the first kind, we have P(2*n,x) = T(2*n,u) and P(2*n+1,x) = 1/u * T(2*n+1,u), where u = sqrt((x+2)/2). Hence R(n,x) = 1/u * T(n,u) * T(n+1,u).

Examples

			Triangle begins
.n\k.|..0....1....2....3....4....5....6
= = = = = = = = = = = = = = = = = = = =
..0..|..1
..1..|..1....1
..2..|..1....3....2
..3..|..1....6...10....4
..4..|..1...10...30...28....8
..5..|..1...15...70..112...72...16
..6..|..1...21..140..336..360..176...32
		

Crossrefs

Formula

T(n,0) = 1; T(n,k) = 2^(k-1)*binomial(n+k,2*k) for k > 0.
O.g.f. for column k (except column 0): 2^(k-1)*x^k/(1-x)^(2*k+1).
O.g.f.: (1-t*(x+2)+t^2)/((1-t)*(1-2*t(x+1)+t^2)) = 1 + (1+x)*t + (1+3*x+2*x^2)*t^2 + ....
Removing the first column from the triangle produces the Riordan array (x/(1-x)^3, 2*x/(1-x)^2).
The row polynomials R(n,x) := 1/2*b(n,2*x) + 1/2 = 1 + x*Sum_{k = 1..n} binomial(n+k,2*k)*(2*x)^(k-1).
Recurrence equation: R(n,x) = 2*(1+x)*R(n-1,x) - R(n-2,x) - x with initial conditions R(0,x) = 1, R(1,x) = 1+x.
Another recurrence is R(n,x)*R(n-2,x) = R(n-1,x)*(R(n-1,x) + x).
With P(n,x) as defined in the Comments section we have (x+2)/x - {Sum_{k = 0..2n} 1/R(k,x)}^2 = 2/(x*P(2*n+1,x)^2); (x+2)/x - {Sum_{k = 0..2n+1} 1/R(k,x)}^2 = (x+2)/(x*P(2*n+2,x)^2); consequently Sum_{k >= 0} 1/R(k,x) = sqrt((x+2)/x) for either x > 0 or x <= -2.
Row sums R(n,1) = A101265(n+1); Alt. row sums R(n,-1) = A133872(n+1);
R(n,2) = A011900(n); R(n,-2) = (-1)^n * A109613(n); R(n,3) = A182432;
R(n,-3) = (-1)^n * A146983(n); R(n,4) = A054318(n+1); R(n,-4) = (-1)^n * A084159(n).
Previous Showing 11-20 of 58 results. Next