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.

A233323 Triangle read by rows: T(n,k) = number of palindromic compositions of n in which the largest part is equal to k, 1 <= k <= n.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 2, 0, 1, 1, 1, 1, 0, 1, 1, 4, 1, 1, 0, 1, 1, 2, 3, 0, 1, 0, 1, 1, 7, 3, 3, 0, 1, 0, 1, 1, 4, 6, 1, 2, 0, 1, 0, 1, 1, 12, 7, 7, 1, 2, 0, 1, 0, 1, 1, 7, 12, 3, 5, 0, 2, 0, 1, 0, 1, 1, 20, 16, 15, 3, 5, 0, 2, 0, 1, 0, 1
Offset: 1

Views

Author

L. Edson Jeffery, Dec 10 2013

Keywords

Comments

A palindromic composition of a natural number m is an ordered partition of m into N+1 natural numbers (or parts), p_0, p_1, ..., p_N, of the form m = p_0 + p_1 + ... + p_N such that p_j = p_{N-j}, for each j in {0,...,N}. Two palindromic compositions, sum_{j=0..N} p_j and sum_{j=0..N} q_j (say), are identical if and only if p_j = q_j, j = 0,...,N; otherwise they are taken to be distinct.

Examples

			There are eight palindromic compositions of n=7, namely, {7}, {3,1,3}, {2,3,2}, {2,1,1,1,2}, {1,5,1}, {1,2,1,2,1}, {1,1,3,1,1}, {1,1,1,1,1,1,1}, and three of them have the largest part equal to 3, so T(7,3) = 3.
Triangle T(n,k) begins:
  1;
  1,  1;
  1,  0, 1,
  1,  2, 0, 1;
  1,  1, 1, 0, 1;
  1,  4, 1, 1, 0, 1;
  1,  2, 3, 0, 1, 0, 1;
  1,  7, 3, 3, 0, 1, 0, 1;
  1,  4, 6, 1, 2, 0, 1, 0, 1;
  1, 12, 7, 7, 1, 2, 0, 1, 0, 1;
  ...
		

Crossrefs

Cf. A016116 (row sums), A233324 (row partial sums).
T(n,2)+1 = A053602(n+1) = A123231(n). T(4n-2,2n) = A011782(n-1). - Alois P. Heinz, Dec 11 2013

Programs

  • Maple
    b:= proc(n, k) option remember; `if`(n<=k, 1, 0)+
          add(b(n-2*j, k), j=1..min(k, iquo(n, 2)))
        end:
    T:= (n, k)-> b(n, k) -b(n, k-1):
    seq(seq(T(n, k), k=1..n), n=1..14);  # Alois P. Heinz, Dec 11 2013
  • Mathematica
    b[n_, k_] := b[n, k] = If[n <= k, 1, 0] + Sum[b[n-2*j, k], { j, 1, Min[k, Quotient[n, 2]]}]; t[n_, k_] := b[n, k] - b[n, k-1]; Table[Table[t[n, k], {k, 1, n}], {n, 1, 14}] // Flatten (* Jean-François Alcover, Dec 13 2013, translated from Alois P. Heinz's Maple code *)
  • PARI
    T(n,k,ok=0)={
        if(n<1,return(n==0 && ok));
        if(k>n/2 && !ok,
            n-=k;
            if(n<0||n%2, return(0));
            return(2^max(n/2-1,0))
        );
        sum(i=1,k,
            T(n-2*i,k,ok||i==k)
        )+(n==k || (ok && nCharles R Greathouse IV, Dec 11 2013

A233324 Triangle read by rows: T(n,k) = number of palindromic compositions of n in which no part exceeds k, 1 <= k <= n.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 1, 3, 3, 4, 1, 2, 3, 3, 4, 1, 5, 6, 7, 7, 8, 1, 3, 6, 6, 7, 7, 8, 1, 8, 11, 14, 14, 15, 15, 16, 1, 5, 11, 12, 14, 14, 15, 15, 16, 1, 13, 20, 27, 28, 30, 30, 31, 31, 32, 1, 8, 20, 23, 28, 28, 30, 30, 31, 31, 32, 1, 21, 37, 52, 55, 60, 60, 62, 62, 63, 63, 64
Offset: 1

Views

Author

L. Edson Jeffery, Dec 11 2013

Keywords

Comments

A palindromic composition of a natural number m is an ordered partition of m into N+1 natural numbers (or parts), p_0, p_1, ..., p_N, of the form m = p_0 + p_1 + ... + p_N such that p_j = p_{N-j}, for each j in {0,...,N}. Two palindromic compositions, sum_{j=0..N} p_j and sum_{j=0..N} q_j (say), are identical if and only if p_j = q_j, j = 0,...,N; otherwise they are taken to be distinct.
Partial sums of rows of A233323.
T(n,k) is defined for n,k >= 0. T(n,k) = T(n,n) = A016116(n) for k>= 0. - Alois P. Heinz, Dec 11 2013

Examples

			Triangle T(n,k) begins:
1;
1,  2;
1,  1,  2;
1,  3,  3,  4;
1,  2,  3,  3,  4;
1,  5,  6,  7,  7,  8;
1,  3,  6,  6,  7,  7,  8;
1,  8, 11, 14, 14, 15, 15, 16;
1,  5, 11, 12, 14, 14, 15, 15, 16;
1, 13, 20, 27, 28, 30, 30, 31, 31, 32;
		

Crossrefs

Cf. A233323.
T(n,2) = A053602(n+1) = A123231(n). T(2n,3) = A001590(n+3). T(2n,4) = A001631(n+4). - Alois P. Heinz, Dec 11 2013

Programs

  • Maple
    T:= proc(n, k) option remember; `if`(n<=k, 1, 0)+
          add(T(n-2*j, k), j=1..min(k, iquo(n, 2)))
        end:
    seq(seq(T(n, k), k=1..n), n=1..14);  # Alois P. Heinz, Dec 11 2013
  • Mathematica
    T[n_, k_] := T[n, k] = If[n <= k, 1, 0] + Sum[T[n-2*j, k], {j, 1, Min[k, Quotient[ n, 2]]}]; Table[Table[T[n, k], {k, 1, n}], {n, 1, 14}] // Flatten (* Jean-François Alcover, Mar 09 2015, after Alois P. Heinz *)
  • PARI
    T(n,k)=if(n<1,return(n==0));sum(i=1,k,T(n-2*i,k))+(n<=k) \\ Charles R Greathouse IV, Dec 11 2013

A272912 Difference sequence of the sequence A116470 of all distinct Fibonacci numbers and Lucas numbers (A000032).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 3, 2, 5, 3, 8, 5, 13, 8, 21, 13, 34, 21, 55, 34, 89, 55, 144, 89, 233, 144, 377, 233, 610, 377, 987, 610, 1597, 987, 2584, 1597, 4181, 2584, 6765, 4181, 10946, 6765, 17711, 10946, 28657, 17711, 46368, 28657, 75025, 46368, 121393, 75025
Offset: 1

Views

Author

Clark Kimberling, May 10 2016

Keywords

Comments

Every term is a Fibonacci number (A000045).

Examples

			A116470 = (1, 2, 3, 4, 5, 7, 8, 11, 13, 18, 21, 29, 34, 47, 55, 76,...), so that (a(n)) = (1,1,1,1,2,1,3,2,5,3,8,5,13,8,12,...).
		

Crossrefs

Programs

  • Mathematica
    u = Table[Fibonacci[n], {n, 1, 200}]; v = Table[LucasL[n], {n, 1, 200}];
    Take[Differences[Union[u, v]], 100]
  • PARI
    Vec(x*(1+x-x^5)/(1-x^2-x^4) + O(x^50)) \\ Colin Barker, May 10 2016

Formula

From Colin Barker, May 10 2016: (Start)
a(n) = a(n-2)+a(n-4) for n>4.
G.f.: x*(1+x-x^5) / (1-x^2-x^4).
(End)
a(n) = A053602(n-2), n>2. - R. J. Mathar, May 20 2016
a(n) = A123231(n-3), n>3. - Georg Fischer, Oct 23 2018

A382478 Number of palindromic binary strings of length n having no 4-runs of 1's.

Original entry on oeis.org

1, 2, 2, 4, 3, 7, 6, 14, 12, 27, 23, 52, 44, 100, 85, 193, 164, 372, 316, 717, 609, 1382, 1174, 2664, 2263, 5135, 4362, 9898, 8408, 19079, 16207, 36776, 31240, 70888, 60217, 136641, 116072, 263384, 223736, 507689, 431265, 978602, 831290, 1886316, 1602363, 3635991, 3088654, 7008598, 5953572
Offset: 0

Views

Author

R. J. Mathar, Mar 28 2025

Keywords

Crossrefs

Cf. A001630 (bisection), A001631 (bisection).
Cf. A123231 (2-runs), A001590 (3-runs), A251653 (5-runs), A382479 (6-runs).

Programs

  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(-(x^2+1)*(x^5+2*x+1) / (-1+x^2+x^4+x^6+x^8))); // Vincenzo Librandi, May 19 2025
  • Mathematica
    LinearRecurrence[{0,1,0,1,0,1,0,1},{1,2,2,4,3,7,6,14},50] (* Vincenzo Librandi, May 19 2025 *)

Formula

G.f.: -(x^2+1)*(x^5+2*x+1)/(-1+x^2+x^4+x^6+x^8).

A382479 Number of palindromic binary strings of length n having no 6-runs of 1's.

Original entry on oeis.org

1, 2, 2, 4, 4, 8, 7, 15, 14, 30, 28, 60, 56, 119, 111, 236, 220, 468, 436, 928, 865, 1841, 1716, 3652, 3404, 7244, 6752, 14369, 13393, 28502, 26566, 56536, 52696, 112144, 104527, 222447, 207338, 441242, 411272, 875240, 815792, 1736111, 1618191, 3443720, 3209816, 6830904, 6366936
Offset: 0

Views

Author

R. J. Mathar, Mar 28 2025

Keywords

Crossrefs

Cf. A251707 (bisection), A251708 (bisection).
Cf. A123231 (2-runs), A001590 (3-runs), A382478 (4-runs), A251653 (5-runs).

Programs

  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(-(1+x+x^2)*(x^2-x+1)*(x^7+2*x+1)/(-1+x^2+x^4+x^6+x^8+x^10+x^12))); // Vincenzo Librandi, May 20 2025
  • Mathematica
    LinearRecurrence[{0,1,0,1,0,1,0,1,0,1,0,1},{1,2,2,4,4,8,7,15,14,30,28,60},50] (* Vincenzo Librandi, May 20 2025 *)

Formula

G.f.: -(1+x+x^2)*(x^2-x+1)*(x^7+2*x+1)/(-1+x^2+x^4+x^6+x^8+x^10+x^12).

A380696 a(n) = A007598(floor(n/2) - (-1)^n).

Original entry on oeis.org

1, 1, 0, 1, 1, 4, 1, 9, 4, 25, 9, 64, 25, 169, 64, 441, 169, 1156, 441, 3025, 1156, 7921, 3025, 20736, 7921, 54289, 20736, 142129, 54289, 372100, 142129, 974169, 372100, 2550409, 974169, 6677056, 2550409, 17480761, 6677056, 45765225, 17480761, 119814916
Offset: 0

Views

Author

Benjamin G. Brunsden, Jan 30 2025

Keywords

Comments

The Fibonacci spiral is produced by creating a quarter circle of radius 1, then adding successive quarter circles such that the radius of the new quarter circle is the sum of the radii of the previous two quarter circles, and that the circumference of the new quarter circle continues where the previous quarter circle ended. When the center of the first quarter circle is at 0,0 the circumference turns clockwise from -1,0, and terms after n=1 are given signs - + + - repeating, these are the x coordinates where the circumferences meet. The y coordinates are the golden rectangle numbers (A001654) with the same pattern of alternation (x,a,b,x), and the same pattern of signs shifted backward one.

Crossrefs

Programs

  • Mathematica
    A380696[n_] := Fibonacci[Floor[n/2] - (-1)^n]^2; Array[A380696, 50, 0] (* or *)
    LinearRecurrence[{0, 2, 0, 2, 0, -1}, {1, 1, 0, 1, 1, 4}, 50] (* Paolo Xausa, Mar 27 2025 *)
  • Python
    from sympy import fibonacci
    def A380696(n): return fibonacci(n+1>>1 if n&1 else (n>>1)-1)**2 # Chai Wah Wu, Mar 26 2025

Formula

a(n) = Fibonacci(floor(n/2)-(-1)^n)^2.
a(n) = A053602(n-2)^2 for n >= 2.
a(n) = A272912(n)^2 for n >= 3.
G.f. ( 1+x-x^3-x^4-2*x^2 ) / ( (1+x^2)*(x^2-x-1)*(x^2+x-1) ).
a(2*n) + a(2*n+1) = A069921(n-1) for n>=1.
Showing 1-6 of 6 results.