A035312 Zorach additive triangle, read by rows.
1, 2, 3, 4, 6, 9, 7, 11, 17, 26, 5, 12, 23, 40, 66, 8, 13, 25, 48, 88, 154, 10, 18, 31, 56, 104, 192, 346, 14, 24, 42, 73, 129, 233, 425, 771, 15, 29, 53, 95, 168, 297, 530, 955, 1726, 19, 34, 63, 116, 211, 379, 676, 1206, 2161, 3887, 16, 35, 69, 132, 248, 459, 838
Offset: 0
Examples
Triangle begins: 1; 2, 3; 4, 6, 9; 7, 11, 17, 26; 5, 12, 23, 40, 66; 8, 13, 25, 48, 88, 154; E.g., 1 is the first number, 2 is the next, then add 1+2 to get 3, then 4 is next, then 4+2=6, 6+3=9, then 5 is not next because 5+4=9 and 9 was already used, so 7 is next...
Links
- Reinhard Zumkeller, Rows n=0..150 of triangle, flattened
- E. Angelini, Three triangles, SeqFan list, May 8, 2013
- Chris Zheng, Jeffrey Zheng, Triangular Numbers and Their Inherent Properties, Variant Construction from Theoretical Foundation to Applications, Springer, Singapore, 51-65.
- A. C. Zorach, Additive triangle
- Reinhard Zumkeller, Haskell programs for sequences in connection with Zorach additive triangle
- Index entries for sequences that are permutations of the natural numbers
Crossrefs
Programs
-
Mathematica
(* Assuming n <= t(n,1) <= 3n *) rows = 11; uniqueQ[t1_, n_] := (t[n, 1] = t1; Do[t[n, k] = t[n, k-1] + t[n-1, k-1], {k, 2, n}]; n*(n+1)/2 == Length[ Union[ Flatten[ Table[ t[m, k], {m, 1, n}, {k, 1, m}]]]]); t[n_ , 1] := t[n, 1] = Select[ Complement[ Range[n, 3n], Flatten[ Table[ t[m, k], {m, 1, n-1}, {k, 1, m}]]], uniqueQ[#, n]& , 1][[1]]; Flatten[ Table[ t[n, k], {n, 1, rows}, {k, 1, n}]] (* Jean-François Alcover, Dec 02 2011 *)
-
PARI
{u=a=[l=1]; for(n=1,20,print(a); a[1]==l && while(setsearch(u,l++),); s=l; while(setintersect(u,t=vector(1+n,i,if(i<2,t=s,t+=a[i-1]))),s++); u=setunion(u,a=t))} \\ M. F. Hasler, May 09 2013
Comments