cp's OEIS Frontend

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.

A118825 Numerators of the convergents of the 2-adic continued fraction of zero given by A118824.

This page as a plain text file.
%I A118825 #38 Aug 04 2025 07:31:46
%S A118825 -2,-1,0,-1,2,1,0,1,-2,-1,0,-1,2,1,0,1,-2,-1,0,-1,2,1,0,1,-2,-1,0,-1,
%T A118825 2,1,0,1,-2,-1,0,-1,2,1,0,1,-2,-1,0,-1,2,1,0,1,-2,-1,0,-1,2,1,0,1,-2,
%U A118825 -1,0,-1,2,1,0,1,-2,-1,0,-1,2,1,0,1,-2,-1,0,-1,2,1
%N A118825 Numerators of the convergents of the 2-adic continued fraction of zero given by A118824.
%H A118825 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,-1).
%F A118825 Period 8 sequence: [ -2,-1,0,-1,2,1,0,1].
%F A118825 G.f.: -x*(1+x)*(x^2-x+2) / ( 1+x^4 ).
%F A118825 a(n) = sqrt((n+1)^2 mod 8)*(-1)^floor((n+3)/4). - _Wesley Ivan Hurt_, Jan 04 2014
%e A118825 For n>=1, convergents A118825(k)/A118826(k) are:
%e A118825   at k = 4*n: 1/A080277(n);
%e A118825   at k = 4*n+1: 2/(2*A080277(n)-1);
%e A118825   at k = 4*n+2: 1/(A080277(n)-1);
%e A118825   at k = 4*n-1: 0/(-1)^n.
%e A118825 Convergents begin:
%e A118825   -2/1, -1/1, 0/-1, -1/-1, 2/1, 1/0, 0/1, 1/4,
%e A118825   -2/-7, -1/-3, 0/-1, -1/-5, 2/9, 1/4, 0/1, 1/12,
%e A118825   -2/-23, -1/-11, 0/-1, -1/-13, 2/25, 1/12, 0/1, 1/16,
%e A118825   -2/-31, -1/-15, 0/-1, -1/-17, 2/33, 1/16, 0/1, 1/32, ...
%p A118825 A118825:=n->sqrt((n+1)^2 mod 8))*(-1)^floor((n+3)/4); seq(A118825(n), n=1..100); # _Wesley Ivan Hurt_, Jan 04 2014
%t A118825 Table[Sqrt[Mod[(n+1)^2, 8]](-1)^Floor[(n+3)/4], {n, 100}] (* _Wesley Ivan Hurt_, Jan 04 2014 *)
%t A118825 PadRight[{},120,{-2,-1,0,-1,2,1,0,1}] (* _Harvey P. Dale_, May 26 2020 *)
%o A118825 (PARI) {a(n)=local(p=-2,q=+1,v=vector(n,i,if(i%2==1,p,q*2^valuation(i/2,2)))); contfracpnqn(v)[1,1]}
%Y A118825 Cf. A118824 (partial quotients), A118826 (denominators), A118822, A230075 (start with a(5)).
%K A118825 frac,sign,easy
%O A118825 1,1
%A A118825 _Paul D. Hanna_, May 01 2006