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 A186221 #22 Oct 18 2024 21:42:57 %S A186221 2,3,5,7,8,10,12,14,15,17,19,20,22,24,25,27,29,31,32,34,36,37,39,41, %T A186221 43,44,46,48,49,51,53,54,56,58,60,61,63,65,66,68,70,72,73,75,77,78,80, %U A186221 82,84,85,87,89,90,92,94,95,97,99,101,102,104,106,107,109,111,113,114,116,118,119,121,123,124,126,128,130,131,133,135,136,138,140,142,143,145,147,148,150,152,153,155,157,159,160,162,164,165,167,169,171 %N A186221 Adjusted joint rank sequence of (f(i)) and (g(j)) with f(i) after g(j) when f(i)=g(j), where f and g are the triangular numbers and squares. Complement of A186222. %C A186221 See A186219. %H A186221 G. C. Greubel, <a href="/A186221/b186221.txt">Table of n, a(n) for n = 1..10000</a> %F A186221 a(n) = n + floor(sqrt((n^2+n)/2 + 1/4)). %F A186221 a(n) = A061288(n) - n for all n in Z. - _Michael Somos_, Aug 19 2018 %e A186221 First, write %e A186221 1..3...6..10..15...21..28..36..45... (triangular) %e A186221 1....4...9......16...25....36....49.. (square) %e A186221 Replace each number by its rank, where ties are settled by ranking the triangular number after the square: %e A186221 a=(2,3,5,7,8,10,12,14,...) %e A186221 b=(1,4,6,9,11,13,16,18,...). %t A186221 (* adjusted joint ranking; general formula *) %t A186221 d=-1/4; u=1/2; v=1/2; w=0; x=1; y=0; z=0; %t A186221 h[n_]:=-y+(4x(u*n^2+v*n+w-z-d)+y^2)^(1/2); %t A186221 a[n_]:=n+Floor[h[n]/(2x)]; %t A186221 k[n_]:=-v+(4u(x*n^2+y*n+z-w+d)+v^2)^(1/2); %t A186221 b[n_]:=n+Floor[k[n]/(2u)]; %t A186221 Table[a[n],{n,1,100}] (* A186221 *) %t A186221 Table[b[n],{n,1,100}] (* A186222 *) %t A186221 a[ n_] := n + Floor[ Sqrt[ n (n + 1)/2]]; (* _Michael Somos_, Aug 19 2018 *) %o A186221 (PARI) vector(120, n, n + floor(sqrt((n^2+n)/2 + 1/4))) \\ _G. C. Greubel_, Aug 18 2018 %o A186221 {a(n) = n + sqrtint( n * (n+1) \ 2)}; /* _Michael Somos_, Aug 19 2018 */ %o A186221 (Magma) [n + Floor(Sqrt((n^2+n)/2 + 1/4)): n in [1..120]]; // _G. C. Greubel_, Aug 18 2018 %Y A186221 Cf. A061288, A186219, A186220, A186222. %K A186221 nonn,easy %O A186221 1,1 %A A186221 _Clark Kimberling_, Feb 15 2011