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 A118824 #13 Nov 09 2018 21:57:57 %S A118824 -2,1,-2,2,-2,1,-2,4,-2,1,-2,2,-2,1,-2,8,-2,1,-2,2,-2,1,-2,4,-2,1,-2, %T A118824 2,-2,1,-2,16,-2,1,-2,2,-2,1,-2,4,-2,1,-2,2,-2,1,-2,8,-2,1,-2,2,-2,1, %U A118824 -2,4,-2,1,-2,2,-2,1,-2,32,-2,1,-2,2,-2,1,-2,4,-2,1,-2,2,-2,1,-2,8,-2,1,-2,2,-2,1,-2,4,-2,1,-2,2,-2,1,-2,16,-2,1,-2,2,-2,1 %N A118824 2-adic continued fraction of zero, where a(n) = -2 if n is odd, A006519(n/2) otherwise. %C A118824 Limit of convergents equals zero; only the 6th convergent is indeterminate. Other 2-adic continued fractions of zero are: A118821, A118827, A118830. A006519(n) is the highest power of 2 dividing n; A080277 = partial sums of A038712, where A038712(n) = 2*A006519(n) - 1. %H A118824 Antti Karttunen, <a href="/A118824/b118824.txt">Table of n, a(n) for n = 1..65537</a> %e A118824 For n >= 1, convergents A118825(k)/A118826(k): %e A118824 at k = 4*n: 1/A080277(n); %e A118824 at k = 4*n+1: 2/(2*A080277(n)-1); %e A118824 at k = 4*n+2: 1/(A080277(n)-1); %e A118824 at k = 4*n-1: 0. %e A118824 Convergents begin: %e A118824 -2/1, -1/1, 0/-1, -1/-1, 2/1, 1/0, 0/1, 1/4, %e A118824 -2/-7, -1/-3, 0/-1, -1/-5, 2/9, 1/4, 0/1, 1/12, %e A118824 -2/-23, -1/-11, 0/-1, -1/-13, 2/25, 1/12, 0/1, 1/16, %e A118824 -2/-31, -1/-15, 0/-1, -1/-17, 2/33, 1/16, 0/1, 1/32, ... %t A118824 Array[If[OddQ@ #, -2, 2^(IntegerExponent[#, 2] - 1)] &, 102] (* _Michael De Vlieger_, Nov 06 2018 *) %o A118824 (PARI) a(n)=local(p=-2,q=+1);if(n%2==1,p,q*2^valuation(n/2,2)) %Y A118824 Cf. A006519, A080277; convergents: A118825/A118826; variants: A118821, A118827, A118830; A100338. %K A118824 cofr,sign %O A118824 1,1 %A A118824 _Paul D. Hanna_, May 01 2006