login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A286606 a(n) = n mod product of nonzero digits of n in factorial base. 2

%I #19 Feb 21 2024 01:20:37

%S 0,0,0,0,1,0,0,0,0,0,1,0,1,0,1,0,1,0,1,2,0,4,5,0,0,0,0,0,1,0,0,0,0,0,

%T 1,0,1,0,1,0,1,0,1,2,0,4,5,0,1,0,1,0,1,0,1,0,1,2,3,0,1,2,3,0,1,0,1,2,

%U 3,10,11,0,1,2,0,4,5,0,1,2,0,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,2,3,0,1,2,3,4,5,6,7,0,1,6,7,8,9,22,23,0

%N a(n) = n mod product of nonzero digits of n in factorial base.

%H Antti Karttunen, <a href="/A286606/b286606.txt">Table of n, a(n) for n = 1..10080</a>

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

%F a(n) = n mod A227153(n).

%t 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++]; Mod[n, p]]; Array[a, 100] (* _Amiram Eldar_, Feb 21 2024 *)

%o (Scheme) (define (A286606 n) (modulo n (A227153 n)))

%o (Python)

%o from operator import mul

%o from functools import reduce

%o def a007623(n, p=2): return n if n<p else a007623(n//p, p+1)*10 + n%p

%o def a(n):

%o x=str(a007623(n)).replace('0', '')

%o return n%reduce(mul, map(int, x))

%o print([a(n) for n in range(1, 201)]) # _Indranil Ghosh_, Jun 21 2017

%Y Cf. A227153, A286604.

%K nonn,base

%O 1,20

%A _Antti Karttunen_, Jun 18 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 9 09:02 EDT 2024. Contains 372346 sequences. (Running on oeis4.)