OFFSET
1,3
COMMENTS
For powers of 2 instead of 3 we have A253317.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..256
FORMULA
a(3^n) = 2^(3^n - 1).
EXAMPLE
The terms together with their binary expansions and binary indices begin:
0: 0 ~ {}
1: 1 ~ {1}
4: 100 ~ {3}
5: 101 ~ {1,3}
256: 100000000 ~ {9}
257: 100000001 ~ {1,9}
260: 100000100 ~ {3,9}
261: 100000101 ~ {1,3,9}
67108864: 100000000000000000000000000 ~ {27}
67108865: 100000000000000000000000001 ~ {1,27}
67108868: 100000000000000000000000100 ~ {3,27}
67108869: 100000000000000000000000101 ~ {1,3,27}
67109120: 100000000000000000100000000 ~ {9,27}
67109121: 100000000000000000100000001 ~ {1,9,27}
67109124: 100000000000000000100000100 ~ {3,9,27}
67109125: 100000000000000000100000101 ~ {1,3,9,27}
MATHEMATICA
Select[Range[0, 10000], IntegerQ[Log[3, Times@@Join@@Position[Reverse[IntegerDigits[#, 2]], 1]]]&]
(* Second program *)
{0}~Join~Array[FromDigits[Reverse@ ReplacePart[ConstantArray[0, Max[#]], Map[# -> 1 &, #]], 2] &[3^(Position[Reverse@ IntegerDigits[#, 2], 1][[;; , 1]] - 1)] &, 255] (* Michael De Vlieger, Dec 29 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Dec 29 2023
STATUS
approved