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 A118827 #24 Oct 28 2023 04:04:39 %S A118827 1,-2,1,-4,1,-2,1,-8,1,-2,1,-4,1,-2,1,-16,1,-2,1,-4,1,-2,1,-8,1,-2,1, %T A118827 -4,1,-2,1,-32,1,-2,1,-4,1,-2,1,-8,1,-2,1,-4,1,-2,1,-16,1,-2,1,-4,1, %U A118827 -2,1,-8,1,-2,1,-4,1,-2,1,-64,1,-2,1,-4,1,-2,1,-8,1,-2,1,-4,1,-2,1,-16,1,-2,1,-4,1,-2,1,-8,1,-2,1,-4,1,-2,1,-32,1,-2,1 %N A118827 2-adic continued fraction of zero, where a(n) = 1 if n is odd, otherwise -2*A006519(n/2). %C A118827 Limit of convergents equals zero; only the 6th convergent is indeterminate. Other 2-adic continued fractions of zero are: A118821, A118824, A118830. A006519(n) is the highest power of 2 dividing n; A080277 = partial sums of A038712, where A038712(n) = 2*A006519(n) - 1. %C A118827 Multiplicative because both A006519 and A165326 are. - _Andrew Howroyd_, Aug 01 2018 %H A118827 Antti Karttunen, <a href="/A118827/b118827.txt">Table of n, a(n) for n = 1..65537</a> %F A118827 a(n) = A165326(n) * A006519(n). - _Andrew Howroyd_, Aug 01 2018 %F A118827 From _Amiram Eldar_, Oct 28 2023: (Start) %F A118827 Multiplicative with a(2^e) = -2^e, and a(p^e) = 1 for an odd prime p. %F A118827 Dirichlet g.f.: zeta(s) * (1 - 2^(1-s) + 1/(2-2^s)). %F A118827 Sum_{k=1..n} a(k) ~ (-1/(2*log(2))) * n *(log(n) + gamma - log(2)/2 - 1), where gamma is Euler's constant (A001620). (End) %e A118827 For n >= 1, convergents A118828(k)/A118829(k): %e A118827 at k = 4*n: -1/(2*A080277(n)); %e A118827 at k = 4*n+1: -1/(2*A080277(n)-1); %e A118827 at k = 4*n+2: -1/(2*A080277(n)-2); %e A118827 at k = 4*n-1: 0. %e A118827 Convergents begin: %e A118827 1/1, -1/-2, 0/-1, -1/2, -1/1, 1/0, 0/1, 1/-8, %e A118827 1/-7, -1/6, 0/-1, -1/10, -1/9, 1/-8, 0/1, 1/-24, %e A118827 1/-23, -1/22, 0/-1, -1/26, -1/25, 1/-24, 0/1, 1/-32, %e A118827 1/-31, -1/30, 0/-1, -1/34, -1/33, 1/-32, 0/1, 1/-64, ... %t A118827 Array[If[OddQ@ #, 1, -2*2^(IntegerExponent[#, 2] - 1)] &, 99] (* _Michael De Vlieger_, Nov 06 2018 *) %o A118827 (PARI) a(n)=local(p=+1,q=-2);if(n%2==1,p,q*2^valuation(n/2,2)) %Y A118827 Cf. A001620, A006519, A080277; convergents: A118828/A118829; variants: A118821, A118824, A118830; A100338, A165326. %K A118827 cofr,sign,mult %O A118827 1,2 %A A118827 _Paul D. Hanna_, May 01 2006