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!)
A219661 Number of steps to go from (n+1)!-1 to n!-1 with map x -> x - (sum of digits in factorial base representation of x). 14

%I #30 Jun 29 2016 00:07:47

%S 1,2,5,19,83,428,2611,18473,150726,1377548,13851248,152610108,

%T 1835293041,23925573979,335859122743,5049372125352,80942722123544,

%U 1378487515335424,24858383452927384,473228664468684846

%N Number of steps to go from (n+1)!-1 to n!-1 with map x -> x - (sum of digits in factorial base representation of x).

%H Hiroaki Yamanouchi, <a href="/A219661/a219661.txt">Fast Python-program for computing terms of this sequence</a>

%F a(n) = A219652((n+1)!-1) - A219652(n!-1).

%F a(n) = A219662(n) + A219663(n).

%e (1!)-1 (0) is reached from (2!)-1 (1) with one step by subtracting A034968(1) from 1.

%e (2!)-1 (1) is reached from (3!)-1 (5) with two steps by first subtracting A034968(5) from 5 -> 2, and then subtracting A034968(2) from 2 -> 1.

%e (3!)-1 (5) is reached from (4!)-1 (23) with five steps by repeatedly subtracting the sum of digits in factorial expansion as: 23 - 6 = 17, 17 - 5 = 12, 12 - 2 = 10, 10 - 3 = 7, 7 - 2 = 5.

%e Thus a(1)=1, a(2)=2 and a(3)=5.

%t Table[Length@ NestWhileList[# - Total@ IntegerDigits[#, MixedRadix[Reverse@ Range[2, 120]]] &, (n + 1)! - 1, # > n! - 1 &] - 1, {n, 0, 8}] (* _Michael De Vlieger_, Jun 27 2016, Version 10.2 *)

%o (Scheme)

%o (define (A219661 n) (if (zero? n) n (let loop ((i (-1+ (A000142 (1+ n)))) (steps 1)) (cond ((isA000142? (1+ (A219651 i))) steps) (else (loop (A219651 i) (1+ steps)))))))

%o (define (isA000142? n) (and (> n 0) (let loop ((n n) (i 2)) (cond ((= 1 n) #t) ((not (zero? (modulo n i))) #f) (else (loop (/ n i) (1+ i)))))))

%o ;; Alternative definition:

%o (define (A219661 n) (- (A219652 (-1+ (A000142 (1+ n)))) (A219652 (-1+ (A000142 n)))))

%Y Row sums of A230420 and A230421.

%Y Cf. A000142, A007623, A219651, A219652, A219662, A219663, A219665, A226061.

%Y Cf. also A213709 (analogous sequence for base-2), A261234 (for base-3).

%K nonn

%O 1,2

%A _Antti Karttunen_, Dec 03 2012

%E Terms a(16) - a(20) computed with _Hiroaki Yamanouchi_'s Python-program by _Antti Karttunen_, Jun 27 2016

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 April 15 23:58 EDT 2024. Contains 371696 sequences. (Running on oeis4.)