OFFSET
1,3
COMMENTS
In this sequence, the number 4 exhibits some characteristics of a prime number since all extraneous 2's have been removed from the prime factorizations of all other numbers.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = (n*4^(v_4(n)))/(2^(v_2(n))) where v_k(n) is the k-adic valuation of n. That is, v_k(n) is the largest power of k, a, such that k^a divides n.
For n odd, a(n)=n since n has no factors of 2 (or 4).
From Peter Munn, Nov 29 2020: (Start)
a(A003159(n)) = n.
a(A036554(n)) = n/2.
(End)
Multiplicative with a(2^e) = 2^(2*floor(e/2)), and a(p^e) = p^e for odd primes p. - Amiram Eldar, Dec 09 2020
Sum_{k=1..n} a(k) ~ (5/12) * n^2. - Amiram Eldar, Nov 10 2022
Dirichlet g.f.: zeta(s-1)*(2^s+1)/(2^s+2). - Amiram Eldar, Dec 30 2022
EXAMPLE
For n=8, v_4(8)=1, v_2(8)=3, so a(8)=(8*4^1)/(2^3)=4.
For n=12, v_4(12)=1, v_2(12)=2, so a(12)=(12*4^1)/(2^2)=12.
MATHEMATICA
a[n_] := n/(2^Mod[IntegerExponent[n, 2], 2]); Array[a, 100] (* Amiram Eldar, Dec 09 2020 *)
PROG
(Sage)
C = []
for i in [1..n]:
C.append(i*(4^(Integer(i).valuation(4))/(2^(Integer(i).valuation(2)))
(PARI) a(n)=n>>(valuation(n, 2)%2) \\ Charles R Greathouse IV, Jul 26 2012
(Python)
def A214682(n): return n>>1 if (~n&n-1).bit_length()&1 else n # Chai Wah Wu, Jan 09 2023
CROSSREFS
KEYWORD
easy,nonn,mult
AUTHOR
Tyler Ball, Jul 25 2012
STATUS
approved