A085240 As exponents > 0 in powers of 2 or 3 (A006899) occur in A085238 exactly twice, a self-inverse permutation of natural numbers is induced.
2, 1, 5, 7, 3, 10, 4, 12, 15, 6, 18, 8, 20, 23, 9, 25, 28, 11, 31, 13, 33, 36, 14, 38, 16, 41, 43, 17, 46, 49, 19, 51, 21, 54, 56, 22, 59, 24, 62, 64, 26, 67, 27, 69, 72, 29, 74, 77, 30, 80, 32, 82, 85, 34, 87, 35, 90, 93, 37, 95, 98, 39, 100, 40, 103, 105, 42, 108
Offset: 1
Keywords
Links
Programs
-
Mathematica
seq[lim_] := Module[{r2 = Range[0, Floor[Log2[lim]]], r3 = Range[0, Floor[Log[3, lim]]], s, m, v, ind, j}, s = Rest@Rest@ SortBy[Join[{#, 2^#} & /@ r2, {#, 3^#} & /@ r3], Last][[;; , 1]]; ind = Flatten /@ (Position[s, #] & /@ Range[Max[s]]); m = Max[Flatten[ind]]; v = Table[0, {m}]; Do[If[Length[i] == 2, v[[i[[1]]]] = i[[2]]; v[[i[[2]]]] = i[[1]]], {i, ind}]; TakeWhile[v, # > 0 &]]; seq[10^25] (* Amiram Eldar, Mar 25 2025 *)
Formula
a(a(n)) = n.
Comments