A351576 Factorial base expansion of n reinterpreted as a primorial base expansion, then converted back to decimal.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100
Offset: 0
Examples
n = 313 has factorial base representation (see A007623) "23001" because 2*5! + 3*4! + 1*1! = 240+72+1 = 313. When this is reinterpreted as a primorial base expansion (see A049345), we obtain 2*A002110(4) + 3*A002110(3) + 1*A002110(0) = 511, therefore a(313) = 511.
Links
Programs
-
Mathematica
a[n_] := Module[{k = n, m = 2, r, s = {}}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, AppendTo[s, r]; m++]; FromDigits[Reverse[s], MixedRadix[Reverse@ Prime@ Range@ Length[s]]]]; Array[a, 100, 0] (* Amiram Eldar, Feb 07 2024 *)
-
PARI
A002110(n) = prod(i=1,n,prime(i)); A276076(n) = { my(i=0,m=1,f=1,nextf); while((n>0),i=i+1; nextf = (i+1)*f; if((n%nextf),m*=(prime(i)^((n%nextf)/f));n-=(n%nextf));f=nextf); m; }; A276085(n) = { my(f = factor(n)); sum(k=1, #f~, f[k, 2]*A002110(primepi(f[k, 1])-1)); }; A351576(n) = A276085(A276076(n));