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.
%I A243051 #17 Jul 02 2014 17:01:55 %S A243051 1,2,4,3,8,25,16,9,9,343,32,10,64,14641,125,27,128,15,256,98,2401, %T A243051 371293,512,30,27,24137569,6,2662,1024,147,2048,81,161051,893871739, %U A243051 625,50,4096,78310985281,4826809,28,8192,3993,16384,57122,50,14507145975869,32768,90,81 %N A243051 Integer sequence induced by Bulgarian solitaire operation on partition list A241918: a(n) = A241909(A242424(A241909(n))). %C A243051 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 A243051 Martin Gardner, Colossal Book of Mathematics, Chapter 34, Bulgarian Solitaire and Other Seemingly Endless Tasks, pp. 455-467, W. W. Norton & Company, 2001. %H A243051 Antti Karttunen, <a href="/A243051/b243051.txt">Table of n, a(n) for n = 1..256</a> %H A243051 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 A243051 Wikipedia, <a href="http://en.wikipedia.org/wiki/Bulgarian_solitaire">Bulgarian solitaire</a> %F A243051 a(n) = A241909(A242424(A241909(n))). %F A243051 a(n) = 1 + A075157(A226062(A075158(n-1))). %F A243051 A243503(a(n)) = A243503(n) for all n. [Because Bulgarian operation doesn't change the total sum of the partition]. %e A243051 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 A243051 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 A243051 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 A243051 (Scheme, three different implementations) %o A243051 (define (A243051 n) (A241909 (A242424 (A241909 n)))) %o A243051 (define (A243051 n) (1+ (A075157 (A226062 (A075158 (- n 1)))))) %o A243051 ;; The following requires Aubrey Jaffer's SLIB Scheme library: %o A243051 (require 'factor) %o A243051 (define (A243051 n) (explist->n (ascpart_to_prime-exps (bulgarian-operation (prime-exps_to_ascpart (primefacs->explist n)))))) %o A243051 (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 A243051 (define (primefacs->explist n) (reverse! (primefactorization->explist n))) %o A243051 (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 A243051 (define (prime-exps_to_ascpart explist) (if (null? explist) explist (sub1from_the_last (partsums (cons (+ (car explist) 1) (cdr explist)))))) %o A243051 (define (partsums a) (cdr (reverse! (fold-left (lambda (psums n) (cons (+ n (car psums)) psums)) (list 0) a)))) %o A243051 (define (sub1from_the_last lista) (let ((rev (reverse lista))) (reverse! (cons (- (car rev) 1) (cdr rev))))) %o A243051 (define (ascpart_to_prime-exps partlist) (if (null? partlist) partlist (add1to_the_last (cons (- (car partlist) 1) (diff partlist))))) %o A243051 (define (add1to_the_last lista) (let ((rev (reverse lista))) (reverse! (cons (+ 1 (car rev)) (cdr rev))))) %o A243051 (define (diff a) (map - (cdr a) (reverse! (cdr (reverse a))))) %o A243051 (define (explist->n explist) (if (null? explist) 1 (mul (lambda (i) (expt (A000040 i) (list-ref explist (-1+ i)))) 1 (length explist)))) %Y A243051 Row 1 of A243060 (table which gives successive "recursive iterates" of this sequence and converges towards A122111). %Y A243051 Fixed points: A243054. %Y A243051 Cf. A243052, A243053, A243503, A242424, A241909, A226062, A075157, A075158. %K A243051 nonn %O A243051 1,2 %A A243051 _Antti Karttunen_, May 29 2014