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!)
A243051 Integer sequence induced by Bulgarian solitaire operation on partition list A241918: a(n) = A241909(A242424(A241909(n))). 9

%I #17 Jul 02 2014 17:01:55

%S 1,2,4,3,8,25,16,9,9,343,32,10,64,14641,125,27,128,15,256,98,2401,

%T 371293,512,30,27,24137569,6,2662,1024,147,2048,81,161051,893871739,

%U 625,50,4096,78310985281,4826809,28,8192,3993,16384,57122,50,14507145975869,32768,90,81

%N Integer sequence induced by Bulgarian solitaire operation on partition list A241918: a(n) = A241909(A242424(A241909(n))).

%C In "Bulgarian solitaire" a deck of cards or another finite set of objects is divided into one or more piles, and the "Bulgarian operation" is performed by taking one card from each pile, and making a new pile of them, which is added to the remaining set of piles. Essentially, this operation is a function whose domain and range are unordered integer partitions (cf. A000041) and which preserves the total size of a partition (the sum of its parts). This sequence is induced when the operation is implemented on the partitions as ordered by the list A241918.

%D Martin Gardner, Colossal Book of Mathematics, Chapter 34, Bulgarian Solitaire and Other Seemingly Endless Tasks, pp. 455-467, W. W. Norton & Company, 2001.

%H Antti Karttunen, <a href="/A243051/b243051.txt">Table of n, a(n) for n = 1..256</a>

%H Ethan Akin and Morton Davis, <a href="http://www.jstor.org/stable/2323643">"Bulgarian solitaire"</a>, American Mathematical Monthly 92 (4): 237-250. (1985).

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Bulgarian_solitaire">Bulgarian solitaire</a>

%F a(n) = A241909(A242424(A241909(n))).

%F a(n) = 1 + A075157(A226062(A075158(n-1))).

%F A243503(a(n)) = A243503(n) for all n. [Because Bulgarian operation doesn't change the total sum of the partition].

%e For n = 10, we see that as 10 = 2*5 = p_1^1 * p_2^0 * p_3^1, it encodes a partition [2,2,2]. Applying one step of Bulgarian solitaire (subtract one from each part, and add a new part as large as there were parts in the old partition) to this partition results a new partition [1,1,1,3], which is encoded in the prime factorization of p_1^0 * p_2^0 * p_3^0 * p_4^3 = 7^3 = 343. Thus a(10) = 343.

%e For n = 46, we see that as 46 = 2*23 = p_1 * p_9 = p_1^1 * p_2^0 * p_3^0 * ... * p_9^1, it encodes a partition [2,2,2,2,2,2,2,2,2]. Applying one step of Bulgarian solitaire to this partition results a new partition [1,1,1,1,1,1,1,1,1,9], which is encoded in the prime factorization of p_1^0 * p_2^0 * ... * p_9^0 * p_10^9 = 29^9 = 14507145975869. Thus a(46) = 14507145975869.

%e For n = 1875, we see that as 1875 = p_1^0 * p_2^1 * p_3^4, it encodes a partition [1,2,5]. Applying Bulgarian Solitaire, we get a new partition [1,3,4]. This in turn is encoded by p_1^0 * p_2^2 * p_3^2 = 3^2 * 5^2 = 225. Thus a(1875)=225.

%o (Scheme, three different implementations)

%o (define (A243051 n) (A241909 (A242424 (A241909 n))))

%o (define (A243051 n) (1+ (A075157 (A226062 (A075158 (- n 1))))))

%o ;; The following requires Aubrey Jaffer's SLIB Scheme library:

%o (require 'factor)

%o (define (A243051 n) (explist->n (ascpart_to_prime-exps (bulgarian-operation (prime-exps_to_ascpart (primefacs->explist n))))))

%o (define (bulgarian-operation ascpart) (let loop ((newpartition (list (length ascpart))) (ascpart ascpart)) (cond ((null? ascpart) (sort newpartition <)) (else (loop (if (= 1 (car ascpart)) newpartition (cons (- (car ascpart) 1) newpartition)) (cdr ascpart))))))

%o (define (primefacs->explist n) (reverse! (primefactorization->explist n)))

%o (define (primefactorization->explist n) (if (= 1 n) (list) (let loop ((factors (sort (factor n) <)) (pf 1) (el (list))) (cond ((null? factors) el) ((= (car factors) pf) (set-car! el (1+ (car el))) (loop (cdr factors) (car factors) el)) (else (loop (cdr factors) (car factors) (cons 1 (cons-n-times (-1+ (- (A049084 (car factors)) (A049084 pf))) 0 el))))))))

%o (define (prime-exps_to_ascpart explist) (if (null? explist) explist (sub1from_the_last (partsums (cons (+ (car explist) 1) (cdr explist))))))

%o (define (partsums a) (cdr (reverse! (fold-left (lambda (psums n) (cons (+ n (car psums)) psums)) (list 0) a))))

%o (define (sub1from_the_last lista) (let ((rev (reverse lista))) (reverse! (cons (- (car rev) 1) (cdr rev)))))

%o (define (ascpart_to_prime-exps partlist) (if (null? partlist) partlist (add1to_the_last (cons (- (car partlist) 1) (diff partlist)))))

%o (define (add1to_the_last lista) (let ((rev (reverse lista))) (reverse! (cons (+ 1 (car rev)) (cdr rev)))))

%o (define (diff a) (map - (cdr a) (reverse! (cdr (reverse a)))))

%o (define (explist->n explist) (if (null? explist) 1 (mul (lambda (i) (expt (A000040 i) (list-ref explist (-1+ i)))) 1 (length explist))))

%Y Row 1 of A243060 (table which gives successive "recursive iterates" of this sequence and converges towards A122111).

%Y Fixed points: A243054.

%Y Cf. A243052, A243053, A243503, A242424, A241909, A226062, A075157, A075158.

%K nonn

%O 1,2

%A _Antti Karttunen_, May 29 2014

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 March 29 10:59 EDT 2024. Contains 371277 sequences. (Running on oeis4.)