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.

A055261 Sums of two powers of 16.

Original entry on oeis.org

2, 17, 32, 257, 272, 512, 4097, 4112, 4352, 8192, 65537, 65552, 65792, 69632, 131072, 1048577, 1048592, 1048832, 1052672, 1114112, 2097152, 16777217, 16777232, 16777472, 16781312, 16842752, 17825792, 33554432, 268435457
Offset: 1

Views

Author

Henry Bottomley, Jun 22 2000

Keywords

Examples

			a(4) = 272 = 16^2+16^1.
		

Crossrefs

Cf. A052216.

Programs

  • Maple
    A055261:= proc(n)
         local p1, p2;
         p1:= floor((sqrt(8*n-7)-1)/2);
         p2:= n - 1 - p1*(p1+1)/2;
         16^p1 + 16^p2
    end proc; # Robert Israel, Apr 07 2014
  • Python
    from math import isqrt
    def A055261(n): return (1<<((a:=(k:=isqrt(m:=n<<1))+(m>k*(k+1))-1)<<2))+(1<<(n-1-(a*(a+1)>>1)<<2)) # Chai Wah Wu, Apr 08 2025

Formula

a(n) = 16^(n-trinv(n))+16^trinv(n), where trinv(n) = floor((1+sqrt(1+8*n))/2) = A002262(n) and n-trinv(n) = A003056(n).
Regarded as a triangle T(n, k)=16^n+16^k, so as a sequence a(n) =16^A002262(n)+16^A003056(n).