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.

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

This page as a plain text file.
%I A306392 #23 Feb 13 2019 08:40:41
%S A306392 2,1,4,8,26,31,64,218,156,521,2014,1048,4096,8291,26384,31768,65536,
%T A306392 232071,161244,514188,2048576,1097251,4294304,8388608,26777126,
%U A306392 33554431,67208864,234127718,168435456,536870921,2073742814,1247483648,4194967196
%N A306392 a(n) = 2^n with 1's and 2's swapped.
%H A306392 Robert Israel, <a href="/A306392/b306392.txt">Table of n, a(n) for n = 0..3318</a>
%F A306392 a(n) = A035043(A000079(n)). - _Robert Israel_, Feb 12 2019
%p A306392 f:= proc(n) local L,i;
%p A306392   L:= subs([2=1,1=2],convert(2^n,base,10));
%p A306392   add(L[i]*10^(i-1),i=1..nops(L))
%p A306392 end proc:
%p A306392 map(f, [$0..50]); # _Robert Israel_, Feb 12 2019
%o A306392 (Python)
%o A306392 def A306392(n):
%o A306392     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
%Y A306392 Cf. A000079, A035043, A323948 (sorted version).
%K A306392 nonn,base
%O A306392 0,1
%A A306392 _Paul Curtz_ and _N. J. A. Sloane_, Feb 12 2019