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-30 of 280 results. Next

A265398 Perform one x^2 -> x+1 reduction for the polynomial with nonnegative integer coefficients that is encoded in the prime factorization of n.

Original entry on oeis.org

1, 2, 3, 4, 6, 6, 15, 8, 9, 12, 35, 12, 77, 30, 18, 16, 143, 18, 221, 24, 45, 70, 323, 24, 36, 154, 27, 60, 437, 36, 667, 32, 105, 286, 90, 36, 899, 442, 231, 48, 1147, 90, 1517, 140, 54, 646, 1763, 48, 225, 72, 429, 308, 2021, 54, 210, 120, 663, 874, 2491, 72, 3127, 1334, 135, 64, 462, 210, 3599, 572, 969, 180, 4087, 72
Offset: 1

Views

Author

Antti Karttunen, Dec 15 2015

Keywords

Comments

Completely multiplicative with a(2) = 2, a(3) = 3, a(prime(k)) = prime(k-1) * prime(k-2) for k > 2. - Andrew Howroyd & Antti Karttunen, Aug 04 2018

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = Module[{k, p, e}, Which[n<4, n, PrimeQ[n], k = PrimePi[n]; Prime[k-1] Prime[k-2], True, Product[{p, e} = pe; a[p]^e, {pe, FactorInteger[n]}]]];
    a /@ Range[1, 72] (* Jean-François Alcover, Sep 20 2019 *)
    f[p_, e_] := If[p < 5, p, NextPrime[p,-1]*NextPrime[p,-2]]^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Dec 01 2022 *)
  • PARI
    A065330(n) = { while(0 == (n%2), n = n/2); while(0 == (n%3), n = n/3); n; }
    A065331 = n -> n/A065330(n);
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A265398(n) = { my(a); if(1 == n, n, a = A064989(A065330(n)); A064989(a)*a*A065331(n)); };
    
  • PARI
    r(p) = {my(q = precprime(p-1)); q*precprime(q-1)};
    a(n) = {my(f=factor(n)); prod(i=1, #f~, if(f[i,1]<5, f[i,1], r(f[i,1]))^f[i,2])}; \\ Amiram Eldar, Dec 01 2022
    
  • Scheme
    (definec (A265398 n) (if (= 1 n) n (* (A065331 n) (A064989 (A065330 n)) (A064989 (A064989 (A065330 n))))))

Formula

a(1) = 1; for n > 1, a(n) = A064989(A064989(A065330(n))) * A064989(A065330(n)) * A065331(n).
Sum_{k=1..n} a(k) = c * n^3, where c = (1/3) * Product_{p prime} (p^3-p^2)/(p^3-a(p)) = 0.093529982... . - Amiram Eldar, Dec 01 2022

Extensions

Keyword mult added by Antti Karttunen, Aug 04 2018

A265399 Repeatedly perform x^2 -> x+1 reduction for polynomial (with nonnegative integer coefficients) encoded in prime factorization of n, until the polynomial is at most degree 1.

Original entry on oeis.org

1, 2, 3, 4, 6, 6, 18, 8, 9, 12, 108, 12, 1944, 36, 18, 16, 209952, 18, 408146688, 24, 54, 216, 85691213438976, 24, 36, 3888, 27, 72, 34974584955819144511488, 36, 2997014624388697307377363936018956288, 32, 324, 419904, 108, 36, 104819342594514896999066634490728502944926883876041385836544, 816293376, 5832, 48
Offset: 1

Views

Author

Antti Karttunen, Dec 15 2015

Keywords

Comments

In terms of integers: apply A265398 as many times as necessary to n, until it gets 3-smooth, one of the terms of A003586.
Completely multiplicative with a(2) = 2, a(3) = 3, a(p) = a(A265398(p)) for p > 3. - Andrew Howroyd & Antti Karttunen, Aug 04 2018

Crossrefs

Cf. A003586 (fixed points), A065331.

Programs

  • Mathematica
    f[p_, e_] := If[p < 5, p, a[NextPrime[p, -1] * NextPrime[p, -2]]]^e; a[1] = 1; a[n_] := a[n] = Times @@ f @@@ FactorInteger[n]; Array[a, 40] (* Amiram Eldar, Sep 07 2023 *)
  • PARI
    \\ Needs also code from A265398.
    A265399(n) = if(A065331(n) == n, n, A265399(A265398(n)));
    for(n=1, 60, write("b265399.txt", n, " ", A265399(n)));
    
  • Scheme
    (definec (A265399 n) (if (= (A065331 n) n) n (A265399 (A265398 n))))

Formula

If A065331(n) = n [that is, when n is one of 3-smooth numbers, A003586] then a(n) = n, otherwise a(n) = a(A265398(n)).
Other identities. For all n >= 1:
a(n) = 2^A265752(n) * 3^A265753(n).

Extensions

Keyword mult added by Antti Karttunen, Aug 04 2018

A192234 a(n) = 2*(a(n-1) + a(n-2) + a(n-3)) - a(n-4) for n >= 4, with initial terms 0,1,0,1.

Original entry on oeis.org

0, 1, 0, 1, 4, 9, 28, 81, 232, 673, 1944, 5617, 16236, 46921, 135604, 391905, 1132624, 3273345, 9460144, 27340321, 79014996, 228357577, 659965644, 1907336113, 5512303672, 15930853281, 46041020488, 133061018769, 384553481404, 1111380188041
Offset: 0

Views

Author

Clark Kimberling, Jun 26 2011

Keywords

Comments

With a different offset, constant term of the reduction of the n-th 1st-kind Chebyshev polynomial by x^2->x+1. See A192232.

Crossrefs

Cf. A192232.

Programs

  • GAP
    a:=[0,1,0,1];; for n in [5..40] do a[n]:=2*a[n-1]+2*a[n-2]+2*a[n-3] -a[n-4]; od; a; # G. C. Greubel, Jul 29 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 40); [0] cat Coefficients(R!( x*(1-2*x-x^2)/(1-2*x-2*x^2-2*x^3+x^4) )); // G. C. Greubel, Jul 29 2019
    
  • Mathematica
    q[x_]:= x + 1;
    reductionRules = {x^y_?EvenQ -> q[x]^(y/2), x^y_?OddQ -> x q[x]^((y - 1)/2)};
    t = Table[Last[Most[FixedPointList[Expand[#1 /. reductionRules] &, ChebyshevT[n, x]]]], {n, 1, 40}];
    Table[Coefficient[Part[t, n], x, 0], {n, 1, 40}]  (* A192234 *)
    Table[Coefficient[Part[t, n], x, 1], {n, 1, 40}]  (* A071101 *)
    (* Peter J. C. Moses, Jun 25 2011 *)
  • PARI
    a(n)=my(t=polchebyshev(n));while(poldegree(t)>1, t=substpol(t, x^2,x+1));subst(t,x,0) \\ Charles R Greathouse IV, Feb 09 2012
    
  • PARI
    concat(0, Vec(x*(1-2*x-x^2)/(1-2*x-2*x^2-2*x^3+x^4) + O(x^40))) \\ Colin Barker, Sep 09 2018
    
  • Sage
    (x*(1-2*x-x^2)/(1-2*x-2*x^2-2*x^3+x^4)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Jul 29 2019
    

Formula

G.f.: x*(1 - 2*x - x^2) / (1 - 2*x - 2*x^2 - 2*x^3 + x^4). - Colin Barker, Feb 09 2012 and Sep 09 2018

Extensions

Entry revised (with new offset and initial terms) by N. J. A. Sloane, Sep 03 2018

A192235 Constant term of the reduction of the n-th 2nd-kind Chebyshev polynomial by x^2 -> x+1.

Original entry on oeis.org

0, 3, 8, 21, 64, 183, 528, 1529, 4416, 12763, 36888, 106605, 308096, 890415, 2573344, 7437105, 21493632, 62117747, 179523624, 518832901, 1499454912, 4333505127, 12524062256, 36195211689, 104606103232, 302317249227, 873713066040
Offset: 1

Views

Author

Clark Kimberling, Jun 26 2011

Keywords

Comments

See A192232.

Crossrefs

Programs

  • GAP
    a:=[0,3,8,21];; for n in [5..40] do a[n]:=2*a[n-1]+2*a[n-2]+ 2*a[n-3]-a[n-4]; od; a; # G. C. Greubel, Jul 30 2019
  • Magma
    I:=[0, 3, 8, 21]; [n le 4 select I[n] else 2*Self(n-1) +2*Self(n-2) +2*Self(n-3) -Self(n-4): n in [1..40]]; // G. C. Greubel, Jul 30 2019
    
  • Mathematica
    q[x_]:= x + 1;
    reductionRules = {x^y_?EvenQ -> q[x]^(y/2), x^y_?OddQ -> x q[x]^((y - 1)/2)};
    t = Table[Last[Most[FixedPointList[Expand[#1 /. reductionRules] &, ChebyshevU[n, x]]]], {n, 1, 40}];
    Table[Coefficient[Part[t, n], x, 0], {n, 1, 40}] (* A192235 *)
    Table[Coefficient[Part[t, n], x, 1], {n, 1, 40}] (* A192236 *)
    Table[Coefficient[Part[t, n]/2, x, 1], {n, 1, 40}] (* A192237 *)
    (* by Peter J. C. Moses, Jun 25 2011 *)
    LinearRecurrence[{2,2,2,-1}, {0,3,8,21}, 40] (* G. C. Greubel, Jul 30 2019 *)
  • PARI
    a(n)=my(t=polchebyshev(n,2));while(poldegree(t)>1, t=substpol(t, x^2,x+1));subst(t,x,0) \\ Charles R Greathouse IV, Feb 09 2012
    
  • PARI
    m=40; v=concat([0, 3, 8, 21], vector(m-4)); for(n=5, m, v[n] = 2*v[n-1]+2*v[n-2]+2*v[n-3]-v[n-4]); v \\ G. C. Greubel, Jul 30 2019
    
  • Sage
    @cached_function
    def a(n):
        if (n==0): return 0
        elif (1 <= n <= 3): return fibonacci(2*n+2)
        else: return 2*(a(n-1) + a(n-2) + a(n-3)) - a(n-4)
    [a(n) for n in (0..40)] # G. C. Greubel, Jul 30 2019
    

Formula

Empirical G.f.: x^2*(3-x)*(1+x)/(1-2*x-2*x^2-2*x^3+x^4). - Colin Barker, Sep 11 2012

A192237 a(n) = 2*(a(n-1) + a(n-2) + a(n-3)) - a(n-4) for n >= 4, with initial terms 0,0,0,1.

Original entry on oeis.org

0, 0, 0, 1, 2, 6, 18, 51, 148, 428, 1236, 3573, 10326, 29842, 86246, 249255, 720360, 2081880, 6016744, 17388713, 50254314, 145237662, 419744634, 1213084507, 3505879292, 10132179204, 29282541372, 84628115229, 244579792318, 706848718634, 2042830710990, 5903890328655, 17062559724240, 49311712809136, 142513495013072
Offset: 0

Views

Author

Clark Kimberling, Jun 26 2011

Keywords

Crossrefs

With a different offset, equals (A192236)/2.
Other sequences with this recurrence but different initial conditions: A192234, A317973, A317974, A317975, A317976.

Programs

  • GAP
    a:=[0,0,0,1];; for n in [5..40] do a[n]:=2*a[n-1]+2*a[n-2]+2*a[n-3] -a[n-4]; od; a; # G. C. Greubel, Jul 30 2019
  • Magma
    I:=[0,0,0,1]; [n le 4 select I[n] else 2*(Self(n-1)+Self(n-2) +Self(n-3))-Self(n-4): n in [1..40]]; // Vincenzo Librandi, Sep 06 2018
    
  • Mathematica
    q[x_]:= x + 1;
    reductionRules = {x^y_?EvenQ -> q[x]^(y/2), x^y_?OddQ -> x q[x]^((y - 1)/2)};
    t = Table[Last[Most[FixedPointList[Expand[#1 /. reductionRules] &, ChebyshevU[n, x]]]], {n, 1, 40}];
    Table[Coefficient[Part[t, n], x, 0], {n, 1, 40}] (* A192235 *)
    Table[Coefficient[Part[t, n], x, 1], {n, 1, 40}] (* A192236 *)
    Table[Coefficient[Part[t, n]/2, x, 1], {n, 1, 40}] (* A192237 *)
    (* by Peter J. C. Moses, Jun 25 2011 *)
    LinearRecurrence[{2,2,2,-1}, {0,0,0,1}, 40] (* Vincenzo Librandi, Sep 06 2018 *)
  • PARI
    concat(vector(3), Vec(x^3/(1-2*x-2*x^2-2*x^3+x^4) + O(x^40))) \\ Colin Barker, Sep 06 2018
    
  • Sage
    (x^3/(1-2*x-2*x^2-2*x^3+x^4)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Jul 30 2019
    

Formula

G.f.: x^3 / (1 - 2*x - 2*x^2 - 2*x^3 + x^4). - Colin Barker, Sep 12 2012 and Sep 06 2018

Extensions

Entry revised (with new offset and initial terms) by N. J. A. Sloane, Sep 03 2018

A192243 0-sequence of reduction of Lucas sequence by x^2 -> x+1.

Original entry on oeis.org

1, 1, 5, 12, 34, 88, 233, 609, 1597, 4180, 10946, 28656, 75025, 196417, 514229, 1346268, 3524578, 9227464, 24157817, 63245985, 165580141, 433494436, 1134903170, 2971215072, 7778742049, 20365011073, 53316291173, 139583862444, 365435296162
Offset: 1

Views

Author

Clark Kimberling, Jun 26 2011

Keywords

Comments

See A192232 for definition of "k-sequence of reduction of [sequence] by [substitution]".
Number of rooted ordered trees with n non-root nodes such that successive branch heights are weakly decreasing; examples are given in the Arndt link. - Joerg Arndt, Aug 27 2014

Examples

			The Lucas sequence provides coefficients for the power series 1+3x+4x^2+7x^3+..., whose partial sums are polynomials to which we apply reduction by x^2 -> x+1 as introduced at A192232:
1 -> 1
1+3x -> 1+3x
1+3x+4x^2 -> 1+3x+4(x+1)= 5+7x
1+3x+4x^2+7x^2 -> 12+21x..., so that
0-sequence=(1,1,5,12,...), 1-sequence=(0,3,7,21,...).
		

Crossrefs

Programs

  • Magma
    I:=[1, 1, 5, 12]; [n le 4 select I[n] else 3*Self(n-1) - 3*Self(n-3) + Self(n-4): n in [1..30]]; // G. C. Greubel, Dec 21 2017
  • Mathematica
    c[n_] := LucasL[n]; Table[c[n], {n, 1, 15}]; q[x_] := x + 1; p[0, x_] :=
    1; p[n_, x_] := p[n - 1, x] + (x^n)*c[n + 1]; reductionRules = {x^y_?EvenQ
    -> q[x]^(y/2), x^y_?OddQ -> x q[x]^((y - 1)/2)}; t = Table[Last[Most[FixedPointList[Expand[#1 /. reductionRules] &, p[n, x]]]], {n, 0, 50}]
    u = Table[Coefficient[Part[t, n], x, 0], {n, 1, 50}] (* A192243 *)
    Table[Coefficient[Part[t, n], x, 1], {n, 1, 50}] (* A192068 *)
    (* Peter J. C. Moses, Jun 26 2011 *)
    Table[SeriesCoefficient[x*(1 - 2*x + 2*x^2)/(1 - 3*x + 3*x^3 - x^4), {x, 0, n}], {n, 1, 50}]
    LinearRecurrence[{3,0,-3,1}, {1,1,5,12}, 30] (* G. C. Greubel, Dec 21 2017 *)
    Table[If[EvenQ[n],Fibonacci[2*n-1]-1, Fibonacci[2*n-1]], {n,1,20}] (* Rigoberto Florez, Aug 29 2019 *)
  • PARI
    x='x+O('x^30); Vec(x*(1-2*x+2*x^2)/(1-3*x+3*x^3-x^4)) \\ G. C. Greubel, Dec 21 2017
    

Formula

From Colin Barker, Feb 08 2012: (Start)
G.f.: x*(1-2*x+2*x^2)/(1-3*x+3*x^3-x^4).
a(n) = 3*a(n-1) - 3*a(n-3) + a(n-4).
(End)
a(n) = (-1)*(2^(-1-n)*(5*((-2)^n+2^n) + (-5+sqrt(5))*(3+sqrt(5))^n - (3-sqrt(5))^n*(5 + sqrt(5)))) / 5. - Colin Barker, Dec 22 2017
a(n) = F(2n-1)-1 if n is even and F(2n-1) if n is odd, where F(n) is the n-th Fibonacci number. - Rigoberto Florez, Aug 29 2019
E.g.f.: - cosh(x) + (1/5)*(cosh(3*x/2) + sinh(3*x/2))*(5*cosh(sqrt(5)*x/2) - sqrt(5)*sinh(sqrt(5)*x/2)). - Stefano Spezia, Aug 30 2019

A192352 Constant term of the reduction of the polynomial p(n,x)=(1/2)((x+1)^n+(x-1)^n) by x^2->x+1.

Original entry on oeis.org

1, 0, 2, 1, 9, 13, 51, 106, 322, 771, 2135, 5401, 14445, 37324, 98514, 256621, 673933, 1760997, 4615823, 12075526, 31628466, 82781215, 216761547, 567428401, 1485645049, 3889310328, 10182603746, 26657986681, 69792188337, 182717232061
Offset: 1

Views

Author

Clark Kimberling, Jun 29 2011

Keywords

Comments

1

Examples

			For an introduction to reductions of polynomials by substitutions such as x^2->x+1, see A192232.
The first six polynomials p(n,x) and their reductions are as follows:
p(0,x)=1 -> 1
p(1,x)=x -> x
p(2,x)=1+x^2 -> 2+x
p(3,x)=3x+x^3 -> 1+5x
p(4,x)=1+6x^2+x^4 -> 9+9x
p(5,x)=5x+10x^3+x^5 -> 13+30x.
From these, we read
A192352=(1,0,2,1,9,13...) and A049602=(0,1,1,5,9,30...).
		

Crossrefs

Programs

  • Mathematica
    q[x_] := x + 1; d = 1;
    p[n_, x_] := ((x + d)^n + (x - d)^n )/
      2 (* similar to polynomials defined at A161516 *)
    Table[Expand[p[n, x]], {n, 0, 6}]
    reductionRules = {x^y_?EvenQ -> q[x]^(y/2),
       x^y_?OddQ -> x q[x]^((y - 1)/2)};
    t = Table[Last[Most[FixedPointList[Expand[#1 /. reductionRules] &, p[n, x]]]], {n, 0, 30}]
    Table[Coefficient[Part[t, n], x, 0], {n, 1, 30}]
      (* A192352 *)
    Table[Coefficient[Part[t, n], x, 1], {n, 1, 30}]
      (* A049602 *)

Formula

Empirical G.f.: -x*(x^3-x^2-2*x+1)/((x^2-3*x+1)*(x^2-x-1)). [Colin Barker, Sep 11 2012]

A192457 Constant term of the reduction by x^2->x+2 of the polynomial p(n,x) defined below in Comments.

Original entry on oeis.org

0, 2, 14, 118, 1210, 14730, 208110, 3350550, 60580170, 1215657450, 26813382750, 644830644150, 16793095369050, 470839138619850, 14140985865756750, 452938463797569750, 15412288335824630250, 555226177657611710250, 21111260070730770690750
Offset: 0

Views

Author

Clark Kimberling, Jul 01 2011

Keywords

Comments

The polynomial p(n,x) is defined by recursively by p(n,x)=(x+2n)*p(n-1,x) with p[0,x]=x. For an introduction to reductions of polynomials by substitutions such as x^2->x+2, see A192232.

Examples

			The first four polynomials p(n,x) and their reductions are as follows:
p(0,x)=x -> x
p(1,x)=x(2+x) -> 2+3x
p(2,x)=x(2+x)(4+x) -> 14+17x
p(3,x)=x(2+x)(4+x)(6+x) -> 118+133x.
From these, read
A192457=(0,2,14,118,...) and A192459=(1,3,17,133,...)
		

Crossrefs

Programs

  • Mathematica
    q[x_] := x + 2; p[0, x_] := x;
    p[n_, x_] := (x + 2 n)*p[n - 1, x] /; n > 0
    Table[Simplify[p[n, x]], {n, 0, 5}]
    reductionRules = {x^y_?EvenQ -> q[x]^(y/2),
       x^y_?OddQ -> x q[x]^((y - 1)/2)};
    t = Table[FixedPoint[Expand[#1 /. reductionRules] &, p[n, x]], {n, 0, 30}]
    Table[Coefficient[Part[t, n], x, 0], {n, 1, 16}]  (* A192457 *)
    Table[Coefficient[Part[t, n]/2, x, 0], {n, 1, 16}]  (* A192458 *)
    Table[Coefficient[Part[t, n], x, 1], {n, 1, 16}]  (* A192459 *)

Formula

a(n) = (2/3)*(2^n(n+1)! - (2n-1)!!). - Vaclav Potocek, Feb 04 2016

A192472 Constant term of the reduction by x^2->x+1 of the polynomial p(n,x)=1+x^n+x^(2n+2).

Original entry on oeis.org

3, 7, 15, 37, 93, 239, 619, 1611, 4203, 10981, 28713, 75115, 196563, 514463, 1346647, 3525189, 9228453, 24159415, 63248571, 165584323, 433501203, 1134914117, 2971232785, 7778770707, 20365057443, 53316366199, 139583983839, 365435492581
Offset: 1

Views

Author

Clark Kimberling, Jul 01 2011

Keywords

Comments

For an introduction to reductions of polynomials by substitutions such as x^2->x+1, see A192232.

Examples

			The first four polynomials p(n,x) and their reductions are as follows:
p(1,x)=1+x+x^4 -> 3+4x
p(2,x)=1+x^2+x^6 -> 7+9x
p(3,x)=1+x^3+x^8 -> 15+23x
p(4,x)=1+x^4+x^10 -> 37+58x.
From these, read
A192472=(3,7,15,37,...) and A192473=(4,9,23,58,...)
		

Crossrefs

Programs

  • Mathematica
    Remove["Global`*"];
    q[x_] := x + 1; p[n_, x_] := 1 + x^n + x^(2 n+2);
    Table[Simplify[p[n, x]], {n, 1, 5}]
    reductionRules = {x^y_?EvenQ -> q[x]^(y/2),
       x^y_?OddQ -> x q[x]^((y - 1)/2)};
    t = Table[FixedPoint[Expand[#1 /. reductionRules] &, p[n, x]], {n, 1, 30}]
    Table[Coefficient[Part[t, n], x, 0], {n, 1, 30}]
    (* A192472 *)
    Table[Coefficient[Part[t, n], x, 1], {n, 1, 30}]
    (* A192473 *)

Formula

Empirical G.f.: -x*(3*x^4-8*x^3-x^2+8*x-3)/((x-1)*(x^2-3*x+1)*(x^2+x-1)). [Colin Barker, Nov 12 2012]

A192746 Constant term of the reduction by x^2 -> x+1 of the polynomial p(n,x) defined below in Comments.

Original entry on oeis.org

1, 5, 9, 17, 29, 49, 81, 133, 217, 353, 573, 929, 1505, 2437, 3945, 6385, 10333, 16721, 27057, 43781, 70841, 114625, 185469, 300097, 485569, 785669, 1271241, 2056913, 3328157, 5385073, 8713233, 14098309, 22811545, 36909857, 59721405, 96631265
Offset: 0

Views

Author

Clark Kimberling, Jul 09 2011

Keywords

Comments

The titular polynomial is defined recursively by p(n,x)=x*(n-1,x)+3n+1 for n>0, where p(0,x)=1. For discussions of polynomial reduction, see A192232 and A192744.

Crossrefs

Programs

  • GAP
    List([0..30], n-> 4*Fibonacci(n+2)-3); # G. C. Greubel, Jul 24 2019
  • Magma
    [4*Fibonacci(n+2)-3: n in [0..30]]; // G. C. Greubel, Jul 24 2019
    
  • Mathematica
    (* First program *)
    q = x^2; s = x + 1; z = 40;
    p[0, n_]:= 1; p[n_, x_]:= x*p[n-1, x] +3n +2;
    Table[Expand[p[n, x]], {n, 0, 7}]
    reduce[{p1_, q_, s_, x_}]:= FixedPoint[(s PolynomialQuotient @@ #1 + PolynomialRemainder @@ #1 &)[{#1, q, x}] &, p1]
    t = Table[reduce[{p[n, x], q, s, x}], {n, 0, z}];
    u1 = Table[Coefficient[Part[t, n], x, 0], {n, 1, z}] (* A192746 *)
    u2 = Table[Coefficient[Part[t, n], x, 1], {n, 1, z}] (* A192747 *) (* Clark Kimberling, Jul 09 2011 *)
    (* Additional programs *)
    a[0]=1;a[1]=5;a[n_]:=a[n]=a[n-1]+a[n-2]+3;Table[a[n],{n,0,36}] (* Gerry Martens, Jul 04 2015 *)
    4*Fibonacci[Range[0,40]+2]-3 (* G. C. Greubel, Jul 24 2019 *)
  • PARI
    vector(30, n, n--; 4*fibonacci(n+2)-3) \\ G. C. Greubel, Jul 24 2019
    
  • Sage
    [4*fibonacci(n+2)-3 for n in (0..30)] # G. C. Greubel, Jul 24 2019
    

Formula

G.f.: (1+3*x-x^2)/((1-x)*(1-x-x^2)), so the first differences are (essentially) A022087. - R. J. Mathar, May 04 2014
a(n) = 4*Fibonacci(n+2)-3. - Gerry Martens, Jul 04 2015
Previous Showing 21-30 of 280 results. Next