login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A173655
Triangle read by rows: T(n,k) = prime(n) mod prime(k), 0 < k <= n.
6
0, 1, 0, 1, 2, 0, 1, 1, 2, 0, 1, 2, 1, 4, 0, 1, 1, 3, 6, 2, 0, 1, 2, 2, 3, 6, 4, 0, 1, 1, 4, 5, 8, 6, 2, 0, 1, 2, 3, 2, 1, 10, 6, 4, 0, 1, 2, 4, 1, 7, 3, 12, 10, 6, 0, 1, 1, 1, 3, 9, 5, 14, 12, 8, 2, 0, 1, 1, 2, 2, 4, 11, 3, 18, 14, 8, 6, 0, 1, 2, 1, 6, 8, 2, 7, 3, 18, 12, 10, 4, 0
OFFSET
1,5
EXAMPLE
Triangle begins as:
0;
1, 0;
1, 2, 0;
1, 1, 2, 0;
1, 2, 1, 4, 0;
1, 1, 3, 6, 2, 0;
1, 2, 2, 3, 6, 4, 0;
1, 1, 4, 5, 8, 6, 2, 0;
1, 2, 3, 2, 1, 10, 6, 4, 0;
1, 2, 4, 1, 7, 3, 12, 10, 6, 0;
MAPLE
A173655 := proc(n, k) ithprime(n) mod ithprime(k) ; end proc:
seq(seq(A173655(n, k), k=1..n), n=1..20) ; # R. J. Mathar, Nov 24 2010
MATHEMATICA
Flatten[Table[Mod[Prime[n], Prime[Range[n]]], {n, 15}]]
PROG
(PARI) forprime(p=2, 40, forprime(q=2, p, print1(p%q", "))) \\ Charles R Greathouse IV, Dec 21 2011
(Magma)
A173655:= func< n, k | NthPrime(n) mod NthPrime(k) >;
[A173655(n, k): k in [1..n], n in [1..12]]; // G. C. Greubel, Apr 10 2024
(SageMath)
def A173655(n, k): return nth_prime(n)%nth_prime(k)
flatten([[A173655(n, k) for k in range(1, n+1)] for n in range(1, 13)]) # G. C. Greubel, Apr 10 2024
CROSSREFS
Cf. A001223 (2nd diagonal), A033955 (row sums), A102647 (row products excluding 0's), A031131 (3rd diagonal after first 3 terms).
Sequence in context: A029377 A128186 A048823 * A025871 A051010 A328342
KEYWORD
nonn,tabl
AUTHOR
STATUS
approved