login
Triangle read by rows: numbers n and prime numbered columns p such that T(n, p) is n mod p.
3

%I #12 Sep 08 2022 08:45:38

%S 0,1,0,0,1,1,2,0,0,0,1,1,1,2,0,0,2,3,1,1,0,4,2,0,1,0,3,1,2,1,4,0,0,0,

%T 2,5,1,1,1,3,6,2,0,0,2,4,0,3,1,1,0,0,1,4,2,0,1,1,2,5,3,1,2,2,3,6,4,0,

%U 0,0,3,4,7,5,1,1,1,4,5,8,6,2,0,0,2,0,6,9,7,3,1,1,0,1,0,10,8,4,2

%N Triangle read by rows: numbers n and prime numbered columns p such that T(n, p) is n mod p.

%C The triangle begins with T(2, 2).

%C A number p is prime, beginning a new column, iff T(p, k) is nonzero for all k < p; T(p, p) is then 0.

%C Each row can be produced from the previous row by adding one to each number and resetting to zero any which would equal their column number. A complex pattern emerges if values in the triangle are taken modulo 2.

%C Rows are unique. Row n has length A000720(n). - _Jason Kimberley_, Nov 2012

%H Jason Kimberley, <a href="/A147693/b147693.txt">Rows n = 2..294 of irregular triangle, flattened</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/RedhefferMatrix.html">Redheffer Matrix</a>

%F a(A046992(n-1)+i) = T(n,i) = n mod A000040(i), where 1 <= i <= A000720(n). _Jason Kimberley_, Nov 21 2012

%e The triangle begins as so:

%e [2] 0

%e [3] 1 0

%e ... 0 1

%e [5] 1 2 0

%e ... 0 0 1

%e [7] 1 1 2 0

%e ... 0 2 3 1

%e ... 1 0 4 2

%e ... 0 1 0 3

%o (Magma) A147693 :=

%o func< n | [n mod p:p in PrimesUpTo(n)] >;

%o [A147693(n):n in[2..19]]; // _Jason Kimberley_, Nov 28 2012

%Y Cf. A002321, A083058.

%K easy,nonn,tabf

%O 2,7

%A _Reikku Kulon_, Nov 10 2008