OFFSET
0,1
LINKS
T. D. Noe, Rows n = 0..100 of triangle, flattened
FORMULA
a(n+1) = 3^(n-trinv(n)*(trinv(n)+1)/2)+3^trinv(n), where trinv(n) = floor((sqrt(1+8*n)-1)/2) = A003056(n) and n-trinv(n)*(trinv(n)+1)/2 = A002262(n). [corrected by M. F. Hasler, Oct 08 2011]
Regarded as a triangle, T(n, k) = 3^n + 3^k, because 3^n + 3^n < 3^(n+1) + 3^0 for all n > 0.
MATHEMATICA
mx = 10; Sort[Flatten[Table[3^x + 3^y, {y, 0, mx}, {x, 0, y}]]] (* Vladimir Joseph Stephan Orlovsky, Apr 20 2011 *)
f[n_] := Block[{t = Floor[(Sqrt[1 + 8 (n - 1)] - 1)/2]}, 3^(n - 1 - t*(t + 1)/2) + 3^t]; Array[f, 49] (* Robert G. Wilson v, Oct 08 2011 *)
PROG
(PARI) for( n=0, 5, for(k=0, n, print1(3^n+3^k", ")))
(PARI) A055235(n)={ my( t=(sqrtint(8*n-7)-1)\2); 3^t+3^(n-1-t*(t+1)/2) } \\ M. F. Hasler, Oct 08 2011
CROSSREFS
KEYWORD
AUTHOR
Henry Bottomley, Jun 22 2000
STATUS
approved