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.

A196199 Count up from -n to n for n = 0, 1, 2, ... .

This page as a plain text file.
%I A196199 #45 Mar 01 2025 14:06:28
%S A196199 0,-1,0,1,-2,-1,0,1,2,-3,-2,-1,0,1,2,3,-4,-3,-2,-1,0,1,2,3,4,-5,-4,-3,
%T A196199 -2,-1,0,1,2,3,4,5,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,-7,-6,-5,-4,-3,-2,
%U A196199 -1,0,1,2,3,4,5,6,7,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8
%N A196199 Count up from -n to n for n = 0, 1, 2, ... .
%C A196199 This sequence contains every integer infinitely often, hence all integer sequences are subsequences.
%C A196199 This is a fractal sequence.
%C A196199 Indeed, if all terms (a(n),a(n+1)) such that a(n+1) does NOT equal a(n)+1 (<=> a(n+1) < a(n)) are deleted, the same sequence is recovered again. See A253580 for an "opposite" yet similar "fractal tree" construction. - _M. F. Hasler_, Jan 04 2015
%D A196199 Miklós Laczkovich, Conjecture and Proof, TypoTex, Budapest, 1998. See Chapter 10.
%H A196199 Reinhard Zumkeller, <a href="/A196199/b196199.txt">Rows n=0..100 of triangle, flattened</a>
%H A196199 Boris Putievskiy, <a href="http://arxiv.org/abs/1212.2732">Transformations [of] Integer Sequences And Pairing Functions</a> arXiv:1212.2732 [math.CO], 2012.
%F A196199 a(n) = n - t*t - t - 1, where t = floor(sqrt(n-1)). - _Boris Putievskiy_, Jan 28 2013
%F A196199 G.f.: x/(x-1)^2 + 1/(x-1)*sum(k >= 1, 2*k*x^(k^2)).  The series is related to Jacobi theta functions. - _Robert Israel_, Jan 05 2015
%e A196199 Table starts:
%e A196199             0,
%e A196199         -1, 0, 1,
%e A196199     -2, -1, 0, 1, 2,
%e A196199 -3, -2, -1, 0, 1, 2, 3,
%e A196199 ...
%e A196199 The sequence of fractions A196199/A004737 = 0/1, -1/1, 0/2, 1/1, -2/1, -1/2, 0/3, 1/2, 2/1, -3/1, -2/2, -1/3, 0/4, 1/3, 2/2, 3/1, -4/4. -3/2, ... contains every rational number (infinitely often) [Laczkovich]. - _N. J. A. Sloane_, Oct 09 2013
%p A196199 seq(seq(j-k-k^2, j=k^2 .. (k+1)^2-1), k = 0 .. 10); # _Robert Israel_, Jan 05 2015
%p A196199 # Alternatively, as a table with rows -n<=k<=n (compare A257564):
%p A196199 r := n -> (n-(n mod 2))/2: T := (n, k) -> r(n+k) - r(n-k):
%p A196199 seq(print(seq(T(n, k), k=-n..n)), n=0..6); # _Peter Luschny_, May 28 2015
%t A196199 Table[Range[-n, n], {n, 0, 9}] // Flatten
%t A196199 (* or *)
%t A196199 a[n_] := With[{t = Floor[Sqrt[n]]}, n - t (t + 1)];
%t A196199 Table[a[n], {n, 0, 99}] (* _Jean-François Alcover_, Jul 13 2018, after _Boris Putievskiy_ *)
%o A196199 (PARI) r=[];for(k=0,8,r=concat(r,vector(2*k+1,j,j-k-1)));r
%o A196199 (Haskell)
%o A196199 a196199 n k = a196199_row n !! k
%o A196199 a196199_tabf = map a196199_row [0..]
%o A196199 a196199_row n = [-n..n]
%o A196199 b196199 = bFile' "A196199" (concat $ take 101 a196199_tabf) 0
%o A196199 -- _Reinhard Zumkeller_, Sep 30 2011
%o A196199 (Python)
%o A196199 from math import isqrt
%o A196199 def A196199(n): return n-(t:=isqrt(n))*(t+1) # _Chai Wah Wu_, Aug 04 2022
%Y A196199 Cf. absolute values A053615, A002262, A002260, row lengths A005408, row sums A000004, A071797.
%Y A196199 Cf. A004737, A381232, A381233.
%K A196199 sign,tabf,easy,frac,look
%O A196199 0,5
%A A196199 _Franklin T. Adams-Watters_, Sep 29 2011