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.

A238392 Triangle read by rows: each row is an initial segment of the terms of A000123 followed by its reflection.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 4, 2, 1, 1, 2, 4, 4, 2, 1, 1, 2, 4, 6, 4, 2, 1, 1, 2, 4, 6, 6, 4, 2, 1, 1, 2, 4, 6, 10, 6, 4, 2, 1, 1, 2, 4, 6, 10, 10, 6, 4, 2, 1, 1, 2, 4, 6, 10, 14, 10, 6, 4, 2, 1, 1, 2, 4, 6, 10, 14, 14, 10, 6, 4, 2, 1, 1, 2, 4, 6, 10, 14, 20, 14, 10, 6, 4, 2, 1
Offset: 0

Views

Author

Philippe Deléham, Feb 26 2014

Keywords

Comments

Triangle read by rows: each row is an initial segment of the terms of A000123 followed by its reflection.

Examples

			Triangle begins:
  1;
  1, 1;
  1, 2, 1;
  1, 2, 2, 1;
  1, 2, 4, 2,  1;
  1, 2, 4, 4,  2,  1;
  1, 2, 4, 6,  4,  2,  1;
  1, 2, 4, 6,  6,  4,  2,  1;
  1, 2, 4, 6, 10,  6,  4,  2,  1;
  1, 2, 4, 6, 10, 10,  6,  4,  2,  1;
  1, 2, 4, 6, 10, 14, 10,  6,  4,  2, 1;
  1, 2, 4, 6, 10, 14, 14, 10,  6,  4, 2, 1;
  1, 2, 4, 6, 10, 14, 20, 14, 10,  6, 4, 2, 1;
  1, 2, 4, 6, 10, 14, 20, 20, 14, 10, 6, 4, 2, 1;
		

Crossrefs

Programs

  • Mathematica
    a[n_] := If[n==0,  1, a[n - 1] + a[Floor[n/2]]]; Flatten[Table[a[Min[k, n - k]], {n, 0, 13}, {k, 0, n}]] (* Indranil Ghosh, Mar 14 2017 *)
  • PARI
    a(n) = if(n==0, 1, a(n-1) + a(floor(n/2)));
    tabl(nn) = {for(n=0, nn, for(k=0, n, print1(a(min(k, n - k)),", ");); print(););};
    tabl(13); \\ Indranil Ghosh, Mar 14 2017
    
  • Python
    def a(n): return 1 if n==0 else a(n - 1) + a(n//2)
    i=0
    for n in range(0, 126):
        for k in range(0, n+1):
            print(str(i)+" "+str(a(min(k, n - k))))
            i+=1 # Indranil Ghosh, Mar 14 2017

Formula

T(n,k) = A000123(min(k,n-k)).
Sum_{k=0..n} T(n,k) = A000123(n).
T(2*n,n) = A000123(n).