A279967 Square array read by antidiagonals upwards in which each term is the sum of prior elements in the same row, column, diagonal, or antidiagonal that divide n; the array is seeded with an initial value a(1)=1.
1, 1, 2, 2, 2, 7, 2, 9, 10, 15, 2, 10, 1, 13, 17, 8, 0, 13, 1, 14, 9, 8, 0, 13, 3, 30, 13, 10, 2, 16, 1, 23, 5, 7, 14, 15, 2, 8, 28, 32, 2, 23, 2, 9, 49, 12, 0, 48, 2, 11, 1, 20, 3, 18, 13, 28, 0, 4, 1, 56, 5, 8, 16, 35, 46, 4, 2, 6, 2, 10
Offset: 1
Examples
After 6 terms, the array looks like: . 1 2 7 1 2 2 We have a(6) = 7 because a(1) = 1, a(3) = 2, a(4) = 2, and a(5) = 2 divide 6; 1 + 2 + 2 + 2 = 7. From _Hartmut F. W. Hoft_, Jan 23 2017: (Start) 1 2 7 15 17 9 10 15 49 13 4 31 22 1 2 10 13 14 13 14 9 18 46 12 66 2 9 1 1 30 7 2 3 35 12 3 2 10 13 3 5 23 20 16 14 17 2 0 13 23 2 1 8 11 2 8 0 1 32 11 5 3 6 8 16 28 2 56 42 8 2 8 48 1 2 104 2 0 4 10 1 12 0 2 10 28 6 2 2 42 2 . Expanded the triangle to the first 13 antidiagonals of the array, i.e. a(1) ... a(91), to show the start of the 2- and 0-value patterns in columns 1 and 2. The first 0 beyond column 2 is a(677) in row 27, column 11 of the triangle. A188382(n)=2*n^2+n+1 for n>=0 are the alternate sequence indices for column 1 starting in row 1, 2*n^2+n+2 for n>=1 are the alternate sequence indices for column 2 starting in row 2, and 2*n^2+n+11 for n>=5 are the alternate sequence indices for column 11 starting in row 1. The sequence indices in the triangle for row positions k>=1 in columns 1,..., 5 are given in sequences A000124(k), A152948(k+3), A152950(k+3), A145018(k+4) and A167499(k+4). (End)
Links
- Peter Kagey, Table of n, a(n) for n = 1..5000
Crossrefs
Programs
-
Mathematica
(* printing of the triangle is commented out of function a279967[] *) pCol[{i_, j_}] := Map[{#, j}&, Range[1, i-1]] pDiag[{i_, j_}] := If[j>=i, Map[{#, j-i+#}&, Range[1, i-1]], Map[{i-j+#, #}&, Range[1, j-1]]] pRow[{i_, j_}] := Map[{i, #}&, Range[1, j-1]] pAdiag[{i_, j_}] := Map[{i+j-#, #}&, Range[1, j-1]] priorPos[{i_, j_}] := Join[pCol[{i, j}], pDiag[{i, j}], pRow[{i, j}], pAdiag[{i, j}]] seqPos[{i_, j_}] := (i+j-2)(i+j-1)/2+j antiDiag[k_] := Map[{k+1-#, #}&, Range[1, k]] upperTriangle[k_] := Flatten[Map[antiDiag, Range[1, k]], 1] a279967[k_] := Module[{ut=upperTriangle[k], ms=Table[" ", {i, 1, k}, {j, 1, k}], h, pos, val, seqL={1}}, ms[[1, 1]]=1; For[h=2, h<=Length[ut], h++, pos=ut[[h]]; val=Apply[Plus, Select[Map[ms[[Apply[Sequence, #]]]&, priorPos[pos]], #!=0 && Mod[seqPos[pos], #]==0&]]; AppendTo[seqL, val]; ms[[Apply[Sequence, pos]]]=val]; (* Print[TableForm[ms]]; *) seqL] a279967[13] (* values in first 13 antidiagonals *) (* Hartmut F. W. Hoft, Jan 23 2017 *)
Comments