cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A055259 Sums of two powers of 8.

This page as a plain text file.
%I A055259 #22 Apr 08 2025 13:21:06
%S A055259 2,9,16,65,72,128,513,520,576,1024,4097,4104,4160,4608,8192,32769,
%T A055259 32776,32832,33280,36864,65536,262145,262152,262208,262656,266240,
%U A055259 294912,524288,2097153,2097160,2097216,2097664,2101248,2129920,2359296,4194304,16777217
%N A055259 Sums of two powers of 8.
%H A055259 T. D. Noe, <a href="/A055259/b055259.txt">Rows n = 0..100 of triangle, flattened</a>
%F A055259 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 A055259 Regarded as a triangle T(n, k) = 8^n + 8^k, so as a sequence a(n) = 8^A002262(n) + 8^A003056(n).
%t A055259 Union[Total/@Tuples[8^Range[0,10], {2}]]  (* _Harvey P. Dale_, Mar 13 2011 *)
%o A055259 (Python)
%o A055259 def valuation(n, b):
%o A055259   v = 0
%o A055259   while n > 1: n //= b; v += 1
%o A055259   return v
%o A055259 def aupto(lim):
%o A055259   pows8 = [8**i for i in range(valuation(lim-1, 8) + 1)]
%o A055259   sum_pows8 = sorted([a+b for i, a in enumerate(pows8) for b in pows8[i:]])
%o A055259   return [s for s in sum_pows8 if s <= lim]
%o A055259 print(aupto(16777217)) # _Michael S. Branicky_, Feb 09 2021
%o A055259 (Python)
%o A055259 from math import isqrt
%o A055259 def A055259(n): return (1<<3*(a:=(k:=isqrt(m:=n<<1))+(m>k*(k+1))-1))+(1<<3*(n-1-(a*(a+1)>>1))) # _Chai Wah Wu_, Apr 08 2025
%Y A055259 Cf. A052216.
%K A055259 easy,nonn,tabl
%O A055259 0,1
%A A055259 _Henry Bottomley_, Jun 22 2000