login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Factorial base expansion of n reinterpreted as a primorial base expansion, then converted back to decimal.
9

%I #15 Feb 07 2024 01:16:10

%S 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,

%T 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,60,

%U 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

%N Factorial base expansion of n reinterpreted as a primorial base expansion, then converted back to decimal.

%H Antti Karttunen, <a href="/A351576/b351576.txt">Table of n, a(n) for n = 0..40319</a>

%H <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a>.

%H <a href="/index/Pri#primorialbase">Index entries for sequences related to primorial base</a>.

%F a(n) = A276085(A276076(n)).

%e 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.

%t 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 *)

%o (PARI)

%o A002110(n) = prod(i=1,n,prime(i));

%o 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; };

%o A276085(n) = { my(f = factor(n)); sum(k=1, #f~, f[k, 2]*A002110(primepi(f[k, 1])-1)); };

%o A351576(n) = A276085(A276076(n));

%Y Cf. A000142, A002110, A007623, A049345, A276076, A276085.

%Y Cf. also A276156.

%K nonn,base

%O 0,3

%A _Antti Karttunen_, Apr 01 2022