login
A357872
a(n) = n * (3/2)^(v(n, 2) - v(n, 3)) where v(n, k) = valuation(n, k) mod 2 for n > 0.
0
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, 18, 28, 29, 30, 31, 48, 22, 51, 35, 36, 37, 57, 26, 60, 41, 42, 43, 44, 45, 69, 47, 32, 49, 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
OFFSET
1,2
COMMENTS
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.
A self-inverse permutation of the natural numbers, i.e., a(a(n)) = n for all n.
Multiplicative but not completely multiplicative (see formula).
FORMULA
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.
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.
a(n) = n * (3/2)^(A096268(n-1) - A182581(n)) for n > 0.
Sum_{k=1..n} a(k) ~ (77/144) * n^2. - Amiram Eldar, Nov 29 2022
EXAMPLE
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.
MAPLE
p := (n, k) -> modp(padic[ordp](n, k), 2): a := n -> n*(3/2)^(p(n, 2) - p(n, 3)):
seq(a(n), n = 1..74); # Peter Luschny, Oct 20 2022
MATHEMATICA
a[n_] := (3/2)^Differences[Mod[IntegerExponent[n, {3, 2}], 2]][[1]] * n; Array[a, 100] (* Amiram Eldar, Oct 20 2022 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,easy,mult
AUTHOR
Werner Schulte, Oct 17 2022
STATUS
approved