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-1 of 1 results.

A306392 a(n) = 2^n with 1's and 2's swapped.

Original entry on oeis.org

2, 1, 4, 8, 26, 31, 64, 218, 156, 521, 2014, 1048, 4096, 8291, 26384, 31768, 65536, 232071, 161244, 514188, 2048576, 1097251, 4294304, 8388608, 26777126, 33554431, 67208864, 234127718, 168435456, 536870921, 2073742814, 1247483648, 4194967196
Offset: 0

Views

Author

Paul Curtz and N. J. A. Sloane, Feb 12 2019

Keywords

Crossrefs

Cf. A000079, A035043, A323948 (sorted version).

Programs

  • Maple
    f:= proc(n) local L,i;
      L:= subs([2=1,1=2],convert(2^n,base,10));
      add(L[i]*10^(i-1),i=1..nops(L))
    end proc:
    map(f, [$0..50]); # Robert Israel, Feb 12 2019
  • Python
    def A306392(n):
        return int(''.join('1' if d == '2' else ('2' if d == '1' else d) for d in str(2**n))) # Chai Wah Wu, Feb 12 2019

Formula

a(n) = A035043(A000079(n)). - Robert Israel, Feb 12 2019
Showing 1-1 of 1 results.