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

A194590 a(n) = (-1)^n*(A056040(n+1)*A152271(n)-2^n)/2.

Original entry on oeis.org

0, 0, 1, -2, 7, -14, 38, -76, 187, -374, 874, -1748, 3958, -7916, 17548, -35096, 76627, -153254, 330818, -661636, 1415650, -2831300, 6015316, -12030632, 25413342, -50826684, 106853668, -213707336, 447472972, -894945944, 1867450648, -3734901296, 7770342787
Offset: 0

Views

Author

Peter Luschny, Aug 30 2011

Keywords

Comments

The binomial transform of a(n) are the complementary Riordan numbers A194589 (see link).

Crossrefs

Cf. A107373 (has offset 1).

Programs

  • Maple
    A056040 := n -> n!/iquo(n,2)!^2:
    A152271 := n -> `if`(n mod 2 = 0, 1, (n+1)/2):
    A194590 := n -> (-1)^n*(A056040(n+1)*A152271(n)-2^n)/2:
  • Mathematica
    sf[n_] := n!/Quotient[n, 2]!^2;
    a[n_] := (-1)^n (sf[n + 1] * If[EvenQ[n], 1, (n + 1)/2] - 2^n)/2;
    Table[a[n], {n, 0, 32}] (* Jean-François Alcover, Jun 26 2019 *)

Formula

a(n) = Sum_{k=0..n} (-1)^(n-k)*binomial(n,k)*cr(k), where cr(k) are the complementary Riordan numbers A194589.

A057979 a(n) = 1 for even n and (n-1)/2 for odd n.

Original entry on oeis.org

1, 0, 1, 1, 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
Offset: 0

Views

Author

Labos Elemer, Nov 13 2000

Keywords

Comments

a(n) = b(n)/c(n) where b(n) = A001405(n+1) - A001405(n), c(n) = gcd(A001405(n+1), A001405(n)).
Also the minimal number of disjoint edge-paths into which the complete graph on n edges can be partitioned - Felix Goldberg (felixg(AT)tx.technion.ac.il), Jan 19 2001
For n >= 2, number of partitions of n-2 into parts that are distinct mod 2. - Giovanni Resta, Feb 06 2006
Sequence starting with a(3) obeys the rule "smallest positive value such that the ordered pair (a(n-1),a(n)) has not occurred previously", or the rule "smallest positive value such that the ratio a(n-1)/a(n) has not occurred previously". The same subsequence has its ordinal transform equal to itself, shifted left. (The ordinal transform has as its n-th term the number of values in a(1),...,a(n) that are equal to a(n).) - Franklin T. Adams-Watters, Dec 13 2006
Numerators of floor(n/2)/n, n > 0. - Wesley Ivan Hurt, Jun 14 2013
Number of nonisomorphic outer planar graphs of order n >= 3, maximum degree 3, and largest possible size. The size is (3n-2)/2 when n is even and (3n-3)/2 when n is odd. - Christian Barrientos and Sarah Minion, Feb 27 2018

Examples

			For n=12, C(12,6) - C(11,5) = 924 - 462 = 462, gcd(C(12,6), C(11,5)) = 462, and the quotient is 1.
For n=13, C(13,6) - C(12,6) = 792, gcd(C(13,6), C(12,6)) = 132, and the quotient is 6.
		

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a057979 n = 1 - rest * (1 - n') where (n', rest) = divMod n 2
    a057979_list = concat $ transpose [repeat 1, [0..]]
    -- Reinhard Zumkeller, Aug 11 2014
    
  • Magma
    [Floor(n/2)^(n mod 2): n in [0..100]]; // Vincenzo Librandi, Mar 17 2015
    
  • Maple
    A057979:=n->(n+1)/4+(3-n)*(-1)^n/4; seq(A057979(k), k=0..100); # Wesley Ivan Hurt, Oct 14 2013
  • Mathematica
    With[{no=45},Riffle[Table[1,{no}],Range[0,no-1]]] (* Harvey P. Dale, Feb 18 2011 *)
  • PARI
    a(n)=if(n%2,n-1,2)/2 \\ Charles R Greathouse IV, Sep 02 2015
    
  • Python
    def A057979(n): return n>>1 if n&1 else 1 # Chai Wah Wu, Jan 04 2024

Formula

a(n) = (n+1)/4+(3-n)*(-1)^n/4. - Paul Barry, Mar 21 2003, corrected by Hieronymus Fischer, Sep 25 2007
a(n) = (a(n-2) + a(n-3)) / a(n-1).
From Paul Barry, Oct 21 2004: (Start)
G.f.: (1-x^2+x^3)/((1+x)^2(1-x)^2);
a(n) = 2*a(n-2) - a(n-4);
a(n) = 0^n + Sum_{k=0..floor((n-2)/2)} C(n-k-2,k) * C(1,n-2k-2). (End)
a(n) = gcd(n-1, floor((n-1)/2)). - Paul Barry, May 02 2005
a(n) = binomial((2n-3)/4-(-1)^n/4, (1-(-1)^n)/2). - Paul Barry, Jun 29 2006
G.f.: (x^3-x^2+1)/(1-x^2)^2 = 1 + x^2*G(0) where G(k) = 1 + x*(k+1)/(1 - x/(x + (k+1)/G(k+1) )); (continued fraction, 3-step). - Sergei N. Gladkovskii, Nov 29 2012
a(n) = binomial(floor(n/2), n mod 2). - Wesley Ivan Hurt, Oct 14 2013
a(n) = 1 - n mod 2 * (1 - floor(n/2)). - Reinhard Zumkeller, Aug 11 2014
a(n) = floor(n/2)^(n mod 2). - Wesley Ivan Hurt, Mar 16 2015
E.g.f.: ((2 + x)*cosh(x) - sinh(x))/2. - Stefano Spezia, Mar 26 2022

A117142 Number of partitions of n in which any two parts differ by at most 2.

Original entry on oeis.org

1, 2, 3, 5, 6, 9, 10, 14, 15, 20, 21, 27, 28, 35, 36, 44, 45, 54, 55, 65, 66, 77, 78, 90, 91, 104, 105, 119, 120, 135, 136, 152, 153, 170, 171, 189, 190, 209, 210, 230, 231, 252, 253, 275, 276, 299, 300, 324, 325, 350, 351, 377, 378, 405, 406, 434, 435, 464, 465
Offset: 1

Views

Author

Emeric Deutsch, Feb 27 2006

Keywords

Comments

Equals row sums of triangle A177991. - Gary W. Adamson, May 16 2010
Positive numbers that are either triangular (A000217) or triangular minus 1 (A000096). - Jon E. Schoenfield, Jun 12 2010

Examples

			a(6) = 9 because we have
  1: [6],
  2: [4, 2],
  3: [3, 3],
  4: [3, 2, 1],
  5: [3, 1, 1, 1],
  6: [2, 2, 2],
  7: [2, 2, 1, 1],
  8: [2, 1, 1, 1, 1],
  9: [1, 1, 1, 1, 1, 1]
([5,1] and [4,1,1] do not qualify).
		

Crossrefs

Column k=2 of A194621. - Alois P. Heinz, Oct 17 2012

Programs

  • GAP
    List([1..60],n->(2*n^2+10*n+3+(-1)^n*(2*n-3))/16); # Muniru A Asiru, Dec 21 2018
    
  • Magma
    [(2*n*(n+5) +3 +(-1)^n*(2*n-3))/16: n in [1..60]]; // G. C. Greubel, Jul 18 2023
    
  • Maple
    g:=sum(x^k/(1-x^k)/(1-x^(k+1))/(1-x^(k+2)),k=1..75): gser:=series(g,x=0,70): seq(coeff(gser,x^n),n=1..65); with(combinat): for n from 1 to 7 do P:=partition(n): A:={}: for j from 1 to nops(P) do if P[j][nops(P[j])]-P[j][1]<3 then A:=A union {P[j]} else A:=A fi od: print(A); od: # this program yields the partitions
  • Mathematica
    Table[Count[IntegerPartitions[n], ?(Max[#] - Min[#] <= 2 &)], {n, 30}] (* _Birkas Gyorgy, Feb 20 2011 *)
    Table[(2*n^2 +10*n +3 +(-1)^n*(2*n-3))/16, {n,30}] (* Birkas Gyorgy, Feb 20 2011 *)
    Table[Sum[If[EvenQ[k], 1, (k+1)/2], {k,0,n}], {n,0,60}] (* Jon Maiga, Dec 21 2018 *)
  • PARI
    Vec(x*(x^2-x-1)/((x-1)^3*(x+1)^2) + O(x^100)) \\ Colin Barker, Mar 05 2015
    
  • SageMath
    [(2*n*(n+5) +3 +(-1)^n*(2*n-3))/16 for n in range(1,61)] # G. C. Greubel, Jul 18 2023

Formula

G.f.: Sum_{k>=1} x^k/((1 - x^k)*(1 - x^(k + 1))*(1 - x^(k + 2))). More generally, the g.f. of the number of partitions in which any two parts differ by at most b is Sum_{k>=1} (x^k/(Product_{j=k..k+b} 1 - x^j)).
a(n) = (2*n^2 + 10*n + 3 + (-1)^n * (2*n - 3))/16. - Birkas Gyorgy, Feb 20 2011
G.f.: (1 + x)/(1 - x)/(Q(0) - x^2 - x^3), where Q(k) = 1 + x^2 + x^3 + k*x*(1 + x^2) - x^2*(1 + x*(k + 2))*(1 + k*x)/Q(k+1) ; (continued fraction). - Sergei N. Gladkovskii, Jan 05 2014
G.f.: x*(1 + x - x^2)/((1 - x)^3*(1 + x)^2). - Colin Barker, Mar 05 2015
a(n) = Sum_{k=0..n-1} A152271(k). - Jon Maiga, Dec 21 2018
E.g.f.: (1/16)*( (3 + 2*x)*exp(-x) + (3 + 12*x + 2*x^2)*exp(x) ). - G. C. Greubel, Jul 18 2023
a(n) = A152919(n+1)/2. - Ridouane Oudra, Oct 29 2024

A124625 Even numbers sandwiched between 1's.

Original entry on oeis.org

1, 0, 1, 2, 1, 4, 1, 6, 1, 8, 1, 10, 1, 12, 1, 14, 1, 16, 1, 18, 1, 20, 1, 22, 1, 24, 1, 26, 1, 28, 1, 30, 1, 32, 1, 34, 1, 36, 1, 38, 1, 40, 1, 42, 1, 44, 1, 46, 1, 48, 1, 50, 1, 52, 1, 54, 1, 56, 1, 58, 1, 60, 1, 62, 1, 64, 1, 66, 1, 68, 1, 70, 1, 72, 1, 74, 1, 76, 1, 78, 1, 80, 1, 82, 1, 84
Offset: 0

Views

Author

N. J. A. Sloane, Jun 13 2007

Keywords

Comments

Interleaving of A000012 and A005843.
Created to simplify the definition of A129952.
a(n) = abs(A009531(n-1)).
Starting (1, 2, 1, 4,...): square (1 + x - x^2 - x^3 + x^4 + x^5 - ...) = (1 + 2x - x^2 - 4x^3 + x^4 + 6x^5 - ...).
With a(3) taken as 0, a(n+2) = n^k+1 mod 2*n, n>=1, for any k>=2, also for k=n. - Wolfdieter Lang, Dec 21 2011
Also !(n+2) mod n for n>0 where !n is a subfactorial number (A000166). - Michel Lagneau, Sep 05 2012
Greatest common divisor of n-1 and (n-1) mod 2. - Bruno Berselli, Mar 07 2017

References

  • Murat Sahin and Elif Tan, Conditional (strong) divisibility sequences, Fib. Q., 56 (No. 1, 2018), 18-31.

Crossrefs

Cf. A000012 (all 1's), A005843 (even numbers), A009531, A093178, A152271.

Programs

  • Magma
    &cat[[1, 2*k]: k in [0..42]];
    
  • Maple
    A124625:=n->(n-(n-2)*(-1)^n)/2; seq(A124625(k), k=0..100); # Wesley Ivan Hurt, Oct 19 2013
  • Mathematica
    Join[{1},Riffle[2Range[0,50],1]] (* Harvey P. Dale, Nov 02 2011 *)
  • PARI
    {for(n=0, 85, print1(if(n%2>0, n-1, 1), ","))}
    
  • Python
    print([(n-1)**(n%2) for n in range(0, 86)]) # Karl V. Keller, Jr., Jul 26 2020

Formula

a(n) = 1 for even n, a(n) = n-1 for odd n.
a(2*k) = 1, a(2*k+1) = 2*k.
G.f.: (1 - x^2 + 2*x^3)/((1 - x)^2*(1 + x)^2).
a(n) = (n - (n - 2)*(-1)^n)/2. - Bruno Berselli, May 06 2011
E.g.f.: 1 + x^2*U(0)/2 where U(k) = 1 + 2*x*(k+1)/(2*k + 3 - x*(2*k+3)/(x + 4*(k+2)*(k+1)/U(k+1))) (continued fraction, 3rd kind, 3-step). - Sergei N. Gladkovskii, Oct 20 2012
a(n) = 2*floor(n/2) - (n-1)*((n-1) mod 2). - Wesley Ivan Hurt, Oct 19 2013
a(n) = (n-1)^((1-(-1)^n)/2). - Wesley Ivan Hurt, Mar 21 2015
a(n) = (n-1) - a(a(n-1))*a(n-1), a(0) = 0. - Eli Jaffe, Jun 07 2016
E.g.f.: (x + 1)*cosh(x) - sinh(x). - Ilya Gutkovskiy, Jun 07 2016
a(n) = (-1)^n mod n for n > 0. - Franz Vrabec, Mar 06 2020
a(n) = (n-1)^(n mod 2). - Karl V. Keller, Jr., Aug 01 2020

Extensions

More terms from Klaus Brockhaus, Jun 16 2007
Edited by N. J. A. Sloane, May 21 2008 at the suggestion of R. J. Mathar

A158416 Expansion of g.f. (1+x-x^3)/(1-x^2)^2.

Original entry on oeis.org

1, 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: 0

Views

Author

Paul Barry, Mar 18 2009

Keywords

Comments

Binomial transform is A111297. Binomial transform of [1,1,1,2,1,3,1,...] is A109975.
Essentially the same as A152271 and A133622. - R. J. Mathar, Mar 20 2009
Also defined by: a(0)=1; thereafter, a(n) = number of copies of a(n-1) in the list [a(0), a(1), ..., a(n-1)]. - N. J. A. Sloane, Feb 12 2016

Crossrefs

Related to A268696.

Programs

  • Mathematica
    CoefficientList[Series[(1+x-x^3)/(1-x^2)^2,{x,0,100}],x] (* or *) LinearRecurrence[{0,2,0,-1},{1,1,2,1},100] (* Harvey P. Dale, Aug 17 2016 *)
  • PARI
    a(n)=1+!(n%2)*n/2 \\ Jaume Oliver Lafont, Mar 21 2009

Formula

a(n) = Sum_{k=0..floor(n/2)} binomial(k+1,n-k).
G.f.: Q(0)/x - 1/x, where Q(k)= 1 + (k+1)*x/(1 - x/(x + (k+1)/Q(k+1))); (continued fraction). - Sergei N. Gladkovskii, Apr 23 2013
E.g.f.: cosh(x) + (2 + x)*sinh(x)/2. - Stefano Spezia, Sep 06 2023

A145677 Triangle T(n, k) read by rows: T(n, 0) = 1, T(n, n) = n, n>0, T(n,k) = 0, 0 < k < n-1.

Original entry on oeis.org

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

Views

Author

Gary W. Adamson and Roger L. Bagula, Mar 28 2009

Keywords

Comments

The first entry in each row is 1, the last entry in each of the rows consist of the positive integers (starting 1,1,2,3,...), and all other entries in the triangle are 0's (see example).
The vector of (1, 1, 2, 5, 16, 65, 326,...), which is 1 followed by A000522, is an eigenvector of the matrix: 1 + Sum_{k=1..n} T(n,k)*A000522(k-1) = A000522(n).

Examples

			First few rows of the triangle:
  1;
  1, 1;
  1, 0, 2;
  1, 0, 0, 3;
  1, 0, 0, 0, 4;
  1, 0, 0, 0, 0, 5;
  1, 0, 0, 0, 0, 0, 6;
  1, 0, 0, 0, 0, 0, 0, 7;
  1, 0, 0, 0, 0, 0, 0, 0, 8;
  1, 0, 0, 0, 0, 0, 0, 0, 0, 9;
  1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10;
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_]:= If[k==0, 1, If[k==n, n, 0]];
    Table[T[n, k], {n,0,14}, {k,0,n}]//Flatten (* G. C. Greubel, Dec 23 2021 *)
  • Sage
    def A145677(n,k):
        if (k==0): return 1
        elif (k==n): return n
        else: return 0
    flatten([[A145677(n,k) for k in (0..n)] for n in (0..14)]) # G. C. Greubel, Dec 23 2021

Formula

T(n, k) = A158821(n,n-k).
1 + Sum_{k= 1..n} T(n,k) *(k-1) = A002061(n).
From G. C. Greubel, Dec 23 2021: (Start)
Sum_{k=0..n} T(n, k) = A000027(n).
Sum_{k=0..floor(n/2)} T(n-k, k) = A158416(n) = A152271(n+1). (End)

Extensions

Edited by R. J. Mathar, Oct 02 2009

A296168 Decimal expansion of BesselJ(1,2)/BesselJ(0,2).

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Dec 06 2017

Keywords

Examples

			2.575920321368221956857496782315044490612981953260015...
		

Crossrefs

Programs

  • Mathematica
    RealDigits[BesselJ[1, 2]/BesselJ[0, 2], 10, 100] [[1]]
    RealDigits[Sum[(-1)^k/((k + 1) (k!)^2), {k, 0, Infinity}]/Sum[(-1)^k/(k!)^2, {k, 0, Infinity}], 10, 100][[1]]
  • PARI
    besselj(1,2)/besselj(0,2) \\ Charles R Greathouse IV, Oct 23 2023

Formula

Equals 2 + 1/(1 + 1/(1 + 1/(2 + 1/(1 + 1/(3 + 1/(1 + 1/(4 + 1/(1 + 1/(5 + 1/(1 + 1/(6 + ...))))))))))).

A048619 a(n) = LCM(binomial(n,0), ..., binomial(n,n)) / binomial(n,floor(n/2)).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 3, 3, 4, 2, 10, 5, 30, 15, 7, 7, 56, 28, 252, 126, 60, 30, 330, 165, 396, 198, 286, 143, 2002, 1001, 15015, 15015, 7280, 3640, 1768, 884, 15912, 7956, 3876, 1938, 38760, 19380, 406980, 203490, 99484, 49742, 1144066, 572033, 1961256, 980628
Offset: 0

Views

Author

Keywords

Examples

			If n=10 then A002944(10)=2520, A001405(10)=252, the quotient a(10)=10.
		

Crossrefs

Programs

  • Magma
    [Lcm([1..n+1]) div (Floor((n+3)/2)*Binomial(n+1,Floor((n+3)/2))): n in [0..50]]; // Vincenzo Librandi, Jul 10 2019
  • Mathematica
    Table[Apply[LCM, Binomial[n, Range[0, n]]]/Binomial[n, Floor[n/2]], {n, 0, 48}] (* Michael De Vlieger, Jun 29 2017 *)
  • PARI
    {A048619(n) = lcm(vector(n+1, i, i)) / binomial(n+1, (n+1)\2) / ((n+2)\2);}
    

Formula

a(n) = A002944(n)/A001405(n).
a(n) = lcm(1..n+1)/(floor((n+3)/2)*binomial(n+1,floor((n+3)/2))). - Paul Barry, Jul 03 2006
a(n) = lcm(1,2,...,n+1) / (ceiling((n+1)/2)*binomial(n+1,floor((n+1)/2))) = A003418(n+1) / A100071(n+1). - Max Alekseyev, Oct 23 2015
a(n) = A263673(n+1) / A110654(n+1) = A180000(n+1) / A152271(n). - Max Alekseyev, Oct 23 2015
a(2*n-1) = A068553(n) = A068550(n)/n.

Extensions

Definition corrected and a(0)=1 prepended by Max Alekseyev, Oct 23 2015

A128218 First differences of A128217.

Original entry on oeis.org

1, 3, 1, 3, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 15, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

John W. Layman, Feb 19 2007

Keywords

Comments

a(A130883(n-1)) = 2*n-1 and a(m) != 2*n-1 for m < A130883(n-1). - Reinhard Zumkeller, Jun 20 2015

Crossrefs

Cf. A128127.
Cf. A130883, A152271 (run lengths after initial term).

Programs

  • Haskell
    a128218 n = a128218_list !! (n-1)
    a128218_list = zipWith (-) (tail a128217_list) a128217_list
    -- Reinhard Zumkeller, Jun 20 2015
    
  • Mathematica
    nsrQ[n_]:=Module[{sr=Sqrt[n]},Abs[First[sr-Nearest[{Floor[sr], Ceiling[ sr]}, sr]]]<1/4];Differences[Select[Range[0,250],nsrQ]] (* Harvey P. Dale, May 02 2012 *)
  • PARI
    default(realprecision, 10000);
    is_A128217(n) = ((abs(sqrt(n)-sqrtint(n))<(1/4)) || (abs(sqrt(n)-(1+sqrtint(n)))<(1/4)));
    k=0; n=0; prevm=0; while(k<20000, n++; if(is_A128217(n), k++; write("b128218.txt", k, " ", (n-prevm)); prevm = n)); \\ Antti Karttunen, Jan 16 2025

Formula

Let A(1)={1}. Then, for k=2,3,4,..., form A(k) by appending to A(k-1) the term k-1 followed by k-1 1's, if k is even, or by appending to A(k-1) the term k followed by k-1 1's, if k is odd. {a(n)} appears to be the limit of {A(k)} as k->infinity.

Extensions

Offset changed by Reinhard Zumkeller, Jun 20 2015

A175686 a(n) = binomial(n-j-1,j) + binomial(n-j,j-1) with j= floor((n-1)/2).

Original entry on oeis.org

0, 1, 1, 2, 3, 4, 7, 7, 14, 11, 25, 16, 41, 22, 63, 29, 92, 37, 129, 46, 175, 56, 231, 67, 298, 79, 377, 92, 469, 106, 575, 121, 696, 137, 833, 154, 987, 172, 1159, 191, 1350, 211, 1561, 232, 1793, 254, 2047, 277, 2324, 301, 2625, 326, 2951, 352, 3303, 379
Offset: 0

Views

Author

Roger L. Bagula, Dec 04 2010

Keywords

Comments

The column m=1 in the array A175685, where the sum over the binomials reduces to only two terms.

Crossrefs

Programs

  • Mathematica
    Table[Sum[Binomial[n - j - 1, j], {j, Floor[(n - 1)/2] - 1, Floor[(
        n - 1)/2]}], {n, 0, 30}]
    CoefficientList[Series[-(x^3-x^2-x)(x^4-x^2+1)/(x^2-1)^4, {x, 0, 30}],x] (* Benedict W. J. Irwin, Oct 31 2016 *)
    Table[(42+20n+6n^2+n^3+(-1)^n(-42+20n-6n^2+n^3))/96, {n, 0, 30}] (* Benedict W. J. Irwin, Oct 31 2016 *)
    LinearRecurrence[{0,4,0,-6,0,4,0,-1},{0,1,1,2,3,4,7,7},60] (* Harvey P. Dale, Jul 29 2018 *)
  • PARI
    concat(0, Vec(x*(1+x-x^2)*(1-x^2+x^4)/((1-x)^4*(1+x)^4) + O(x^100))) \\ Colin Barker, Oct 31 2016

Formula

a(n) = A057979(n+1) + binomial(n-j,j-1) with j = A004526(n-1), n>0.
From Benedict W. J. Irwin, Oct 31 2016: (Start)
G.f.: -(x^3 - x^2 - x)*(x^4 - x^2 + 1)/(x^2 - 1)^4.
E.g.f.: ((6*x + 3*x^2)*cosh(x) + (42 + 21*x + 6*x^2 + x^3)*sinh(x))/48.
a(n) = (42 + 20*n + 6*n^2 + n^3 + (-1)^n*(-42 + 20*n - 6*n^2 + n^3))/96. (End)
a(n) = 4*a(n-2)-6*a(n-4)+4*a(n-6)-a(n-8) for n>7. - Colin Barker, Oct 31 2016

Extensions

More terms from Colin Barker, Oct 31 2016
Showing 1-10 of 14 results. Next