login
A227153
Product of nonzero digits of n in factorial base.
12
1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 4, 4, 3, 3, 3, 3, 6, 6, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 4, 4, 3, 3, 3, 3, 6, 6, 2, 2, 2, 2, 4, 4, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 8, 8, 6, 6, 6, 6, 12, 12, 3, 3, 3, 3, 6, 6, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6
OFFSET
0,5
COMMENTS
a(0) = 1 as an empty product always gives 1.
LINKS
FORMULA
For all n, a(A227157(n)) = A208575(A227157(n)).
MATHEMATICA
a[n_] := Module[{k = n, m = 2, r, p = 1}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, If[r > 0, p *= r]; m++]; p]; Array[a, 100, 0] (* Amiram Eldar, Feb 07 2024 *)
PROG
(Scheme)
(define (A227153 n) (apply * (delete-matching-items (n->factbase n) zero?)))
(define (n->factbase n) (let loop ((n n) (fex (if (zero? n) (list 0) (list))) (i 2)) (cond ((zero? n) fex) (else (loop (floor->exact (/ n i)) (cons (modulo n i) fex) (1+ i))))))
(Python)
from functools import reduce
from operator import mul
def A(n, p=2):
return n if n<p else A(n//p, p+1)*10 + n%p
def a(n):
return 1 if n<2 else reduce(mul, [int(i) for i in str(A(n)) if i!="0"])
print([a(n) for n in range(201)]) # Indranil Ghosh, Jun 19 2017
(Python)
def a(n, k=2): return max(n % k, 1) * a(n // k, k + 1) if n else 1 # David Radcliffe, May 22 2025
CROSSREFS
A227157 gives the positions where equal with A208575.
Sequence in context: A328114 A343504 A328582 * A328581 A238643 A140193
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Jul 04 2013
STATUS
approved