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.

A323621 The order of square grid cells touched by a circle expanding from the middle of a cell read by antidiagonals.

This page as a plain text file.
%I A323621 #12 Feb 15 2019 08:21:38
%S A323621 0,1,1,3,2,3,6,4,4,6,9,7,5,7,9,13,10,8,8,10,13,18,14,11,10,11,14,18,
%T A323621 23,19,15,12,12,15,19,23,29,24,20,17,16,17,20,24,29,35,30,25,21,20,20,
%U A323621 21,25,30,35,42,36,31,26,24,22,24,26,31,36,42,48,43,37,33,28,27,27,28,33,37,43,48,57,49,44,39,34,33,32,33,34,39,44,49,57
%N A323621 The order of square grid cells touched by a circle expanding from the middle of a cell read by antidiagonals.
%C A323621 Related to, but not the same as the case with the circle centered at the corner of a cell, see A232499.
%H A323621 Rok Cestnik, <a href="/A323621/a323621_1.gif">Visualization</a>
%o A323621 (Python)
%o A323621 N = 8
%o A323621 from math import sqrt
%o A323621 # the distance to the edge of each cell
%o A323621 edges = [[-1 for j in range(N)] for i in range(N)]
%o A323621 edges[0][0] = 0
%o A323621 for i in range(1,N):
%o A323621     edges[i][0] = i-0.5
%o A323621     edges[0][i] = i-0.5
%o A323621 for i in range(1,N):
%o A323621     for j in range(1,N):
%o A323621         edges[i][j] = sqrt((i-0.5)**2+(j-0.5)**2)
%o A323621 # the values of the distances
%o A323621 values = []
%o A323621 for i in range(N):
%o A323621     for j in range(N):
%o A323621         values.append(edges[i][j])
%o A323621 values = list(set(values))
%o A323621 values.sort()
%o A323621 # the cell order
%o A323621 board = [[-1 for j in range(N)] for i in range(N)]
%o A323621 count = 0
%o A323621 for v in values:
%o A323621     for i in range(N):
%o A323621         for j in range(N):
%o A323621             if(edges[i][j] == v):
%o A323621                 board[i][j] = count
%o A323621     count += 1
%o A323621 # print out the sequence
%o A323621 for i in range(N):
%o A323621     for j in range(i+1):
%o A323621         print(str(board[j][i-j])+" ", end="")
%Y A323621 For the first row of the grid see A323622.
%Y A323621 For the second row of the grid see A323623.
%Y A323621 For the diagonal of the grid see A323624.
%Y A323621 For the (2,1) diagonal of the grid see A323625.
%Y A323621 Cf. A232499.
%K A323621 nonn
%O A323621 0,4
%A A323621 _Rok Cestnik_, Jan 20 2019