login
A276327
The least significant nonzero digit in greedy A001563-base (A276326), a(0) = 0.
2
0, 1, 2, 3, 1, 1, 2, 3, 2, 1, 2, 3, 3, 1, 2, 3, 4, 1, 1, 1, 2, 3, 1, 1, 2, 3, 2, 1, 2, 3, 3, 1, 2, 3, 4, 1, 2, 1, 2, 3, 1, 1, 2, 3, 2, 1, 2, 3, 3, 1, 2, 3, 4, 1, 3, 1, 2, 3, 1, 1, 2, 3, 2, 1, 2, 3, 3, 1, 2, 3, 4, 1, 4, 1, 2, 3, 1, 1, 2, 3, 2, 1, 2, 3, 3, 1, 2, 3, 4, 1, 5, 1, 2, 3, 1, 1, 1, 1, 2, 3, 1, 1, 2, 3, 2, 1, 2, 3, 3, 1, 2, 3, 4, 1, 1, 1, 2, 3, 1, 1, 2
OFFSET
0,3
LINKS
FORMULA
a(0) = 0; for n >= 1, if A276335(n) = 0 then a(n) = A276333(n), otherwise a(n) = a(A276335(n)).
MATHEMATICA
f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], (# #!) &[# - i]]], {i, 0, # - 1}] &@ NestWhile[# + 1 &, 0, (# #!) &[# + 1] <= n &]; Rest[a][[All, 1]]];
{0}~Join~Table[Last@ DeleteCases[f@ n, d_ /; d == 0], {n, 120}] (* Michael De Vlieger, Aug 31 2016 *)
PROG
(Scheme, two versions)
;; Implemented with a loop:
(define (A276327 n) (let loop ((n n)) (let ((next_n (A276335 n))) (if (zero? next_n) (A276333 n) (loop next_n)))))
;; As a recurrence:
(definec (A276327 n) (if (zero? n) n (if (zero? (A276335 n)) (A276333 n) (A276327 (A276335 n)))))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Aug 30 2016
STATUS
approved