A328622 In primorial base representation of n, multiply by 2 all other digits except the least significant, and reduce each such product modulo prime(k) (to get the new digit), where k > 1 is the position of the digit, then convert back to decimal.
0, 1, 4, 5, 2, 3, 12, 13, 16, 17, 14, 15, 24, 25, 28, 29, 26, 27, 6, 7, 10, 11, 8, 9, 18, 19, 22, 23, 20, 21, 60, 61, 64, 65, 62, 63, 72, 73, 76, 77, 74, 75, 84, 85, 88, 89, 86, 87, 66, 67, 70, 71, 68, 69, 78, 79, 82, 83, 80, 81, 120, 121, 124, 125, 122, 123, 132, 133, 136, 137, 134, 135, 144, 145, 148, 149, 146, 147, 126, 127, 130, 131
Offset: 0
Examples
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.
Links
Programs
-
PARI
A002110(n) = prod(i=1,n,prime(i)); A276085(n) = { my(f = factor(n)); sum(k=1, #f~, f[k, 2]*A002110(primepi(f[k, 1])-1)); }; 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); }; A328622(n) = A276085(A328618(A276086(n)));