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.

A334741 Fill an infinite square array by following a spiral around the origin; in the central cell enter a(0)=1; thereafter, in the n-th cell, enter the sum of the entries of those earlier cells that are in the same row or column as that cell.

This page as a plain text file.
%I A334741 #20 May 11 2020 15:14:29
%S A334741 1,1,1,2,3,5,8,11,21,40,47,93,180,203,397,796,1576,1675,3305,6636,
%T A334741 13192,14004,27607,55029,110192,220024,226740,450123,898661,1798700,
%U A334741 3594248,3704800,7354303,14681369,29349536,58710640,117394896,119196748,237492079
%N A334741 Fill an infinite square array by following a spiral around the origin; in the central cell enter a(0)=1; thereafter, in the n-th cell, enter the sum of the entries of those earlier cells that are in the same row or column as that cell.
%C A334741 The spiral track being used here is the same as in A274640, except that the starting cell here is indexed 0 (as in A274641).
%C A334741 The central cell gets index 0 (and we fill it in with the value a(0)=1).
%H A334741 Peter Kagey, <a href="/A334741/b334741.txt">Table of n, a(n) for n = 0..2499</a>
%e A334741 Spiral begins:
%e A334741      3----2----1
%e A334741      |         |
%e A334741      5    1----1   47
%e A334741      |              |
%e A334741      8---11---21---40
%e A334741 a(11) = 47 = 1 + 1 + 5 + 40, the sum of the cells in its row and column.
%o A334741 (PARI) \\ here P(n) returns A174344 and A274923 as pair.
%o A334741 P(n)={my(m=sqrtint(n), k=ceil(m/2)); n -= 4*k^2; if(n<0, if(n<-m, [k, 3*k+n], [-k-n, k]), if(n<m, [-k, k-n], [n-3*k, -k]))}
%o A334741 seq(n)={my(m=sqrtint(n)+1, k=ceil(m/2), sx=vector(m), sy=vector(m), v=vector(1+n)); v[1]=sx[k]=sy[k]=1; for(i=1, n, my([px,py]=P(i)); px+=k; py+=k; my(t=sx[px]+sy[py]); sx[px]+=t; sy[py]+=t; v[i+1]=t); v} \\ _Andrew Howroyd_, May 09 2020
%Y A334741 Cf. A280027.
%Y A334741 Cf. A180714, A214526, A274640, A278180, A304586, A307834, A334742.
%Y A334741 x- and y-coordinates are given by A174344 and A274923, respectively.
%K A334741 nonn
%O A334741 0,4
%A A334741 _Alec Jones_ and _Peter Kagey_, May 09 2020