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.

Showing 1-3 of 3 results.

A038470 Sums of 2 distinct powers of 4.

Original entry on oeis.org

5, 17, 20, 65, 68, 80, 257, 260, 272, 320, 1025, 1028, 1040, 1088, 1280, 4097, 4100, 4112, 4160, 4352, 5120, 16385, 16388, 16400, 16448, 16640, 17408, 20480, 65537, 65540, 65552, 65600, 65792, 66560, 69632, 81920, 262145, 262148, 262160, 262208, 262400, 263168
Offset: 1

Views

Author

Keywords

Crossrefs

Base-4 interpretation of A038444.

Programs

  • Mathematica
    Sort[Plus @@@ Subsets[4^Range[0, 9], {2}]] (* Amiram Eldar, Jul 13 2022 *)
  • Python
    def aupto(limit):
      p = [4**i for i in range(limit//4+1) if 4**i < limit]
      p2 = set(a+b for i, a in enumerate(p) for b in p[i+1:] if a+b <= limit)
      return sorted(p2)
    print(aupto(265000)) # Michael S. Branicky, May 17 2021
    
  • Python
    from math import isqrt
    def A038470(n): return (1<<(m:=isqrt(n<<3)+1&-2))+(1<<(n-1<<1)-((k:=m>>1)*(k-1))) # Chai Wah Wu, Apr 05 2025

Extensions

Offset corrected by Amiram Eldar, Jul 13 2022

A038471 Sums of 3 distinct powers of 4.

Original entry on oeis.org

21, 69, 81, 84, 261, 273, 276, 321, 324, 336, 1029, 1041, 1044, 1089, 1092, 1104, 1281, 1284, 1296, 1344, 4101, 4113, 4116, 4161, 4164, 4176, 4353, 4356, 4368, 4416, 5121, 5124, 5136, 5184, 5376, 16389, 16401, 16404, 16449, 16452, 16464, 16641, 16644, 16656, 16704
Offset: 1

Views

Author

Keywords

Crossrefs

Base 4 interpretation of A038445.

Programs

  • Mathematica
    Union[Total/@Subsets[4^Range[0,10],{3}]] (* Harvey P. Dale, Oct 20 2012 *)
  • Python
    from math import isqrt, comb
    from sympy import integer_nthroot
    def A038471(n): return (1<<((r:=n-1-comb((m:=integer_nthroot(6*n,3)[0])+(t:=(n>comb(m+2,3)))+1,3))-comb((k:=isqrt(b:=r+1<<1))+(b>k*(k+1)),2)<<1))+(1<<((a:=isqrt(s:=n-comb(m-(t^1)+2,3)<<1))+((s<<2)>(a<<2)*(a+1)+1)<<1))+(1<<(m+t+1<<1)) # Chai Wah Wu, Apr 04 2025

Extensions

Offset corrected by Amiram Eldar, Jul 13 2022

A038473 Sums of 5 distinct powers of 4.

Original entry on oeis.org

341, 1109, 1301, 1349, 1361, 1364, 4181, 4373, 4421, 4433, 4436, 5141, 5189, 5201, 5204, 5381, 5393, 5396, 5441, 5444, 5456, 16469, 16661, 16709, 16721, 16724, 17429, 17477, 17489, 17492, 17669, 17681, 17684, 17729, 17732, 17744, 20501, 20549, 20561, 20564, 20741
Offset: 1

Views

Author

Keywords

Crossrefs

Base 4 interpretation of A038447.

Programs

  • Mathematica
    Take[Total/@Subsets[4^Range[0,10],{5}]//Union,50] (* Harvey P. Dale, Oct 02 2016 *)
  • Python
    from itertools import islice
    def A038473_gen(): # generator of terms
        yield int(bin(n:=31)[2:],4)
        while True: yield int(bin((n:=n^((a:=-n&n+1)|(a>>1)) if n&1 else ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b))[2:],4)
    A038473_list = list(islice(A038473_gen(),30)) # Chai Wah Wu, Apr 04 2025
Showing 1-3 of 3 results.