login
A306392
a(n) = 2^n with 1's and 2's swapped.
2
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,1
LINKS
FORMULA
a(n) = A035043(A000079(n)). - Robert Israel, Feb 12 2019
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
PROG
(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
CROSSREFS
Cf. A000079, A035043, A323948 (sorted version).
Sequence in context: A303632 A133267 A145864 * A182739 A359132 A076014
KEYWORD
nonn,base
AUTHOR
Paul Curtz and N. J. A. Sloane, Feb 12 2019
STATUS
approved