OFFSET
0,3
LINKS
EXAMPLE
In primorial base (A049345) 199 is written as "6301" because 6*A002110(3) + 3*A002110(2) + 0*A002110(1) + 1*A002110(0) = 6*30 + 3*6 + 0*2 + 1*1 = 199. Multiplying each digit except the least significant by 2, and then reducing them modulo the corresponding prime leaves us with 2*6 mod 7, 2*3 mod 5, 2*0 mod 3, (with the least significant 1 staying the same), so we get "5101", which is the primorial base expansion of 157, thus a(199) = 157.
For 157, the new "doubled and reduced" expansion is 2*5 mod 7, 2*1 mod 5, 2*0 mod 3 and the trailing 1 stays intact, so we get "3201", which is the primorial base expansion of 103, thus a(157) = 103.
PROG
(PARI)
A002110(n) = prod(i=1, n, prime(i));
A276086(n) = { my(m=1, p=2); while(n, m *= (p^(n%p)); n = n\p; p = nextprime(1+p)); (m); };
A328618(n) = { my(f = factor(n), m, q); for(k=1, #f~, q = (f[k, 2]\f[k, 1]); m = (f[k, 2]%f[k, 1]); if(m&&(f[k, 1]!=2), f[k, 2] = q*f[k, 1] + ((2*f[k, 2])%f[k, 1]))); factorback(f); };
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Oct 23 2019
STATUS
approved