login
A219840
Irregular triangle R(n,k) = n mod A000040(k), for 1 <= k <= i, where i is the least such that n < A002110(i).
1
1, 0, 2, 1, 0, 0, 1, 1, 2, 0, 0, 1, 1, 1, 2, 0, 2, 3, 1, 0, 4, 0, 1, 0, 1, 2, 1, 0, 0, 2, 1, 1, 3, 0, 2, 4, 1, 0, 0, 0, 1, 1, 1, 2, 2, 0, 0, 3, 1, 1, 4, 0, 2, 0, 1, 0, 1, 0, 1, 2, 1, 2, 3
OFFSET
1,3
COMMENTS
By the Chinese Remainder Theorem, x = n is the unique, for 0 <= m < A002110(i), solution to the set of congruences x = R(n,k) (mod A000040(k)), for 1 <= k <= i.
EXAMPLE
1: 1;
2: 0, 2;
3: 1, 0;
4: 0, 1;
5: 1, 2;
6: 0, 0, 1;
...
29: 1, 2, 4;
30: 0, 0, 0, 2;
...
209:1, 2, 4, 6;
210:0, 0, 0, 0, 1;
PROG
(Magma) A002110 := func<n|&*[Integers()|NthPrime(j):j in[1..n]]>;
A219840_block := func<i|[[n mod NthPrime(k):k in[1..i]]:n in[A002110(i-1)..A002110(i)-1]]>;
[A219840_block(i):i in[1..4]];
CROSSREFS
The n-th row of this sequence is the length i prefix of the n-th row of A147693.
Sequence in context: A254605 A335664 A269518 * A343220 A264893 A340653
KEYWORD
nonn,easy,tabf
AUTHOR
Jason Kimberley, Nov 29 2012
STATUS
approved