cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A286604 a(n) = n mod sum of digits of n in factorial base.

This page as a plain text file.
%I A286604 #21 Feb 21 2024 01:20:22
%S A286604 0,0,1,0,2,0,1,0,0,1,3,0,1,2,3,0,2,0,3,0,1,2,5,0,1,0,0,1,1,0,1,2,1,2,
%T A286604 0,0,1,2,4,0,5,2,3,4,3,4,5,0,1,2,3,0,3,0,3,0,2,3,5,0,1,2,3,4,2,1,1,2,
%U A286604 6,0,7,0,1,2,0,1,5,2,4,0,3,4,6,4,1,2,3,4,1,0,0,1,5,6,5,0,2,3,3,4,3,2,1,2,0,1,3,0,4,5,7,0,5,2,3,4,0,1,9,0
%N A286604 a(n) = n mod sum of digits of n in factorial base.
%H A286604 Antti Karttunen, <a href="/A286604/b286604.txt">Table of n, a(n) for n = 1..10080</a>
%H A286604 <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a>.
%F A286604 a(n) = n mod A034968(n).
%t A286604 a[n_] := Module[{k = n, m = 2, r, s = 0}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, s += r; m++]; Mod[n, s]]; Array[a, 100] (* _Amiram Eldar_, Feb 21 2024 *)
%o A286604 (Scheme) (define (A286604 n) (modulo n (A034968 n)))
%o A286604 (Python)
%o A286604 def a007623(n, p=2): return n if n<p else a007623(n//p, p+1)*10 + n%p
%o A286604 def a(n):
%o A286604     return n % sum(int(k) for k in str(a007623(n)))
%o A286604 print([a(n) for n in range(1, 201)]) # _Indranil Ghosh_, Jun 21 2017
%Y A286604 Cf. A034968, A286606.
%Y A286604 Cf. A118363 (positions of zeros), A286607 (of nonzeros).
%K A286604 nonn,base
%O A286604 1,5
%A A286604 _Antti Karttunen_, Jun 18 2017