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 A357872 #30 Dec 10 2023 09:22:53 %S A357872 1,3,2,4,5,6,7,12,9,15,11,8,13,21,10,16,17,27,19,20,14,33,23,24,25,39, %T A357872 18,28,29,30,31,48,22,51,35,36,37,57,26,60,41,42,43,44,45,69,47,32,49, %U A357872 75,34,52,53,54,55,84,38,87,59,40,61,93,63,64,65,66,67,68,46,105,71,108,73,111 %N A357872 a(n) = n * (3/2)^(v(n, 2) - v(n, 3)) where v(n, k) = valuation(n, k) mod 2 for n > 0. %C A357872 Equivalently: If n = 2^x * 3^y * f with gcd(f, 2) * gcd(f, 3) = 1 and x, y >= 0 and f > 0, then: a(n) = 2^(x - x mod 2 + y mod 2) * 3^(y - y mod 2 + x mod 2) * f for n > 0. %C A357872 A self-inverse permutation of the natural numbers, i.e., a(a(n)) = n for all n. %C A357872 Multiplicative but not completely multiplicative (see formula). %F A357872 Multiplicative with a(p^e) = p^e if e is even or p > 3, a(2^e) = 3 * 2^(e-1) and a(3^e) = 2 * 3^(e-1) if e is odd. %F A357872 Let n = 2^(2*x+r) * 3^(2*y+s) * Product_{prime p > 3} p^z(p) with 0 <= r,s <= 1; then a(n) = 2^(2*x+s) * 3^(2*y+r) * Product_{prime p > 3} p^z(p); especially: a(n) = n * 2 / 3 if r < s, a(n) = n if r = s, and a(n) = n * 3 / 2 if r > s. %F A357872 a(n) = n * (3/2)^(A096268(n-1) - A182581(n)) for n > 0. %F A357872 Sum_{k=1..n} a(k) ~ (77/144) * n^2. - _Amiram Eldar_, Nov 29 2022 %e A357872 n = 40320 = 2^(2*3+1)*3^(2*1+0)*5*7, then a(n) = 2^(2*3+0)*3^(2*1+1)*5*7 = 60480. %p A357872 p := (n, k) -> modp(padic[ordp](n, k), 2): a := n -> n*(3/2)^(p(n, 2) - p(n, 3)): %p A357872 seq(a(n), n = 1..74); # _Peter Luschny_, Oct 20 2022 %t A357872 a[n_] := (3/2)^Differences[Mod[IntegerExponent[n, {3, 2}], 2]][[1]] * n; Array[a, 100] (* _Amiram Eldar_, Oct 20 2022 *) %o A357872 (PARI) a(n) = my(x=valuation(n,2), y=valuation(n,3), f=n/2^x/3^y, x2=x%2, y2 = y%2); 2^(x - x2 + y2) * 3^(y - y2 + x2) * f; \\ _Michel Marcus_, Oct 19 2022 %Y A357872 Cf. A064614, A007814, A007949, A096268, A182581. %K A357872 nonn,easy,mult %O A357872 1,2 %A A357872 _Werner Schulte_, Oct 17 2022