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.

A147693 Irregular triangle read by rows: T(n, k) = n mod prime(k), n >= 2, 1 <= k <= PrimePi(n), where PrimePi(n) = A000720(n).

This page as a plain text file.
%I A147693 #27 Jul 17 2025 14:48:24
%S A147693 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 A147693 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 A147693 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 A147693 Irregular triangle read by rows: T(n, k) = n mod prime(k), n >= 2, 1 <= k <= PrimePi(n), where PrimePi(n) = A000720(n).
%C A147693 Equivalently, we define table, P, with columns numbered by the primes (2, 3, 5, ...) instead of 1, 2, 3, ... so that P(n, p) = n mod p.
%C A147693 P begins with P(2, 2).
%C A147693 A complex pattern emerges if values in the triangle are taken modulo 2.
%C A147693 Rows are unique. Row n has length A000720(n). - _Jason Kimberley_, Nov 2012
%D A147693 James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, Exercise 3.7.22 on page 125.
%H A147693 Jason Kimberley, <a href="/A147693/b147693.txt">Rows n = 2..294 of irregular triangle, flattened</a>
%H A147693 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/RedhefferMatrix.html">Redheffer Matrix</a>
%F A147693 a(A046992(n-1)+i) = T(n,i) = n mod A000040(i), where 1 <= i <= A000720(n). - _Jason Kimberley_, Nov 21 2012
%e A147693 Triangle P begins:
%e A147693        2 3 5 7
%e A147693      +---------
%e A147693    2 | 0
%e A147693    3 | 1 0
%e A147693    4 | 0 1
%e A147693    5 | 1 2 0
%e A147693    6 | 0 0 1
%e A147693    7 | 1 1 2 0
%e A147693    8 | 0 2 3 1
%e A147693    9 | 1 0 4 2
%e A147693   10 | 0 1 0 3
%e A147693   ...
%e A147693 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 row number n is prime, initiating a new column numbered n, iff P(n, p) is nonzero for all prime p < n; P(n, n) is then 0.
%t A147693 row[n_]:=Table[Mod[n,Prime[i]], {i, PrimePi[n]}]; Array[row, 20, 2]//Flatten (* _Stefano Spezia_, Jul 17 2025 *)
%o A147693 (Magma) A147693 :=
%o A147693 func< n | [n mod p:p in PrimesUpTo(n)] >;
%o A147693 [A147693(n):n in[2..19]]; // _Jason Kimberley_, Nov 28 2012
%Y A147693 Cf. A000720, A002321, A046992, A083058.
%K A147693 easy,nonn,tabf
%O A147693 2,7
%A A147693 _Reikku Kulon_, Nov 10 2008
%E A147693 Edited by _Peter Munn_, May 25 2025