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.

A226005 Lexicographically earliest sequence such that (a(n), a(n+1)) runs through all the pairs of nonnegative integers exactly once, with the constraint that a(n)=0 iff n is a square.

This page as a plain text file.
%I A226005 #29 Nov 20 2017 23:20:25
%S A226005 0,0,1,1,0,2,1,2,2,0,3,1,3,2,3,3,0,4,1,4,2,4,3,4,4,0,5,1,5,2,5,3,5,4,
%T A226005 5,5,0,6,1,6,2,6,3,6,4,6,5,6,6,0,7,1,7,2,7,3,7,4,7,5,7,6,7,7,0,8,1,8,
%U A226005 2,8,3,8,4,8,5,8,6,8,7,8,8,0,9,1,9,2,9,3,9,4,9,5,9,6,9,7,9,8,9,9,0
%N A226005 Lexicographically earliest sequence such that (a(n), a(n+1)) runs through all the pairs of nonnegative integers exactly once, with the constraint that a(n)=0 iff n is a square.
%C A226005 a(k^2-2) = a(k^2-1) = k-1 for any k > 1.
%C A226005 If (a(k), a(k+1)) = (x,y), then max(x,y)^2 <= k < (max(x,y)+1)^2.
%H A226005 Paul Tek, <a href="/A226005/b226005.txt">Table of n, a(n) for n = 0..10000</a>
%F A226005 a(n) = ([sqrt n]^2 + [(n-[sqrt n]^2)/2])/2 - (-1)^(n-[sqrt n]^2)*([sqrt n]^2-[(n-[sqrt n]^2)/2])/2, where [] represents the floor function. - _David Adam_, Nov 09 2017
%e A226005 a(0)=0.
%e A226005 a(1)=0.
%e A226005 a(2)>0; (0,1) has not yet been visited, hence a(2)=1.
%e A226005 a(3)>0; (1,1) has not yet been visited, hence a(3)=1.
%e A226005 a(4)=0.
%e A226005 a(5)>0; (0,1) has been visited, but (0,2) has not, hence a(5)=2.
%e A226005 a(6)>0; (2,1) has not yet been visited, hence a(6)=1.
%e A226005 a(7)>0; (1,1) has been visited, but (1,2) has not, hence a(7)=2.
%e A226005 a(8)>0; (2,1) has been visited, but (2,2) has not, hence a(8)=2.
%e A226005 a(9)=0.
%e A226005 etc.
%o A226005 (Perl) my @a = (0);
%o A226005 foreach my $k (1..10) {
%o A226005     push @a => 0, ( map { ($k, $_) } 1..$k-1 ), $k, $k;
%o A226005 }
%Y A226005 Cf. A002487, A209279.
%K A226005 nonn
%O A226005 0,6
%A A226005 _Paul Tek_, May 22 2013