login
This site is supported by donations 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
1, 2, 4, 3, 8, 25, 16, 9, 9, 343, 32, 10, 64, 14641, 125, 27, 128, 15, 256, 98, 2401, 371293, 512, 30, 27, 24137569, 6, 2662, 1024, 147, 2048, 81, 161051, 893871739, 625, 50, 4096, 78310985281, 4826809, 28, 8192, 3993, 16384, 57122, 50, 14507145975869, 32768, 90, 81 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

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.

REFERENCES

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

LINKS

Antti Karttunen, Table of n, a(n) for n = 1..256

Ethan Akin and Morton Davis, "Bulgarian solitaire", American Mathematical Monthly 92 (4): 237-250. (1985).

Wikipedia, Bulgarian solitaire

FORMULA

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

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

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

EXAMPLE

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.

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.

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.

PROG

(Scheme, three different implementations)

(define (A243051 n) (A241909 (A242424 (A241909 n))))

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

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

(require 'factor)

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

(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))))))

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

(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))))))))

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

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

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

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

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

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

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

CROSSREFS

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

Fixed points: A243054.

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

Sequence in context: A244153 A308328 A277415 * A253791 A021045 A272471

Adjacent sequences:  A243048 A243049 A243050 * A243052 A243053 A243054

KEYWORD

nonn

AUTHOR

Antti Karttunen, May 29 2014

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 17 01:03 EDT 2019. Contains 328103 sequences. (Running on oeis4.)