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 21-27 of 27 results.

A097564 a(n) = (a(n-1) mod 2)*a(n-1) + a(n-2) with a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 4, 3, 7, 10, 7, 17, 24, 17, 41, 58, 41, 99, 140, 99, 239, 338, 239, 577, 816, 577, 1393, 1970, 1393, 3363, 4756, 3363, 8119, 11482, 8119, 19601, 27720, 19601, 47321, 66922, 47321, 114243, 161564, 114243, 275807, 390050, 275807, 665857
Offset: 0

Views

Author

Gerald McGarvey, Aug 27 2004

Keywords

Comments

The sequences a(2), a(5), ... a(1+3*n) ... and a(4), a(7), ... a(4 + 3n) ... are both A001333 (numerators of continued fraction convergents to sqrt(2)). The sequence a(0), a(3), a(6), ... a(3+3*n) ... is twice A000129 (the Pell nos. or the denominators of continued fraction convergents to sqrt(2).), also is A052542 starting w/ offset 1.

Programs

  • Magma
    [n le 2 select n-1 else (Self(n-1) mod 2)*Self(n-1)+Self(n-2): n in [1..50]]; // Bruno Berselli, Jun 02 2016
    
  • Maple
    m:=50; S:=series( x*(1+x+2*x^2-x^3+x^4)/(1-2*x^3-x^6), x, m+1):
    seq(coeff(S, x, j), j=0..m); # G. C. Greubel, Apr 20 2021
  • Mathematica
    nxt[{a_,b_}]:={b,Mod[b,2]*b+a}; NestList[nxt,{0,1},50][[All,1]] (* or *) LinearRecurrence[{0,0,2,0,0,1},{0,1,1,2,1,3},50] (* Harvey P. Dale, Aug 15 2017 *)
  • PARI
    concat(0, Vec(x*(1+x+2*x^2-x^3+x^4)/(1-2*x^3-x^6) + O(x^100))) \\ Colin Barker, Jun 02 2016
    
  • Sage
    def A097564_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( x*(1+x+2*x^2-x^3+x^4)/(1-2*x^3-x^6) ).list()
    A097564_list(50) # G. C. Greubel, Apr 20 2021

Formula

From Colin Barker, Jun 01 2016: (Start)
a(n) = 2*a(n-3) + a(n-6) for n>5.
G.f.: x*(1+x+2*x^2-x^3+x^4) / (1-2*x^3-x^6). (End)

A100434 Expansion of g.f. (1+x)*(3+x)/(1+6*x^2+x^4).

Original entry on oeis.org

3, 4, -17, -24, 99, 140, -577, -816, 3363, 4756, -19601, -27720, 114243, 161564, -665857, -941664, 3880899, 5488420, -22619537, -31988856, 131836323, 186444716, -768398401, -1086679440, 4478554083, 6333631924, -26102926097, -36915112104, 152139002499, 215157040700
Offset: 0

Views

Author

N. J. A. Sloane, Nov 21 2004, suggested by correspondence from Creighton Dement

Keywords

Comments

From Creighton Dement, Dec 18 2004: (Start)
Define the following sequences:
b(2n) = c(2n+1), b(2n+1) = c(2n); (c(n)) = (1, -3, -7, 17, 41, -99, -239, 577, 1393, -3363, -8119, 19601, 47321). This is the sequence A001333, apart from signs. Then c(2n) = ((-1)^n)*A002315(n) and c(2n+1) = ((-1)^(n+1))*A001541(n+1).
(d(n)) = (2, 4, -10, -24, 58, 140, -338, -816, 1970, 4756, -11482, -27720). This is A052542, apart from signs. Also, d(2n) = ((-1)^n)*A075870(n), d(2n+1) = ((-1)^n)*A005319(n+1).
(e(n)) = (1, -1, -5, 5, 29, -29, -169, 169, 985, -985, -5741, 5741, 33461, -33461), e(2n) = d(2n)/2, e(2n+1) = - d(2n)/2.
(f(n)) = (2, 2, -12, -12, 70, 70, -408, -408, 2378, 2378, -13860, -13860, ) f(2n) = f(2n+1) = d(2n+1)/2.
(g(n)) = (0, -3, 0, 17, 0, -99, 0, 577, 0, -3363, 0, 19601, 0, -114243, 0, 665857), g(2n) = 0, g(2n+1) = c(2n+1).
Then a(2n) = - c(2n+1), a(2n+1) = d(2n+1) and we have the following conjectures: c(n) + d(n) = e(n) + f(n) = g(n) + a(n); c(n) + d(n) = b(n). In other words, the sequences (c(n) + d(n)) = (e(n) + f(n)) = (g(n) + h(n)) all represent the sequence c with even- and odd-indexed terms reversed. (End)

Crossrefs

Programs

  • Magma
    I:=[3,4,-17,-24]; [n le 4 select I[n] else -6*Self(n-2)-Self(n-4): n in [1..40]]; // G. C. Greubel, Apr 09 2023
    
  • Mathematica
    LinearRecurrence[{0,-6,0,-1}, {3,4,-17,-24}, 41] (* G. C. Greubel, Apr 09 2023 *)
  • SageMath
    @CachedFunction
    def a(n): # a = A100434
        if (n<4): return (3,4,-17,-24)[n]
        else: return -6*a(n-2) - a(n-4)
    [a(n) for n in range(41)] # G. C. Greubel, Apr 09 2023

Formula

a(n) = (-1)^floor(n/2)*A000034(n)*A126354(n+3). - R. J. Mathar, Mar 08 2009
a(n) = -2*a(n-1) - 3*a(n-2) if n is even; a(n) = (4*a(n-1) - a(n-2))/3 if n is odd. - R. J. Mathar, Jun 18 2014

A136421 a(n) = floor((x^n - (1-x)^n)/sqrt(2)+ 1/2) where x = (sqrt(2)+1)/2.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 3, 3, 4, 5, 6, 7, 8, 10, 12, 14, 17, 21, 25, 31, 37, 44, 54, 65, 78, 94, 114, 138, 166, 200, 242, 292, 352, 425, 514, 620, 748, 903, 1090, 1316, 1589, 1918, 2315, 2794, 3373, 4072, 4915, 5933, 7162, 8645, 10436, 12597, 15206, 18355, 22156, 26745
Offset: 1

Views

Author

Cino Hilliard, Apr 01 2008

Keywords

Comments

This is analogous to the closed form of the formula for the n-th Fibonacci number. Even before truncation, these numbers are rational and the decimal part always ends in 5. For x=(sqrt(2)+1)/2, a(n)/a(n-1) -> x.

Programs

  • Magma
    [Floor(((1+Sqrt(2))^n - (1-Sqrt(2))^n)/(2^n*Sqrt(2))+ 1/2): n in [2..50]]; // G. C. Greubel, Oct 02 2018
  • Mathematica
    Table[Floor[Fibonacci[n, 2]/2^(n-1) +1/2], {n,1,50}] (* G. C. Greubel, Oct 02 2018 *)
  • PARI
    fib(n,r) = x=(sqrt(r)+1)/2;floor((x^n-(1-x)^n)/sqrt(r)+.5);
    g(n,r) = for(m=1,n,print1(fib(m,r)", "));
    g(30,2)
    

Formula

The general form of x is (sqrt(r)+1)/2, r=1,2,3...
a(n) = floor(b(n)/2^n) where b(n) = A052542(n) + 2^(n-1) = 4*b(n-1) - 3*b(n-2) - 2*b(n-3). - R. J. Mathar, Sep 10 2016

A052622 E.g.f. (1-x^2)/(1-2x-x^2).

Original entry on oeis.org

1, 2, 8, 60, 576, 6960, 100800, 1703520, 32901120, 714873600, 17258572800, 458324697600, 13277924352000, 416724685977600, 14084873439436800, 510058387238400000, 19702238017093632000, 808611973910028288000
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Programs

  • Maple
    spec := [S,{S=Sequence(Prod(Union(Z,Z),Sequence(Prod(Z,Z))))},labeled]: seq(combstruct[count](spec,size=n), n=0..20);
  • Mathematica
    With[{nn=20},CoefficientList[Series[(1-x^2)/(1-2x-x^2),{x,0,nn}],x]Range[0,nn]!] (* Harvey P. Dale, Mar 04 2013 *)

Formula

E.g.f.: (-1+x^2)/(-1+2*x+x^2)
Recurrence: {a(0)=1, a(1)=2, a(2)=8, (-2-n^2-3*n)*a(n) +(-4-2*n)*a(n+1) +a(n+2)=0}
Sum(-1/2*(-1+_alpha)*_alpha^(-1-n), _alpha=RootOf(-1+2*_Z+_Z^2))*n!
a(n) = n!*((1+sqrt(2))^n - (1-sqrt(2))^n)/sqrt(2). - Vaclav Kotesovec, Oct 05 2013
a(n)=n!*A052542(n). - R. J. Mathar, Jun 03 2022

A062507 Table by antidiagonals related to partial sums and differences of Pell numbers (A000129).

Original entry on oeis.org

0, 1, 0, 0, 1, 0, 2, 1, 1, 0, 4, 3, 2, 1, 0, 10, 7, 5, 3, 1, 0, 24, 17, 12, 8, 4, 1, 0, 58, 41, 29, 20, 12, 5, 1, 0, 140, 99, 70, 49, 32, 17, 6, 1, 0, 338, 239, 169, 119, 81, 49, 23, 7, 1, 0, 816, 577, 408, 288, 200, 130, 72, 30, 8, 1, 0, 1970, 1393, 985, 696, 488, 330, 202, 102
Offset: 0

Views

Author

Henry Bottomley, Jul 09 2001

Keywords

Examples

			Rows start (0,1,0,2,4,10,...), (0,1,1,3,7,17,...), (0,1,2,5,12,29,...) etc.
		

Crossrefs

Rows are effectively A052542, A001333, A000129, A048739, A048776. Columns are effectively A000004, A000012, A001477, A022856.

Formula

T(n, k) =T(n, k-1)+T(n-1, k) =2T(n, k-1)+T(n, k-2)+C(n+k-3, k) for n>2.

A068515 A measure of how close the square root of 2 is to rational numbers.

Original entry on oeis.org

2, -12, 12, -12, 70, 12, -70, 26, -33, 70, -25, -408, 34, -70, 70, -43, 408, 39, -146, 70, -70, 195, -49, -408, 70, -113, 147, -70, 2378, 70, -195, 126, -100, 408, 70, -408, 114, -146, 253, -93, -2378, 106, -228, 195, -125, 855, 100, -408, 165, -173, 408, -113, -1135, 147, -252, 286, -146, 2378, 135, -408
Offset: 1

Views

Author

Henry Bottomley, Mar 19 2002

Keywords

Comments

New peaks (in absolute terms) occur when n is a Pell number (1,2,5,12,29,70,... A000129) and take alternate Pell values with alternating signs (2,-12,70,-408,2378,-13860,... A001542). Each new peak (after the first) appears twice (with different signs) before the next peak, when n is a numerator of a continued fraction convergent to sqrt(2) (3,7,17,41,99,... A001333) and when n is twice a Pell number (4,10,24,58,140,... A052542).

Examples

			a(5) = round[1/(sqrt(2)-round[sqrt(2)*5]/5)] = round[1/(sqrt(2)-7/5)] = round[70.355] = 70, i.e. sqrt(2) is about 1/70 more than the nearest multiple of 1/5.
		

Crossrefs

Cf. A066212.

Formula

a(n) =round[1/(sqrt(2)-round[sqrt(2)*n]/n)] =round[1/(sqrt(2)-A022846(n)/n)] where sqrt(2)=1.41421356...

A346631 Number of strongly asymmetric Boolean nested canalizing functions with n variables.

Original entry on oeis.org

4, 24, 240, 2880, 41760
Offset: 2

Views

Author

Yuan Li, Jul 25 2021

Keywords

Crossrefs

Comments from the Editors: It appears that this is essentially n!*A163271(n) (see also A052542), and also essentially 2*n!*A000129(n) (see also A215928). It also appears to match 2*A052580.

Formula

a(n) = n!((1+sqrt(2))^{n-1}-(1-sqrt(2))^{n-1})/sqrt(2).
Previous Showing 21-27 of 27 results.