OFFSET
1,2
COMMENTS
For the definition of g-adic value of x, called |x|_g with g an integer >= 2, see the Mahler reference, p. 7. Sometimes also called g-adic absolute value of x. If g is not a prime then this is called a non-archimedean pseudo-valuation. See Mahler, p. 10.
REFERENCES
Kurt Mahler, p-adic numbers and their functions, second ed., Cambridge University Press, 1981.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16383
FORMULA
a(n) = 1 if n is odd. a(n) = 4^f(1/n) if n is even, where f(1/n) is the smallest positive integer such that the highest power of 2 in n (that is A006519(n)) divides 4^f(1/n). The f(1/n) values are given in A244415(n).
From Andrew Howroyd, Jul 31 2018: (Start)
a(n) = 4^valuation(2*n, 4) = 4^A244415(n).
Multiplicative with a(2^e) = 4^ceiling(e/2), a(p^e) = 1 for odd prime p. (End)
From Amiram Eldar, Oct 24 2023: (Start)
Dirichlet g.f.: zeta(s)*(2^s-1)*(2^s+4)/(4^s-4).
Sum_{k=1..n} a(k) ~ (3/(4*log(2))) * n * (log(n) + gamma + 4*log(2)/3 - 1), where gamma is Euler's constant (A001620). (End)
EXAMPLE
MATHEMATICA
Array[4^IntegerExponent[2 #, 4] &, 90] (* Michael De Vlieger, Nov 06 2018 *)
PROG
(PARI) a(n) = 4^ceil(valuation(n, 2)/2); \\ Andrew Howroyd, Jul 31 2018
(Python)
def A240226(n): return 1<<((~n&n-1).bit_length()+1&-2) # Chai Wah Wu, Jul 09 2023
CROSSREFS
KEYWORD
nonn,easy,mult
AUTHOR
Wolfdieter Lang, Jun 28 2014
STATUS
approved