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.

A384688 Runs of t in the range 0 <= t <= k and the same parity as k, for successive k >= 0.

This page as a plain text file.
%I A384688 #14 Jul 09 2025 19:28:17
%S A384688 0,1,0,2,1,3,0,2,4,1,3,5,0,2,4,6,1,3,5,7,0,2,4,6,8,1,3,5,7,9,0,2,4,6,
%T A384688 8,10,1,3,5,7,9,11,0,2,4,6,8,10,12,1,3,5,7,9,11,13,0,2,4,6,8,10,12,14,
%U A384688 1,3,5,7,9,11,13,15,0,2,4,6,8,10,12,14,16
%N A384688 Runs of t in the range 0 <= t <= k and the same parity as k, for successive k >= 0.
%C A384688 The corresponding k is A055086(n), or k+1 = A000267(n).
%C A384688 A run is 0, 2, 4, ..., k when k even, or 1, 3, 5, ..., k when k odd, and has length floor(k/2) + 1.
%C A384688 Runs start at quarter squares n = A002620(k+1), with those beginning 0 at oblong numbers n = A002378(i) and those starting 1 at the squares n = (i+1)^2 (for i >= 0 in both cases).
%C A384688 Starts to differ from A025643 at n=109.
%H A384688 Vincenzo Librandi, <a href="/A384688/b384688.txt">Table of n, a(n) for n = 0..5001</a>
%F A384688 a(n) = 2*r+1 if r < s or a(n) = 2*(r-s) otherwise, where square root and remainder n = s^2 + r being  s=A000196(n), r=A053186(n).
%F A384688 a(n) = ceiling(A053186(4*n+1) / 2).
%F A384688 a(n) = A055086(n) - 2*A216607(n+1).
%F A384688 a(n) = 2*A055087(n) + A079813(n+1).
%e A384688 Runs and their corresponding k = A055086(n) begin,
%e A384688   n          = 0  1  2    4    6      9
%e A384688   a(n)       = 0, 1, 0,2, 1,3, 0,2,4, 1,3,5, ...
%e A384688   A055086(n) = 0, 1, 2,2, 3,3, 4,4,4, 5,5,5, ...
%t A384688 ClearAll[a] a[n_Integer]:=Module[{s,r},s=Floor[Sqrt[n]]; r=n-s^2; If[r<s,2*r+1,2*(r-s)]] Table[a[n],{n,0,100}] (* _Vincenzo Librandi_, Jul 06 2025 *)
%o A384688 (PARI) a(n) = my(r,s=sqrtint(n,&r)); if(r<s, r<<1+1, (r-s)<<1);
%Y A384688 Cf. A000196, A000267, A053186, A055086, A055087, A079813, A216607.
%Y A384688 Cf. A002620, A002378 (indices of 0's), A000290 (indices of 1's).
%K A384688 nonn,easy
%O A384688 0,4
%A A384688 _Kevin Ryde_, Jun 07 2025