login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A055235 Sums of two powers of 3. 5
2, 4, 6, 10, 12, 18, 28, 30, 36, 54, 82, 84, 90, 108, 162, 244, 246, 252, 270, 324, 486, 730, 732, 738, 756, 810, 972, 1458, 2188, 2190, 2196, 2214, 2268, 2430, 2916, 4374, 6562, 6564, 6570, 6588, 6642, 6804, 7290, 8748, 13122, 19684, 19686, 19692, 19710 (list; table; graph; refs; listen; history; internal format)
OFFSET

1,1

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)

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.

EXAMPLE

a(1) = 3^0+3^0, a(2) = 3^1+3^0, a(3) = 3^1+3^1,

a(4) = 3^2+3^0, a(5) = 3^2+3^1 = 12.

MATHEMATICA

mx = 10; Sort[Flatten[Table[3^x + 3^y, {y, 0, mx}, {x, 0, y}]]] (* From 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 8 2011 *)

PROG

(PARI) for( n=0, 5, for(k=0, n, print1(3^n+3^k", ")))

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

Cf. A052216.

Sequence in context: A045958 A076067 A065385 * A083887 A064374 A000885

Adjacent sequences:  A055232 A055233 A055234 * A055236 A055237 A055238

KEYWORD

easy,nonn,tabl

AUTHOR

Henry Bottomley (se16(AT)btinternet.com), Jun 22 2000

EXTENSIONS

Formula corrected by M. F. Hasler (maximilian.hasler(AT)gmail.com), Oct 08 2011

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 15 16:56 EST 2012. Contains 205825 sequences.