The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A257687 Discard the most significant digit from factorial base representation of n, then convert back to decimal: a(n) = n - A257686(n). 17

%I #32 Mar 13 2021 12:43:39

%S 0,0,0,1,0,1,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,6,7,8,9,

%T 10,11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,

%U 12,13,14,15,16,17,18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0

%N Discard the most significant digit from factorial base representation of n, then convert back to decimal: a(n) = n - A257686(n).

%C A060130(n) gives the number of steps needed to reach zero, when starting iterating as a(k), a(a(k)), etc., from the starting value k = n.

%H Antti Karttunen, <a href="/A257687/b257687.txt">Table of n, a(n) for n = 0..10080</a>

%F a(n) = n - A257686(n).

%e Factorial base representation (A007623) of 1 is "1", discarding the most significant digit leaves nothing, taken to be zero, thus a(1) = 0.

%e Factorial base representation of 2 is "10", discarding the most significant digit leaves "0", thus a(2) = 0.

%e Factorial base representation of 3 is "11", discarding the most significant digit leaves "1", thus a(3) = 1.

%e Factorial base representation of 4 is "20", discarding the most significant digit leaves "0", thus a(4) = 0.

%t f[n_] := Block[{m = p = 1}, While[p*(m + 1) <= n, p = p*m; m++]; Mod[n, p]]; Array[f, 101, 0] (* _Robert G. Wilson v_, Jul 21 2015 *)

%o (Scheme) (define (A257687 n) (- n (A257686 n)))

%o (Python)

%o from sympy import factorial as f

%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))[1:][::-1]

%o return sum(int(x[i])*f(i + 1) for i in range(len(x)))

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

%Y Cf. A007623, A257686.

%Y Can be used (together with A099563) to define simple recurrences for sequences like A034968, A060130, A227153, A246359, A257511, A257679, A257680.

%Y Cf. also A257684.

%K nonn,base

%O 0,9

%A _Antti Karttunen_, May 04 2015

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 June 3 19:11 EDT 2024. Contains 373087 sequences. (Running on oeis4.)