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
Rémy Sigrist, Apr 14 2021
STATUS
approved