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.

A367076 Irregular triangle read by rows: T(n,k) (0 <= n, 0 <= k < 2^n). T(n,k) = -Sum_{i=0..k} A365968(n,i).

Original entry on oeis.org

0, 1, 0, 3, 4, 3, 0, 6, 10, 12, 12, 12, 10, 6, 0, 10, 18, 24, 28, 32, 34, 34, 32, 34, 34, 32, 28, 24, 18, 10, 0, 15, 28, 39, 48, 57, 64, 69, 72, 79, 84, 87, 88, 89, 88, 85, 80, 85, 88, 89, 88, 87, 84, 79, 72, 69, 64, 57, 48, 39, 28, 15, 0, 21, 40, 57, 72, 87
Offset: 0

Views

Author

John Tyler Rascoe, Nov 05 2023

Keywords

Examples

			Triangle begins:
    k=0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
n=0:  0;
n=1:  1,  0;
n=2:  3,  4,  3,  0;
n=3:  6, 10, 12, 12, 12, 10,  6,  0;
n=4; 10, 18, 24, 28, 32, 34, 34, 32, 34, 34, 32, 28, 24, 18, 10,  0;
		

Crossrefs

Cf. A000217 (column k=0), A028552 (column k=1), A192021 (row sums).

Programs

  • Mathematica
    nmax=10; row[n_]:=Join[CoefficientList[Series[1/(1-x)*Sum[ i/(1+x^2^(i-1))*Product[1+x^2^j,{j,0,i-2}],{i,n}],{x,0,2^n-1}],x],{0}]; Array[row,6,0] (* Stefano Spezia, Dec 23 2023 *)
  • Python
    def row_gen(n):
        x = 0
        for k in range(2**n):
            b = bin(k)[2:].zfill(n)
            x += sum((-1)**(int(b[n-i])+1)*i for i in range(1,n+1))
            yield(-x)
    def A367076_row_n(n): return(list(row_gen(n)))

Formula

T(n,k) = Sum_{i=0..n} abs(k + 1 - (2^i) * round((k+1)/2^i)) * i.
G.f. for n-th row: 1/(1-x) * Sum_{i=1..n} (i/(1+x^2^(i-1)) * Product_{j=0..i-2} 1 + x^2^j).

A377170 Sum of the nonnegative terms in the n-th row of A365968.

Original entry on oeis.org

0, 1, 4, 12, 36, 98, 250, 616, 1484, 3508, 8140, 18620, 42164, 94632, 210518, 464840, 1020556, 2229014, 4843316, 10476164, 22576728, 48489154, 103790370, 221484824, 471427432, 1001027226, 2120503144, 4482083616, 9455815160, 19913405076, 41862056992, 87857540836
Offset: 0

Views

Author

John Tyler Rascoe, Oct 18 2024

Keywords

Comments

By symmetry -a(n) is the sum of the nonpositive terms in the n-th row of A365968.

Examples

			The 4th row of A365968 is: [-10, -8, -6, -4, -4, -2, 0, 2, -2, 0, 2, 4, 4, 6, 8, 10], so a(4) = 2 + 2 + 4 + 4 + 6 + 8 + 10 = 36.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, s) option remember; `if`(n=0, s,
          b(n-1, abs(s-n))+b(n-1, s+n))
        end:
    a:= n-> b(n, 0)/2:
    seq(a(n), n=0..31);  # Alois P. Heinz, Jun 13 2025

Formula

a(n) = (1/2) * Sum_{k=0..2^n-1} abs(A365968(n,k)).
a(n) = (1/2) * Sum_{i=0..2^n-1} abs(A384868(i+2^n-1)). - Alois P. Heinz, Jun 13 2025

A384868 a(n) = Sum_{i=1...|b|} i*(-1)^b_i where b is the lexicographically n-th binary string.

Original entry on oeis.org

0, 1, -1, 3, -1, 1, -3, 6, 0, 2, -4, 4, -2, 0, -6, 10, 2, 4, -4, 6, -2, 0, -8, 8, 0, 2, -6, 4, -4, -2, -10, 15, 5, 7, -3, 9, -1, 1, -9, 11, 1, 3, -7, 5, -5, -3, -13, 13, 3, 5, -5, 7, -3, -1, -11, 9, -1, 1, -9, 3, -7, -5, -15, 21, 9, 11, -1, 13, 1, 3, -9, 15, 3, 5, -7, 7, -5, -3, -15, 17
Offset: 0

Views

Author

Christopher Purcell, Jun 11 2025

Keywords

Comments

The first binary string is the empty string and is indexed n=0.

Examples

			The lexicographically 8th binary string is 001; therefore, a(8) = 1 + 2 - 3 = 0.
Sequence can be written as triangle T(n,k) with row lengths 2^n:
   0;
   1, -1;
   3, -1, 1, -3;
   6,  0, 2, -4, 4, -2, 0, -6;
  10,  2, 4, -4, 6, -2, 0, -8, 8, 0, 2, -6, 4, -4, -2, -10;
  ...
		

Crossrefs

Programs

  • PARI
    a(n) = my(b=[d|d<-binary(n+1)[^1]]); sum(i=1, #b, i*(-1)^b[i]); \\ Michel Marcus, Jun 11 2025
    
  • Python
    from math import comb
    def A384868(n): return comb(len(s:=bin(n+1)[3:])+1,2)-(sum(i for i,j in enumerate(s,1) if j=='1')<<1) # Chai Wah Wu, Jun 13 2025
    
  • Python
    def a384868(n): return sum(i if b == '0' else -i for i, b in enumerate(bin(n + 1)[3:], 1)) # David Radcliffe, Jun 15 2025

Formula

From Alois P. Heinz, Jun 13 2025: (Start)
a(A000225(n)) = A000217(n).
a(2*(2^n-1)) = (-1)*A000217(n).
Sum_{i=0..2^n-1} a(i+2^n-1) = 0.
Sum_{i=0..2^n-1} i*a(i+2^n-1) = (-1)*A100575(n+1).
Sum_{i=0..2^n-1} abs(a(i+2^n-1)) = 2*A377170(n). (End)

A373202 Product over all sums of {n, +/-(n-1), +/-(n-2), ..., +/-1}, where "+/-" means here we use all possible combination of signs, this means for n > 0 that we have 2^(n-1) factors.

Original entry on oeis.org

1, 1, 3, 0, 0, -28733079375, -821329806742140930609375, 0, 0
Offset: 0

Views

Author

Thomas Scheuerle, May 28 2024

Keywords

Comments

a(9) is roughly 10^250.72 and is too big for the data section.
Consider the polynomial recurrence: P_{n}(x) = P_{n-1}(x + n)*P_{n-1}(x - n), with P_{1}(x) = 1 + x and P_{0}(x) = 1, then |a(n)| = P_{n}(0).
Each nonzero term divides all nonzero terms with higher index. This can be understood by looking at the tree structure in A365968 as the factors of a(n) are obtained in row n (second half of row). Each factor is only dependent by inheritance from parent and grandparent in this tree. Each row contains either all even numbers from 0 to A000217(n) or all odd numbers from 0 to A000217(n). In the even case 0 will be a factor and thus a(n) = 0. In the odd case some factors are duplicates, but by inheritance we will keep the duplicates from parent rows included.

Examples

			a(4) = (4+3+2+1)*(4+3+2-1)*(4+3-2+1)*(4+3-2-1)*(4-3+2+1)*(4-3+2-1)*(4-3-2+1)*(4-3-2-1) = 10*8*6*4*4*2*0*(-2) = 0.
		

Crossrefs

Cf. A365968 (row n gives factors of a(n)).
Cf. A001787 (result if we would use summation only).

Programs

  • Mathematica
    a[n_]:=Product[Sum[(n+1-m)(2*Part[IntegerDigits[2^(n-1)+k,2],m]-1),{m,n}],{k,0,2^(n-1)-1}]; Array[a,10,0] (* Stefano Spezia, May 29 2024 *)
  • PARI
    a(n) = prod(k=0, 2^(n-1)-1, sum(m=1, n, (n+1-m)*(-1+2*(digits(2^(n-1)+k, 2)[m]))))
Showing 1-4 of 4 results.