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.

A353590 Lexicographically earliest permutation of the nonnegative integers filling an infinite square array by falling antidiagonals so that the elements on any 2 X 2 square sum to a square.

This page as a plain text file.
%I A353590 #15 Jun 14 2022 06:56:56
%S A353590 0,1,2,3,6,4,5,15,13,7,8,26,30,12,9,10,25,29,45,21,11,14,38,20,17,22,
%T A353590 23,16,18,19,61,34,37,55,31,24,27,49,51,54,33,82,35,50,28,32,75,77,59,
%U A353590 48,44,53,80,42,36,39,62,88,69,64,71,46,57,84,63,40,41,92,99,90,97,73,95
%N A353590 Lexicographically earliest permutation of the nonnegative integers filling an infinite square array by falling antidiagonals so that the elements on any 2 X 2 square sum to a square.
%C A353590 In A337115 the infinite 2D lattice is filled along a square spiral satisfying the same constraint of 2 X 2 squares adding up to squares.
%e A353590 The square array starts:
%e A353590    0   1   3   5   8  10  14  18  27  32  ...
%e A353590    2   6  15  26  25  38  19  49  75  ...
%e A353590    4  13  30  29  20  61  51  77  ...
%e A353590    7  12  45  17  34  54  59  ...
%e A353590    9  21  22  37  33  48  ...
%e A353590   11  23  55  82  44  ...
%e A353590   16  31  35  53  ...
%e A353590   24  50  80  ...
%e A353590   28  42  ...
%e A353590   36  ...
%e A353590   ...
%e A353590 a(4) is in the second row and column. It must sum up with a(0) = 0, a(1) = 1 and a(2) = 2 to a square, the smallest possible solution is a(4) = 6.
%e A353590 Similarly, a(7) which is on the second row, third column, must sum up with a(1) = 1 (above to the left), a(3) = 3 (above) and a(4) = 6 (to the left) to a square; the smallest solution is a(7) = 15.
%o A353590 (PARI) A353590_upto(N, M=Map(), r,c, U=[-1])={vector(N, i, if(r && c, my(s=mapget(M,[r-1,c-1])+mapget(M,[r-1,c])+mapget(M,[r,c-1]), m=sqrtint(s)+1); while(setsearch(U, N=m^2-s)||N<=U[1], m+=1); U=setunion(U, [N]), N=U[1]+=1); mapput(M,[r,c], N); if(c, c--;r++, r=!c=r+1); while(#U>2 && U[2]==U[1]+1, U=U[^1]); N)}
%Y A353590 Cf. A000290 (the squares), A337115 (same idea with square spiral instead of array by antidiagonals), A353591 (same idea with primes instead of squares).
%K A353590 nonn
%O A353590 0,3
%A A353590 _M. F. Hasler_, May 29 2022