A341709 Write n as a sum of powers of 2 then replace each power of 2 in the sum by its decimal reversal A004094(n).
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 46, 47, 48, 49, 50, 51, 52, 53, 54
Offset: 0
Examples
17 = 16+1 becomes 1+61 = 62 = a(17).
Links
- Chai Wah Wu, Table of n, a(n) for n = 0..10000
- N. J. A. Sloane, Exciting Number Sequences (video of talk), Mar 05 2021.
Programs
-
Maple
revbin:= n-> (s-> parse(cat(s[-i]$i=1..length(s))))(""||(2^n)): # A004094 f:=proc(n) local t1,i; t1:=convert(n,base,2); add(t1[i]*revbin(i-1),i=1..nops(t1)); end: seq(f(n), n=0..72);
-
Python
def A341709(n): m, c = 1, 0 while n > 0: n, b = divmod(n,2) c += b*int(str(m)[::-1]) m *= 2 return c # Chai Wah Wu, Feb 18 2021
Comments