login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A055259 Sums of two powers of 8. 5

%I #18 Feb 09 2021 19:39:40

%S 2,9,16,65,72,128,513,520,576,1024,4097,4104,4160,4608,8192,32769,

%T 32776,32832,33280,36864,65536,262145,262152,262208,262656,266240,

%U 294912,524288,2097153,2097160,2097216,2097664,2101248,2129920,2359296,4194304,16777217

%N Sums of two powers of 8.

%H T. D. Noe, <a href="/A055259/b055259.txt">Rows n = 0..100 of triangle, flattened</a>

%F a(n) = 8^(n-trinv(n))+8^trinv(n), where trinv(n) = floor((1+sqrt(1+8*n))/2) = A002262(n) and n-trinv(n) = A003056(n)

%F Regarded as a triangle T(n, k) = 8^n + 8^k, so as a sequence a(n) = 8^A002262(n) + 8^A003056(n).

%t Union[Total/@Tuples[8^Range[0,10], {2}]] (* _Harvey P. Dale_, Mar 13 2011 *)

%o (Python)

%o def valuation(n, b):

%o v = 0

%o while n > 1: n //= b; v += 1

%o return v

%o def aupto(lim):

%o pows8 = [8**i for i in range(valuation(lim-1, 8) + 1)]

%o sum_pows8 = sorted([a+b for i, a in enumerate(pows8) for b in pows8[i:]])

%o return [s for s in sum_pows8 if s <= lim]

%o print(aupto(16777217)) # _Michael S. Branicky_, Feb 09 2021

%Y Cf. A052216.

%K easy,nonn,tabl

%O 0,1

%A _Henry Bottomley_, Jun 22 2000

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 11:35 EDT 2024. Contains 371968 sequences. (Running on oeis4.)