

A343404


For any number n with representation (d_w, ..., d_1) in primorial base, a(n) is the least number m such that m mod prime(k) = d_k for k = 1..w (where prime(k) denotes the kth prime number).


3



0, 1, 4, 1, 2, 5, 6, 21, 16, 1, 26, 11, 12, 27, 22, 7, 2, 17, 18, 3, 28, 13, 8, 23, 24, 9, 4, 19, 14, 29, 120, 15, 190, 85, 50, 155, 36, 141, 106, 1, 176, 71, 162, 57, 22, 127, 92, 197, 78, 183, 148, 43, 8, 113, 204, 99, 64, 169, 134, 29, 30, 135, 100, 205
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,3


COMMENTS

Leading zeros in primorial base expansions are ignored.
The Chinese remainder theorem ensures that this sequence is well defined and provides a way to compute it.


LINKS



FORMULA



EXAMPLE

For n = 42 :
 the expansion of 42 in primary base is "1200",
 so a(42) mod 2 = 0 => a(42) = 2*t for some t >= 0,
a(42) mod 3 = 0 => a(42) = 6*u for some u >= 0,
a(42) mod 5 = 2 => a(42) = 12 + 30*v for some v >= 0,
a(42) mod 7 = 1 => a(42) = 162 + 210*w for some w >= 0,
 we choose w=0 so as to minimize the value,
 hence a(42) = 162.


PROG

(PARI) a(n) = { my (v=Mod(0, 1)); forprime (p=2, oo, if (n==0, return (lift(v)), v=chinese(v, Mod(n, p)); n\=p)) }


CROSSREFS



KEYWORD

nonn,base


AUTHOR



STATUS

approved



