A238392 Triangle read by rows: each row is an initial segment of the terms of A000123 followed by its reflection.
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
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;
Links
- Indranil Ghosh, Rows 0..125, flattened
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
Comments