A338086 Duplicate the ternary digits of n, so each 0, 1 or 2 becomes 00, 11 or 22 respectively.
0, 4, 8, 36, 40, 44, 72, 76, 80, 324, 328, 332, 360, 364, 368, 396, 400, 404, 648, 652, 656, 684, 688, 692, 720, 724, 728, 2916, 2920, 2924, 2952, 2956, 2960, 2988, 2992, 2996, 3240, 3244, 3248, 3276, 3280, 3284, 3312, 3316, 3320, 3564, 3568, 3572, 3600, 3604
Offset: 0
Examples
n=73 is ternary 2201 which duplicates to 22220011 ternary = 8804 base 9 = 6484 decimal.
Links
- Kevin Ryde, Table of n, a(n) for n = 0..6560
Crossrefs
Programs
-
PARI
a(n) = fromdigits(digits(n,3),9)<<2;
-
Python
from gmpy2 import digits def A338086(n): return int(''.join(d*2 for d in digits(n,3)),3) # Chai Wah Wu, May 07 2022
Comments