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.

A097285 Contains exactly once every pair (i,j) of distinct positive integers.

This page as a plain text file.
%I A097285 #9 Apr 11 2019 11:45:40
%S A097285 1,2,1,3,2,3,1,4,2,4,3,4,1,5,2,5,3,5,4,5,1,6,2,6,3,6,4,6,5,6,1,7,2,7,
%T A097285 3,7,4,7,5,7,6,7,1,8,2,8,3,8,4,8,5,8,6,8,7,8,1,9,2,9,3,9,4,9,5,9,6,9,
%U A097285 7,9,8,9,1,10,2,10,3,10,4,10,5,10,6,10,7,10,8,10,9,10,1,11,2,11,3,11,4,11,5
%N A097285 Contains exactly once every pair (i,j) of distinct positive integers.
%H A097285 Robert Israel, <a href="/A097285/b097285.txt">Table of n, a(n) for n = 1..10000</a>
%F A097285 Juxtapose segments: 1 2, then 1 3 2 3, then 1 4 2 4 3 4. General segment is 1 n 2 n ... n-1 n, followed by 1, so that clearly, every i<j and every i>j is uniquely present.
%p A097285 A097285:= proc(n) local k,j;
%p A097285    k:= floor(sqrt(n-3/4)-1/2);
%p A097285    j:= floor((n-k^2-k)/2);
%p A097285    if n::odd then j+1 else k+2 fi
%p A097285 end proc;
%p A097285 seq(A097285(n),n=1..100); # _Robert Israel_, May 08 2014
%t A097285 S = {1, 2}; Do[S = Join[S, Riffle[Range[n-1], n], {n}], {n, 3, 12}];
%t A097285 S (* _Jean-François Alcover_, Apr 11 2019 *)
%Y A097285 Cf. A097286.
%K A097285 nonn
%O A097285 1,2
%A A097285 _Clark Kimberling_, Aug 05 2004