This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A085240 #13 Mar 25 2025 20:08:25 %S A085240 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, %T A085240 43,17,46,49,19,51,21,54,56,22,59,24,62,64,26,67,27,69,72,29,74,77,30, %U A085240 80,32,82,85,34,87,35,90,93,37,95,98,39,100,40,103,105,42,108 %N 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. %H A085240 Amiram Eldar, <a href="/A085240/b085240.txt">Table of n, a(n) for n = 1..10000</a> %H A085240 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>. %F A085240 A085238(n+1) = A085238(a(n)+1). [corrected by _Amiram Eldar_, Mar 25 2025] %F A085240 a(a(n)) = n. %t A085240 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 *) %Y A085240 Cf. A006899, A085238. %K A085240 nonn %O A085240 1,1 %A A085240 _Reinhard Zumkeller_, Jun 22 2003