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-4 of 4 results.

A140657 Powers of 2 with 3 alternatingly added and subtracted.

Original entry on oeis.org

4, -1, 7, 5, 19, 29, 67, 125, 259, 509, 1027, 2045, 4099, 8189, 16387, 32765, 65539, 131069, 262147, 524285, 1048579, 2097149, 4194307, 8388605, 16777219, 33554429, 67108867, 134217725, 268435459, 536870909, 1073741827, 2147483645, 4294967299, 8589934589
Offset: 0

Views

Author

Paul Curtz, Jul 10 2008

Keywords

Crossrefs

Programs

  • Magma
    [2^n+3*(-1)^n: n in [0..40]]; // Vincenzo Librandi, Aug 08 2011
  • Mathematica
    LinearRecurrence[{1,2},{4,-1},40] (* or *) Total/@Partition[Riffle[ Table[ 2^n, {n,0,40}],{3,-3}],2] (* Harvey P. Dale, Nov 13 2014 *)
    CoefficientList[Series[(4 - 5 x) / ((1 + x) (1 - 2 x)), {x, 0, 50}], x] (* Vincenzo Librandi, Jan 14 2015 *)

Formula

a(2n) = A000079(2n+1) + 3, a(2n+1) = A000079(2n+2) - 3.
a(n+1) - 2*a(n) = -9*A033999(n) = (-1)^(n+1)*A010734.
a(n) + a(n+1) = 3^*2^n = A007283(n).
a(2n) + a(2n+1) = A096045(n) + 2.
a(-n) = -A140683(n)/2^n.
O.g.f.: (4-5*x)/((1-2*x)(1+x)). - R. J. Mathar, Jul 29 2008
a(n) = 2^n+3*(-1)^n. - R. J. Mathar , Jul 29 2008

Extensions

Edited and extended by R. J. Mathar, Jul 29 2008
4 inserted as first term and formulas accordingly updated by Jean-François Alcover, Jan 14 2015

A280345 a(0) = 3, a(n+1) = 2*a(n) + periodic sequence of length 2: repeat [1, -2].

Original entry on oeis.org

3, 7, 12, 25, 48, 97, 192, 385, 768, 1537, 3072, 6145, 12288, 24577, 49152, 98305, 196608, 393217, 786432, 1572865, 3145728, 6291457, 12582912, 25165825, 50331648, 100663297, 201326592, 402653185, 805306368, 1610612737, 3221225472, 6442450945, 12884901888
Offset: 0

Views

Author

Paul Curtz, Jan 01 2017

Keywords

Comments

a(n) mod 9 is a periodic sequence of length 2: repeat [3, 7].
From 7, the last digit is of period 4: repeat [7, 2, 5, 8].
(Main sequence for the signature (2,1,-2): 0, 0, 1, 2, 5, 10, 21, 42, ... = 0 followed by A000975(n) = b(n), which first differences are A001045(n) (Paul Barry, Oct 08 2005). Then, 0 followed by b(n) is an autosequence of the first kind. The corresponding autosequence of the second kind is 0, 0, 2, 3, 8, 15, 32, 63, ... . See A277078(n).)
Difference table of a(n):
3, 7, 12, 25, 48, 97, 192, ...
4, 5, 13, 23, 49, 95, 193, ... = -(-1)^n* A140683(n)
1, 8, 10, 26, 46, 98, 190, ... = A259713(n)
7, 2, 16, 20, 52, 92, 196, ...
-5, 14, 4, 32, 40, 104, 184, ...
... .

Examples

			a(0) = 3, a(1) = 2*3 + 1 = 7, a(2) = 2*7 - 2 = 12, a(3) = 2*12 + 1 = 25.
		

Crossrefs

Programs

  • Mathematica
    a[0] = 3; a[n_] := a[n] = 2 a[n - 1] + 1 + (-3) Boole[EvenQ@ n]; Table[a@ n, {n, 0, 32}] (* or *)
    CoefficientList[Series[(3 + x - 5 x^2)/((1 - x) (1 + x) (1 - 2 x)), {x, 0, 32}], x] (* Michael De Vlieger, Jan 01 2017 *)
  • PARI
    Vec((3 + x - 5*x^2) / ((1 - x)*(1 + x)*(1 - 2*x)) + O(x^40)) \\ Colin Barker, Jan 01 2017

Formula

a(2n) = 3*4^n, a(2n+1) = 6*4^n + 1.
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3), n>2.
a(n+2) = a(n) + 9*2^n.
a(n) = 2^(n+2) - A051049(n).
From Colin Barker, Jan 01 2017: (Start)
a(n) = 3*2^n for n even.
a(n) = 3*2^n + 1 for n odd.
G.f.: (3 + x - 5*x^2) / ((1 - x)*(1 + x)*(1 - 2*x)).
(End)
Binomial transform of 3, followed by (-1)^n* A140657(n).

Extensions

More terms from Colin Barker, Jan 01 2017

A268741 a(n) = 2*a(n - 2) - a(n - 1) for n>1, a(0) = 4, a(1) = 5.

Original entry on oeis.org

4, 5, 3, 7, -1, 15, -17, 47, -81, 175, -337, 687, -1361, 2735, -5457, 10927, -21841, 43695, -87377, 174767, -349521, 699055, -1398097, 2796207, -5592401, 11184815, -22369617, 44739247, -89478481, 178956975, -357913937, 715827887, -1431655761, 2863311535
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 12 2016

Keywords

Comments

In general, the ordinary generating function for the recurrence relation b(n) = 2*b(n - 2) - b(n - 1) with n>1 and b(0)=k, b(1)=m, is (k + (k + m)*x)/(1 + x - 2*x^2). This recurrence gives the closed form a(n) = ((-2)^n*(k - m) + 2*k + m).

Examples

			a(0) = (5 + 3)/2 = 4  because a(1) = 5, a(2) = 3;
a(1) = (3 + 7)/2 = 5  because a(2) = 3, a(3) = 7;
a(2) = (7 - 1)/2 = 3  because a(3) = 7, a(4) = -1, etc.
		

Crossrefs

Programs

  • Magma
    [(13-(-2)^n)/3: n in [0..35]]; // Vincenzo Librandi, Feb 13 2016
    
  • Mathematica
    Table[(13 - (-2)^n)/3, {n, 0, 33}]
    LinearRecurrence[{-1, 2}, {4, 5}, 34]
    RecurrenceTable[{a[1] == 4, a[2] == 5, a[n] == 2*a[n-2] - a[n-1]}, a, {n, 50}] (* Vincenzo Librandi, Feb 13 2016 *)
  • PARI
    Vec((4 + 9*x)/(1 + x - 2*x^2) + O(x^40)) \\ Michel Marcus, Feb 25 2016

Formula

G.f.: (4 + 9*x)/(1 + x - 2*x^2).
a(n) = (13 - (-2)^n)/3.
a(n) = A084247(n) + 3.
a(n) = (-1)^n*A154570(n+1) + 1.
a(n) = (-1)^(n-1)*A171382(n-1) + 2.
Limit_{n -> oo} a(n)/a(n + 1) = -1/2.
a(n) = 4 - (-1)^n *A001045(n). - Paul Curtz, Feb 26 2024

A355668 Array read by upwards antidiagonals T(n,k) = J(k) + n*J(k+1) where J(n) = A001045(n) is the Jacobsthal numbers.

Original entry on oeis.org

0, 1, 1, 2, 2, 1, 3, 3, 4, 3, 4, 4, 7, 8, 5, 5, 5, 10, 13, 16, 11, 6, 6, 13, 18, 27, 32, 21, 7, 7, 16, 23, 38, 53, 64, 43, 8, 8, 19, 28, 49, 74, 107, 128, 85, 9, 9, 22, 33, 60, 95, 150, 213, 256, 171, 10, 10, 25, 38, 71, 116, 193, 298, 427, 512, 341
Offset: 0

Views

Author

Paul Curtz, Jul 13 2022

Keywords

Examples

			Row n=0 is A001045(k), then for further rows we successively add A001045(k+1).
       k=0  k=2  k=3  k=4  k=5  k=6  k=7  k=8  k=9 k=10
  n=0:  0    1    1    3    5   11   21   43   85  171 ... = A001045
  n=1:  1    2    4    8   16   32   64  128  256  512 ... = A000079
  n=2:  2    3    7   13   27   53  107  213  427  853 ... = A048573
  n=3:  3    4   10   18   38   74  150  298  598 1194 ... = A171160
  n=4:  4    5   13   23   49   95  193  383  769 1535 ... = abs(A140683)
  ...
		

Crossrefs

Antidiagonal sums give A320933(n+1).

Programs

  • Mathematica
    T[n_, k_] := (2^k - (-1)^k + n*(2^(k + 1) + (-1)^k))/3; Table[T[n - k, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Amiram Eldar, Jul 13 2022 *)

Formula

T(n, k) = (2^k - (-1)^k + n*(2^(k + 1) + (-1)^k))/3.
G.f.: (x*(y-1) - y)/((x - 1)^2*(y + 1)*(2*y - 1)). - Stefano Spezia, Jul 13 2022
Showing 1-4 of 4 results.