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 A244415 #29 Jul 09 2023 20:05:43 %S A244415 0,1,0,1,0,1,0,2,0,1,0,1,0,1,0,2,0,1,0,1,0,1,0,2,0,1,0,1,0,1,0,3,0,1, %T A244415 0,1,0,1,0,2,0,1,0,1,0,1,0,2,0,1,0,1,0,1,0,2,0,1,0,1,0,1,0,3,0,1,0,1, %U A244415 0,1,0,2,0,1,0,1,0,1,0,2,0,1,0,1,0,1,0,2,0,1,0,1,0,1,0,3,0,1,0,1 %N A244415 Exponent of 4 appearing in the 4-adic value of 1/n, n >= 1, given in A240226(n). %C A244415 See the comment under A240226 for g-adic value of x and the Mahler reference, p. 7, where this exponent is called f. %C A244415 Note that the exponent used in the g-adic value of 1/n is also called g-adic valuation of n if g is prime. See e.g., A007814 (g=2) and A007949 (g=3) and the corresponding A006519 and A038500 for the 2-adic and 3-adic value of 1/n, respectively. %D A244415 Kurt Mahler, p-adic numbers and their functions, second ed., Cambridge University Press, 1981. %H A244415 Antti Karttunen, <a href="/A244415/b244415.txt">Table of n, a(n) for n = 1..65537</a> %F A244415 a(n) = 0 if n is odd, and if n is even a(n) = f(1/n) with f(1/n) the smallest positive integer such that the highest power of 2 in n (that is A006519(n)) divides 4^f(1/n). %F A244415 a(n) = valuation(2*n, 4). - _Andrew Howroyd_, Jul 31 2018 %F A244415 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2/3. - _Amiram Eldar_, Jun 30 2023 %e A244415 n = 2: A006519(2) = 1, 2 divides 4^1, hence f(1/2) = 1 = a(2). %e A244415 n = 4: A006519(4) = 2^2, 4 divides 4^1, hence f(1/4) = 1 = a(4). %e A244415 n = 8: A006519(8) = 2^3, 8 does not divide 4^1 but 4^2, hence f(1/8) = 2 = a(8). %t A244415 Array[IntegerExponent[2 #, 4] &, 105] (* _Michael De Vlieger_, Nov 06 2018 *) %o A244415 (PARI) a(n) = valuation(2*n, 4); \\ _Andrew Howroyd_, Jul 31 2018 %o A244415 (Python) %o A244415 def A244415(n): return (~n&n-1).bit_length()+1>>1 # _Chai Wah Wu_, Jul 09 2023 %Y A244415 Cf. A240226, A007814 (case g=2), A007949 (case g=3). %K A244415 nonn,easy %O A244415 1,8 %A A244415 _Wolfdieter Lang_, Jun 28 2014