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

A204418 Periodic sequence 1,0,1,..., arranged in a triangle.

Original entry on oeis.org

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

Views

Author

Philippe Deléham, Jan 15 2012

Keywords

Comments

Binomial transform is A130781.
Row sums: 1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 9, ... = A004396(n+1) = A131737 (n+2) .
Diagonal sums: 1, 0, 2, 1, 1, 3, 3, 1, 5, 3, 2, 6, 5, 2, 8, 5, 3, 9, 7, 3, 11, 7, 4, 12, 9, 4, 14, 9, 5, 15, ..
Essentially the same as A141571 and A011655. - R. J. Mathar, Jan 16 2012
As sequence a(n) this is the characteristic sequence for the mod m reduced odd numbers (i.e., gcd(2*n+1,m)=1, n >= 0) for each modulus m from 3*A003586 = [3,6,9,12,18,24,27,36,48,...]. - Wolfdieter Lang, Feb 04 2012
Disregarding the triangle: a(A173732(n)) = 1. - Reinhard Zumkeller, Apr 29 2012

Examples

			Triangle begins:
  1;
  0, 1;
  1, 0, 1;
  1, 0, 1, 1;
  0, 1, 1, 0, 1;
  1, 0, 1, 1, 0, 1;
  1, 0, 1, 1, 0, 1, 1;
  0, 1, 1, 0, 1, 1, 0, 1;
  1, 0, 1, 1, 0, 1, 1, 0, 1;
		

References

  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.

Crossrefs

Cf. A011655.

Programs

Formula

If k==0 mod(3), T(n+k,k) = 1, 0, 1, 1, 0, 1, 1, 0, 1, ... (A204418)
If k==1 mod(3), T(n+k,k) = 1, 0, 0, 1, 0, 0, 1, 0, 0, ... (A079978)
If n==2 mod(3), T(n+k,k) = 1, 1, 1, 1, 1, 1, 1, 1, 1, ... (A000012)
a(A016777(n)) = 0.
G.f.:(1+x^2)/(1-x^3).
G.f.: U(0) where U(k)= 1 + x^2/(1 - x/(x + 1/U(k+1))); (continued fraction, 3-step). - Sergei N. Gladkovskii, Oct 17 2012

A130785 Sequence identical to its third differences: a(n+3) = 3a(n+2)-3a(n+1)+2a(n), with a(0)=1, a(1)=4, a(2)=9.

Original entry on oeis.org

1, 4, 9, 17, 32, 63, 127, 256, 513, 1025, 2048, 4095, 8191, 16384, 32769, 65537, 131072, 262143, 524287, 1048576, 2097153, 4194305, 8388608, 16777215, 33554431, 67108864, 134217729, 268435457, 536870912, 1073741823, 2147483647, 4294967296, 8589934593
Offset: 0

Views

Author

Paul Curtz, Jul 15 2007

Keywords

Comments

From R. J. Mathar, Nov 22 2007: (Start)
Sequences which equal the sequence of their d-th differences obey linear recurrences with constant binomial coefficients of the form Sum_{i=0..d} binomial(d,d-i)*(-1)^i*a(n-i) = a(n-d).
If d is even, this simplifies to Sum_{i=0..d-1} binomial(d,d-i)*(-1)^i*a(n-i) = 0.
This binding of d (d odd) or d-1 (d even) consecutive terms by the recurrences leaves d or d-1, respectively, free parameters to choose a(0),a(1),...,a(d) or a(0),a(1),...,a(d-1), respectively, which ultimately define the individual sequence.
The generating functions are
d=2: a(0)/(1-2*x).
d=3: (1/3)*(-a(0) + a(1) - a(2))/(-1+2*x) + (1/3)*(-4*a(0)*x - x*a(2) + 4*a(1)*x - a(2) + 2*a(0) + a(1))/(x^2-x+1).
d=4: (1/2)*(-2*a(0) + 2*a(1) - a(2))/(-1+2*x) + (1/2)*(2*a(1)*x - 4*a(0)*x - a(2) + 2*a(1))/(1 - 2*x + 2*x^2).
In the present sequence we have d=3 and g.f. = (x-1)/(x^2-x+1) - 2/(-1+2*x). (End)
Also binomial transform of A130784. a(n) = 2^(n+1) + A010892(n+4).
Recurrence in shorter form: a(n) = 2*a(n) + periodically extended [2, 1, -1, -2, -1, 1].
See A130750, A130752, A130755 for other examples of d=3 sequences, A130781 for an example of d=4.

Examples

			Triangle of sequence and 1st, 2nd, 3rd differences:
  1   4   9  17  32  63 127 256 513
    3   5   8  15  31  64 129 257
      2   3   7  16  33  65 128
        1   4   9  17  32  63 ... equal to first row
		

Programs

  • Mathematica
    d = 3; nmax = 20; a[n_ /; n < d] := (n+1)^2; seq = Table[a[n], {n, 0, nmax}]; seq /. Solve[ Thread[ Take[seq, nmax - d + 1] == Differences[seq, d]]] // First (* Jean-François Alcover, Nov 07 2013 *)
    LinearRecurrence[{3, -3, 2},{1, 4, 9},21] (* Ray Chandler, Sep 23 2015 *)
    Table[2^(n + 1) - Cos[(2 n + 1) Pi/6] 2/Sqrt[3], {n, 0, 32}] (* Vladimir Reshetnikov, Oct 15 2017 *)

Formula

a(n) = 2^(n+1) - cos((2*n+1)*Pi/6) * 2/sqrt(3). - Vladimir Reshetnikov, Oct 15 2017
G.f.: (1+x)/((1-2*x)*(1-x+x^2)). - Joerg Arndt, Oct 16 2017

Extensions

Edited and extended by R. J. Mathar, Nov 22 2007

A138635 a(n) =3*a(n-3)-3*a(n-6)+2*a(n-9).

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 1, 2, 1, 3, 3, 2, 6, 5, 5, 11, 10, 11, 21, 21, 22, 42, 43, 43, 85, 86, 85, 171, 171, 170, 342, 341, 341, 683, 682, 683, 1365, 1365, 1366, 2730, 2731, 2731, 5461, 5462, 5461, 10923, 10923, 10922, 21846, 21845, 21845, 43691, 43690, 43691, 87381
Offset: 0

Views

Author

Paul Curtz, May 14 2008

Keywords

Comments

As the recurrence shows, these are three interleaved sequences which obey recurrences b(n)=3*b(n-1)-3*b(n-2)+2*b(n-3), indicating that the b(n) equal their third differences.
These three sequences are A024495, A024494 (or A131708) and A024493 (or A130781).
Their starting "vectors" b(0,1,2) are 0,0,1 and 0,1,2 and 1,1,1, respectively, therefore linearly independent, such that other sequences with the same recursion as b(n) can be written as linear combinations of these.

Crossrefs

Formula

a(18*n) = 21*A133853(n).
G.f.: -x^2*(1+x^2-2*x^3+x^4-x^5+x^6)/((2*x^3-1)*(x^6-x^3+1)). - R. J. Mathar, May 17 2009

Extensions

Edited by R. J. Mathar, May 17 2009

A157823 a(n) = A156591(n) + A156591(n+1).

Original entry on oeis.org

-5, -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824
Offset: 0

Views

Author

Paul Curtz, Mar 07 2009

Keywords

Comments

A156591 = 2,-7,6,-8,4,-12,... a(n) is companion to A154589 = 4,-1,-2,-4,-8,.For this kind ,companion of sequence b(n) is first differences a(n), second differences being b(n). Well known case: A131577 and A011782. a(n)+b(n)=A000079 or -A000079. a(n)=A154570(n+2)-A154570(n) ,A154570 = 1,3,-4,2,-6,-2,-14,. See sequence(s) identical to its p-th differences (A130785,A130781,A024495,A000749,A138112(linked to Fibonacci),A139761).

Programs

  • PARI
    Vec(-(9*x-5)/(2*x-1) + O(x^100)) \\ Colin Barker, Feb 03 2015

Formula

a(n) = 2*a(n-1) for n>1. G.f.: -(9*x-5) / (2*x-1). - Colin Barker, Feb 03 2015

Extensions

Edited by Charles R Greathouse IV, Oct 11 2009

A202349 Lexicographically earliest sequence such that the sequence and its first and second differences share no terms, and the 3rd differences are equal to the original sequence.

Original entry on oeis.org

1, 3, 9, 20, 39, 75, 148, 297, 597, 1196, 2391, 4779, 9556, 19113, 38229, 76460, 152919, 305835, 611668, 1223337, 2446677, 4893356, 9786711, 19573419, 39146836, 78293673, 156587349, 313174700, 626349399, 1252698795, 2505397588, 5010795177, 10021590357
Offset: 1

Views

Author

Eric Angelini, Jun 21 2016

Keywords

Comments

The sequence is completely determined by its first 3 terms. If the first terms are x, y, z, then the following terms are 2*x-3*y+3*z, 6*x-7*y+6*z, 12*x-12*y+11*z, 22*x-21*y+21*z, 42*x-41*y+42*z, 84*x-84*y+85*z, 170*x-171*y+171*z, 342*x-343*y+342*z. - Giovanni Resta, Jun 21 2016
Is it a theorem that, if x,y,z = 1,3,9, the sequence has the desired properties, or is it just a conjecture? - N. J. A. Sloane, Jun 21 2016
From Charlie Neder, Jan 10 2019: (Start)
No two terms among this sequence and its first and second differences are equal.
Proof: Representing the first and second differences by b(n) and c(n), we have that a-b is [-1, -3, -2, 1, 3, 2] with period 6, a-c is [-3, -2, -1, 3, 2, 1] with period 6, and b-c is [-2, 1, 3, 2, -1, -3] with period 6. Therefore, no two terms at the same index are equal. Since the sequence is forced to grow exponentially, only the first few terms need to be checked to confirm that no two terms at different indices are equal, proving the criterion always holds. (End)

Examples

			  1 3 9  20  39  75  148   297   597   1196
   2 6 11  19  36  73   149   300   599
    4 5   8  17  37  76   151    299
     1  3   9  20  39   75    148   <-- the starting sequence
		

Crossrefs

Cf. A024493, A130781, A069705 (inverse binomial transform assuming offset 0).
For many similar sequences, see the Index link.

Programs

  • Mathematica
    d = Differences; i = Intersection; sol = Solve[d@ d@ d@ Array[x, 50] == Array[x, 47], Array[x, 47, 4]][[1]]; a = (Array[x, 50] /. sol) /. {x[1] -> 1, x[2] -> 3, x[3] -> 9}; Print["Check = ", {i[a, d@ a], i[a, d@ d@ a], i[d@ a, d@ d@ a]}]; a (* Giovanni Resta, Jun 21 2016 *)
  • PARI
    first(n) = {n = max(n, 4); my(res = vector(n)); for(i = 1, 3, res[i] = 3^(i - 1)); for(i = 4, n, res[i] = 3 * res[i - 1] - 3 * res[i - 2] + 2 * res[i - 3]); res } \\ David A. Corneth, Jan 11 2019
    
  • PARI
    Vec(x*(1 + 3*x^2) / ((1 - 2*x)*(1 - x + x^2)) + O(x^40)) \\ Colin Barker, Jan 12 2019

Formula

From Colin Barker, Jan 11 2019: (Start)
G.f.: x*(1 + 3*x^2) / ((1 - 2*x)*(1 - x + x^2)).
a(n) = 3*a(n-1) - 3*a(n-2) + 2*a(n-3) for n>2. (End)
a(n) = Sum_{k=0..n-1} binomial(n-1,k)*(2^k mod 7). - Fabio Visonà, Sep 05 2023

Extensions

a(18)-a(33) from Giovanni Resta, Jun 21 2016

A232774 Triangle T(n,k), read by rows, given by T(n,0)=1, T(n,1)=2^(n+1)-n-2, T(n,n)=(-1)^(n-1) for n > 0, T(n,k)=T(n-1,k)-T(n-1,k-1) for 1 < k < n.

Original entry on oeis.org

1, 1, 1, 1, 4, -1, 1, 11, -5, 1, 1, 26, -16, 6, -1, 1, 57, -42, 22, -7, 1, 1, 120, -99, 64, -29, 8, -1, 1, 247, -219, 163, -93, 37, -9, 1, 1, 502, -466, 382, -256, 130, -46, 10, -1, 1, 1013, -968, 848, -638, 386, -176, 56, -11, 1, 2036, -1981, 1816, -1486, 1024
Offset: 0

Views

Author

Philippe Deléham, Nov 30 2013

Keywords

Comments

Row sums are A000079(n) = 2^n.
Diagonal sums are A024493(n+1) = A130781(n).
Sum_{k=0..n} T(n,k)*x^k = -A003063(n+2), A159964(n), A000012(n), A000079(n), A001045(n+2), A056450(n), (-1)^(n+1)*A232015(n+1) for x = -2, -1, 0, 1, 2, 3, 4 respectively.

Examples

			Triangle begins:
  1;
  1,    1;
  1,    4,   -1;
  1,   11,   -5,   1;
  1,   26,  -16,   6,   -1;
  1,   57,  -42,  22,   -7,   1;
  1,  120,  -99,  64,  -29,   8,   -1;
  1,  247, -219, 163,  -93,  37,   -9,  1;
  1,  502, -466, 382, -256, 130,  -46, 10,  -1;
  1, 1013, -968, 848, -638, 386, -176, 56, -11, 1;
		

Crossrefs

Formula

G.f.: Sum_{n>=0, k=0..n} T(n,k)*y^k*x^n=(1+2*(y-1)*x)/((1-2*x)*(1+(y-1)*x)).
|T(2*n,n)| = 4^n = A000302(n).
T(n,k) = (-1)^(k-1) * (Sum_{i=0..n-k} (2^(i+1)-1) * binomial(n-i-1,k-1)) for 0 < k <= n and T(n,0) = 1 for n >= 0. - Werner Schulte, Mar 22 2019
Showing 1-6 of 6 results.