login

Revision History for A226062

(Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
a(n) = Bulgarian solitaire operation applied to the partition encoded in the runlengths of binary expansion of n.
(history; published version)
#33 by Peter Luschny at Tue Mar 10 04:31:10 EDT 2015
STATUS

reviewed

approved

#32 by Peter Luschny at Sun Mar 08 18:43:23 EDT 2015
STATUS

proposed

reviewed

#31 by Antti Karttunen at Sun Mar 08 12:22:27 EDT 2015
STATUS

editing

proposed

#30 by Antti Karttunen at Sun Mar 08 12:05:52 EDT 2015
#29 by Antti Karttunen at Sun Mar 08 12:03:48 EDT 2015
FORMULA

Other identities:

A227183(a(n)) = A227183(n). [This operation doesn't change the total sum of the partition.]

a(n) = A243354(A242424(A243353(n))).

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

STATUS

approved

editing

#28 by OEIS Server at Tue Jul 30 17:01:00 EDT 2013
LINKS

Antti Karttunen, <a href="/A226062/b226062_1.txt">Table of n, a(n) for n = 0..8191</a>

#27 by T. D. Noe at Tue Jul 30 17:01:00 EDT 2013
STATUS

proposed

approved

Discussion
Tue Jul 30
17:01
OEIS Server: Installed new b-file as b226062.txt.  Old b-file is now b226062_1.txt.
#26 by Antti Karttunen at Fri Jul 26 05:09:55 EDT 2013
STATUS

editing

proposed

#25 by Antti Karttunen at Fri Jul 26 05:08:40 EDT 2013
LINKS

Antti Karttunen, <a href="/A129594/a129594_1.txt">Python-program for computing this and related sequences.</a>

PROG

(Python)

def A226062(n):

'''Bulgarian solitaire operation applied to the partition encoded in the runlengths of binary expansion of n.'''

return(ascpart_to_binexp(bulgarian_operation(binexp_to_ascpart(n))))

def bulgarian_operation(ap):

'''Apply Bulgarian Solitaire operation to unordered partition: decrement one from each part and add a new part of the same size as there were originally parts.'''

if([] == ap): return(ap)

np = [len(ap)]+[(part-1) for part in ap if part != 1]

np.sort() # Sort back into nondecreasing order.

return(np)

# Compare the next definition with the Python-prodecure for A227183:

def binexp_to_ascpart(n):

'''Convert n according to its binary expansion to a unique unordered partition, listed in nondecreasing order.'''

ap = []

b = n%2

i = 1

while (n != 0):

n >>= 1

if ((n%2) == b):

i += 1

else:

b = n%2

ap += [i]

return(ap)

def ascpart_to_binexp(ap):

'''Convert an unordered partition (listed in nondecreasing order) to an integer which encodes that partition.'''

n = 0

prevpart = 1

parity = (len(ap)%2)

p2 = 1

for part in ap:

runlen = (part - prevpart)+1

if (0 != parity): n += (((2**runlen)-1) * p2)

p2 <<= runlen

prevpart = part

parity = 1-parity

return(n)

STATUS

proposed

editing

Discussion
Fri Jul 26
05:09
Antti Karttunen: Okay, Python-program now transferred to http://oeis.org/A129594/a129594_1.txt
#24 by Antti Karttunen at Fri Jul 26 01:47:50 EDT 2013
STATUS

editing

proposed

Discussion
Fri Jul 26
02:15
T. D. Noe: When programs are long -- like this one -- we ask users to put them into a link.