login
A276146
a(n) = A034968(A225901(n)).
2
0, 1, 2, 3, 1, 2, 3, 4, 5, 6, 4, 5, 2, 3, 4, 5, 3, 4, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 5, 6, 7, 8, 9, 10, 8, 9, 6, 7, 8, 9, 7, 8, 5, 6, 7, 8, 6, 7, 3, 4, 5, 6, 4, 5, 6, 7, 8, 9, 7, 8, 5, 6, 7, 8, 6, 7, 4, 5, 6, 7, 5, 6, 2, 3, 4, 5, 3, 4, 5, 6, 7, 8, 6, 7, 4, 5, 6, 7, 5, 6, 3, 4, 5, 6, 4, 5, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 5, 6, 3, 4, 5, 6, 4, 5, 2, 3, 4, 5, 3, 4, 5
OFFSET
0,3
FORMULA
a(n) = A034968(A225901(n)).
MATHEMATICA
b = MixedRadix[Reverse@ Range[2, 12]]; h[n_] := Module[{s = 0, i = 2, k = n}, While[k > 0, k = Floor[n/i!]; s = s + (i - 1) k; i++]; n - s]; Table[h@ FromDigits[Map[Boole[# > 0] &, #] (Reverse@ Range[2, Length@ # + 1] - #), b] &@ IntegerDigits[n, b], {n, 0, 120}] (* Version 10.2, or *)
f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], Times @@ Range[# - i]]], {i, 0, #}] &@ NestWhile[# + 1 &, 0, Times @@ Range[# + 1] <= n &]; Most@ Rest[a][[All, 1]] /. {} -> {0}]; g[w_List] := Total[Times @@@ Transpose@{Map[Times @@ # &, Range@ Range[0, Length@ w]], Reverse@ Append[w, 0]}]; h[n_] := Module[{s = 0, i = 2, k = n}, While[k > 0, k = Floor[n/i!]; s = s + (i - 1) k; i++]; n - s]; Table[h@ g[Map[Boole[# > 0] &, #] (Reverse@ Range[2, Length@ # + 1] - #)] &@ f@ n, {n, 0, 120}] (* Michael De Vlieger, Aug 29 2016, function h after Jean-François Alcover at A034968 *)
PROG
(Scheme) (define (A276146 n) (A034968 (A225901 n)))
CROSSREFS
Sequence in context: A338027 A025481 A124171 * A210530 A076645 A350604
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Aug 29 2016
STATUS
approved