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.

A260736 a(0) = 0; for n >= 1, a(n) = A000035(n) + a(A257684(n)); in the factorial representation of n the number of digits with maximal possible value allowed in its location.

This page as a plain text file.
%I A260736 #28 Jan 24 2024 01:49:54
%S A260736 0,1,0,1,1,2,0,1,0,1,1,2,0,1,0,1,1,2,1,2,1,2,2,3,0,1,0,1,1,2,0,1,0,1,
%T A260736 1,2,0,1,0,1,1,2,1,2,1,2,2,3,0,1,0,1,1,2,0,1,0,1,1,2,0,1,0,1,1,2,1,2,
%U A260736 1,2,2,3,0,1,0,1,1,2,0,1,0,1,1,2,0,1,0,1,1,2,1,2,1,2,2,3,1,2,1,2,2,3,1,2,1,2,2,3,1,2,1,2,2,3,2,3,2,3,3,4,0
%N A260736 a(0) = 0; for n >= 1, a(n) = A000035(n) + a(A257684(n)); in the factorial representation of n the number of digits with maximal possible value allowed in its location.
%C A260736 In the factorial representation of n, given as {d_k, ..., d_3, d_2, d_1}, the maximal allowed digit for any position j is j. This sequence gives the number of digits in the whole representation [A007623(n)] that attain that maximum allowed value.
%H A260736 <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a>.
%F A260736 a(0) = 0; for n >= 1, a(n) = A000035(n) + a(A257684(n)).
%F A260736 Other identities. For all n >= 1:
%F A260736 a(n!-1) = n-1. [n!-1 also gives the first position where n-1 occurs.]
%e A260736 For n=19, which has factorial representation "301", the digits at position 1 and 3, namely "1" and "3" are equal to their one-based position index, in other words, the maximal digits allowed in those positions (while "0" at position 2 is not), thus a(19) = 2.
%t A260736 a[n_] := Module[{k = n, m = 2, c = 0, r}, While[{k, r} = QuotientRemainder[k, m]; k != 0 || r != 0, If[r == m - 1, c++]; m++]; c]; Array[a, 100, 0] (* _Amiram Eldar_, Jan 23 2024 *)
%o A260736 (Scheme, with memoization-macro definec)
%o A260736 (definec (A260736 n) (if (zero? n) 0 (+ (A000035 n) (A260736 (A257684 n)))))
%o A260736 (Python)
%o A260736 from sympy import factorial as f
%o A260736 def a007623(n, p=2): return n if n<p else a007623(n//p, p+1)*10 + n%p
%o A260736 def a257684(n):
%o A260736     x=str(a007623(n))[:-1]
%o A260736     y="".join(str(int(i) - 1) if int(i)>0 else '0' for i in x)[::-1]
%o A260736     return 0 if n==1 else sum(int(y[i])*f(i + 1) for i in range(len(y)))
%o A260736 def a(n): return 0 if n==0 else n%2 + a(a257684(n))
%o A260736 print([a(n) for n in range(101)]) # _Indranil Ghosh_, Jun 20 2017
%Y A260736 Cf. A000035, A007623, A257684.
%Y A260736 Cf. also A257511.
%K A260736 nonn,base
%O A260736 0,6
%A A260736 _Antti Karttunen_, Aug 27 2015