A306392 a(n) = 2^n with 1's and 2's swapped.
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
Links
- Robert Israel, Table of n, a(n) for n = 0..3318
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