cp's OEIS Frontend

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.

Showing 1-8 of 8 results.

A243060 Square array read by antidiagonals: rows are successively recursivized versions of Bulgarian solitaire operation (starting from the usual "first order" version, A243051), as applied to partitions listed in A241918.

Original entry on oeis.org

1, 2, 1, 4, 2, 1, 3, 4, 2, 1, 8, 3, 4, 2, 1, 25, 8, 3, 4, 2, 1, 16, 6, 8, 3, 4, 2, 1, 9, 16, 6, 8, 3, 4, 2, 1, 9, 5, 16, 6, 8, 3, 4, 2, 1, 343, 9, 5, 16, 6, 8, 3, 4, 2, 1, 32, 12, 9, 5, 16, 6, 8, 3, 4, 2, 1, 10, 32, 12, 9, 5, 16, 6, 8, 3, 4, 2, 1, 64, 35, 32, 12, 9, 5, 16, 6, 8, 3, 4, 2, 1, 14641, 64, 10, 32, 12, 9, 5, 16, 6, 8, 3, 4, 2, 1, 125, 24, 64, 10, 32, 12, 9, 5, 16, 6, 8, 3, 4, 2, 1
Offset: 1

Views

Author

Antti Karttunen, May 29 2014

Keywords

Comments

The array is read by antidiagonals: A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), ... .
Each row is a A241909-conjugate of the corresponding row in A243070.
Rows in both arrays converge towards A122111.
First point where row k differs from row k of A243070 seems to be A000040(k+2): primes from five onward: 5, 7, 11, 13, 17, 19, 23, 29, 31, ...
While the first point where row k differs from A122111 seems to begin as 6, 12, 24, 48, 96, 192, 384, 768, 1536, 3072, ... A007283 (3*2^n) from the term n=1 onward.
The rows in this table preserve A243503.

Examples

			The top left corner of the array:
  1, 2, 4, 3, 8, 25, 16, 9, 9, 343,  32,  10,  64, 14641,   125,   27, ...
  1, 2, 4, 3, 8,  6, 16, 5, 9,  12,  32,  35,  64,    24,    18,   25, ...
  1, 2, 4, 3, 8,  6, 16, 5, 9,  12,  32,  10,  64,    24,    18,    7, ...
  1, 2, 4, 3, 8,  6, 16, 5, 9,  12,  32,  10,  64,    24,    18,    7, ...
  1, 2, 4, 3, 8,  6, 16, 5, 9,  12,  32,  10,  64,    24,    18,    7, ...
		

Crossrefs

Row 1: A243051, Row 2: A243052, Row 3: A243053.
Rows converge towards A122111.

Programs

  • Scheme
    (define (A243060 n) (A243060bi (A002260 n) (A004736 n)))
    (define (A243060bi row col) (explist->n (ascpart_to_prime-exps (bulgarian-operation-n-th-order (prime-exps_to_ascpart (primefacs->explist col)) row))))
    (define (bulgarian-operation-n-th-order ascpart n) (if (or (zero? n) (null? ascpart)) ascpart (let ((newpart (length ascpart))) (let loop ((newpartition (list)) (ascpart ascpart)) (cond ((null? ascpart) (sort (cons newpart (bulgarian-operation-n-th-order newpartition (- n 1))) <)) (else (loop (if (= 1 (car ascpart)) newpartition (cons (- (car ascpart) 1) newpartition)) (cdr ascpart))))))))
    ;; For other required functions and libraries, please see A243051.

A241909 Self-inverse permutation of natural numbers: a(1)=1, a(p_i) = 2^i, and if n = p_i1 * p_i2 * p_i3 * ... * p_{ik-1} * p_ik, where p's are primes, with their indexes are sorted into nondescending order: i1 <= i2 <= i3 <= ... <= i_{k-1} <= ik, then a(n) = 2^(i1-1) * 3^(i2-i1) * 5^(i3-i2) * ... * p_k^(1+(ik-i_{k-1})). Here k = A001222(n) and ik = A061395(n).

Original entry on oeis.org

1, 2, 4, 3, 8, 9, 16, 5, 6, 27, 32, 25, 64, 81, 18, 7, 128, 15, 256, 125, 54, 243, 512, 49, 12, 729, 10, 625, 1024, 75, 2048, 11, 162, 2187, 36, 35, 4096, 6561, 486, 343, 8192, 375, 16384, 3125, 50, 19683, 32768, 121, 24, 45, 1458, 15625, 65536, 21, 108, 2401
Offset: 1

Views

Author

Antti Karttunen, May 03 2014, partly inspired by Marc LeBrun's Jan 11 2006 message on SeqFan mailing list

Keywords

Comments

This permutation maps between the partitions as ordered in A112798 and A241918 (the original motivation for this sequence).
For all n > 2, A007814(a(n)) = A055396(n)-1, which implies that this self-inverse permutation maps between primes (A000040) and the powers of two larger than one (A000079(n>=1)), and apart from a(1) & a(2), this also maps each even number to some odd number, and vice versa, which means there are no fixed points after 2.
A122111 commutes with this one, that is, a(n) = A122111(a(A122111(n))).
Conjugates between A243051 and A242424 and other rows of A243060 and A243070.

Examples

			For n = 12 = 2 * 2 * 3 = p_1 * p_1 * p_2, we obtain by the first formula 2^(1-1) * 3^(1-1) * 5^(1+(2-1)) = 5^2 = 25. By the second formula, as n = 2^2 * 3^1, we obtain the same result, p_{1+2} * p_{2+1} = p_3 * p_3 = 25, thus a(12) = 25.
Using the product formula over the terms of row n of table A241918, we see, because 9450 = 2*3*3*3*5*5*7 = p_1^1 * p_2^3 * p_3^2 * p_4^1, that the corresponding row in A241918 is {2,5,7,7}, and multiplying p_2 * p_5 * p_7^2 yields 3 * 11 * 17 * 17 = 9537, thus a(9450) = 9537.
Similarly, for 9537, the corresponding row in A241918 is {1,2,2,2,3,3,4}, and multiplying p_1^1 * p_2^3 * p_3^2 * p_4^1, we obtain 9450 back.
		

Crossrefs

Cf. also A278220 (= A046523(a(n))), A331280 (its rgs_transform), A331299 (= min(n,a(n))).
{A000027, A122111, A241909, A241916} form a 4-group.

Programs

  • Haskell
    a241909 1 = 1
    a241909 n = product $ zipWith (^) a000040_list $ zipWith (-) is (1 : is)
                where is = reverse ((j + 1) : js)
                      (j:js) = reverse $ map a049084 $ a027746_row n
    -- Reinhard Zumkeller, Aug 04 2014
    
  • Mathematica
    Array[If[# == 1, 1, Function[t, Times @@ Prime@ Accumulate[If[Length@ t < 2, {0}, Join[{1}, ConstantArray[0, Length@ t - 2], {-1}]] + ReplacePart[t, Map[#1 -> #2 & @@ # &, #]]]]@ ConstantArray[0, Transpose[#][[1, -1]]] &[FactorInteger[#] /. {p_, e_} /; p > 0 :> {PrimePi@ p, e}]] &, 56] (* Michael De Vlieger, Jan 23 2020 *)
  • PARI
    A241909(n) = if(1==n||isprime(n),2^primepi(n),my(f=factor(n),h=1,i,m=1,p=1,k=1); while(k<=#f~, p = nextprime(1+p); i = primepi(f[k,1]); m *= p^(i-h); h = i; if(f[k,2]>1, f[k,2]--, k++)); (p*m)); \\ Antti Karttunen, Jan 17 2020

Formula

If n is a prime with index i (p_i), then a(n) = 2^i, otherwise when n = p_i1 * p_i2 * p_i3 * ... p_ik, where p_i1, p_i2, p_i3, ..., p_ik are the primes present (not necessarily all distinct) in the prime factorization of n, sorted into nondescending order, a(n) = 2^(i1-1) * 3^(i2-i1) * 5^(i3-i2) * ... * p_k^(1+(ik-i_{k-1})).
Equally, if n = 2^k, then a(n) = p_k, otherwise, when n = 2^e1 * 3^e2 * 5^e3 * ... * p_k^{e_k}, i.e., where e1 ... e_k are the exponents (some of them possibly zero, except the last) of the primes 2, 3, 5, ... in the prime factorization of n, a(n) = p_{1+e1} * p_{1+e1+e2} * p_{1+e1+e2+e3} * ... * p_{e1+e2+e3+...+e_k}.
From the equivalence of the above two formulas (which are inverses of each other) it follows that a(a(n)) = n, i.e., that this permutation is an involution. For a proof, please see the attached notes.
The first formula corresponds to this recurrence:
a(1) = 1, a(p_k) = 2^k for primes with index k, otherwise a(n) = (A000040(A001222(n))^(A241917(n)+1)) * A052126(a(A052126(n))).
And the latter formula with this recurrence:
a(1) = 1, and for n>1, if n = 2^k, a(n) = A000040(k), otherwise a(n) = A000040(A001511(n)) * A242378(A007814(n), a(A064989(n))).
[Here A242378(k,n) changes each prime p(i) in the prime factorization of n to p(i+k), i.e., it's the result of A003961 iterated k times starting from n.]
We also have:
a(1)=1, and for n>1, a(n) = Product_{i=A203623(n-1)+2..A203623(n)+1} A000040(A241918(i)).
For all n >= 1, A001222(a(n)) = A061395(n), and vice versa, A061395(a(n)) = A001222(n).
For all n > 1, a(2n-1) = 2*a(A064216(n)).

Extensions

Typos in the name corrected by Antti Karttunen, May 31 2014

A242424 Bulgarian solitaire operation on partition list A112798: a(1) = 1, a(n) = A000040(A001222(n)) * A064989(n).

Original entry on oeis.org

1, 2, 4, 3, 6, 6, 10, 5, 12, 9, 14, 10, 22, 15, 18, 7, 26, 20, 34, 15, 30, 21, 38, 14, 27, 33, 40, 25, 46, 30, 58, 11, 42, 39, 45, 28, 62, 51, 66, 21, 74, 50, 82, 35, 60, 57, 86, 22, 75, 45, 78, 55, 94, 56, 63, 35, 102, 69, 106, 42, 118, 87, 100, 13, 99, 70, 122, 65
Offset: 1

Views

Author

Antti Karttunen, May 13 2014

Keywords

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 A112798.
Please compare to the definition of A122111, which conjugates the partitions encoded with the same system.
a(n) is even if and only if n is either a prime or a multiple of three.
Conversely, a(n) is odd if and only if n is a nonprime not divisible by three.

References

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

Crossrefs

Row 1 of A243070 (table which gives successive "recursive iterates" of this sequence and converges towards A122111).
Fixed points: A002110 (primorial numbers).

Programs

Formula

a(1) = 1, a(n) = A000040(A001222(n)) * A064989(n) = A105560(n) * A064989(n).
a(n) = A241909(A243051(A241909(n))).
a(n) = A243353(A226062(A243354(n))).
a(A000079(n)) = A000040(n) for all n.
A056239(a(n)) = A056239(n) for all n.

A226062 a(n) = Bulgarian solitaire operation applied to the partition encoded in the runlengths of binary expansion of n.

Original entry on oeis.org

0, 1, 3, 2, 13, 7, 6, 6, 11, 29, 15, 58, 9, 14, 4, 14, 19, 27, 61, 54, 245, 31, 122, 52, 27, 25, 30, 50, 25, 12, 12, 30, 35, 23, 59, 46, 237, 125, 118, 44, 235, 501, 63, 1002, 233, 250, 116, 40, 51, 19, 57, 38, 229, 62, 114, 36, 59, 17, 28, 34, 57, 8, 28, 62
Offset: 0

Views

Author

Antti Karttunen, Jul 06 2013

Keywords

Comments

For this sequence the partitions are encoded in the binary expansion of n in the same way as in A129594.
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. The question originally posed was: on what condition the resulting partitions will eventually reach a fixed point, that is, a collection of piles that will be unchanged by the operation. See Martin Gardner reference and the Wikipedia-page.
A037481 gives the fixed points of this sequence, which are numbers that encode triangular partitions: 1 + 2 + 3 + ... + n.
A227752(n) tells how many times n occurs in this sequence, and A227753 gives the terms that do not occur here.
Of further interest: among each A000041(n) numbers j_i: j1, j2, ..., jk for which A227183(j_i)=n, how many cycles occur and what is the size of the largest one? (Both are 1 when n is in A000217, as then the fixed points are the only cycles.) Cf. A185700, A188160.
Also, A123975 answers how many Garden of Eden partitions there are for the deck of size n in Bulgarian Solitaire, corresponding to values that do not occur as the terms of this sequence.

Examples

			5 has binary expansion "101", whose runlengths are [1,1,1], which are converted to nonordered partition {1+1+1}.
6 has binary expansion "110", whose runlengths are [1,2] (we scan the runs of bits from right to left), which are converted to nonordered partition {1+2}.
7 has binary expansion "111", whose list of runlengths is [3], which is converted to partition {3}.
In "Bulgarian Operation" we subtract one from each part (with 1-parts vanishing), and then add a new part of the same size as there originally were parts, so that the total sum stays same.
Thus starting from a partition encoded by 5, {1,1,1} the operation works as 1-1, 1-1, 1-1 (all three 1's vanish) but appends part 3 as there originally were three parts, thus we get a new partition {3}. Thus a(5)=7.
From the partition {3} -> 3-1 and 1, which gives a new partition {1,2}, so a(7)=6.
For partition {1+2} -> 1-1 and 2-1, thus the first part vanishes, and the second is now 1, to which we add the new part 2, as there were two parts originally, thus {1+2} stays as {1+2}, and we have reached a fixed point, a(6)=6.
		

References

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

Crossrefs

Cf. A037481 (gives the fixed points).
Cf. A227752 (how many times n occurs here).
Cf. A227753 (numbers that do not occur here).
Cf. A129594 (conjugates the partitions encoded with the same system).

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

A243503 Sums of parts of partitions (i.e., their sizes) as ordered in the table A241918: a(n) = Sum_{i=A203623(n-1)+2..A203623(n)+1} A241918(i).

Original entry on oeis.org

0, 1, 2, 2, 3, 4, 4, 3, 3, 6, 5, 6, 6, 8, 5, 4, 7, 5, 8, 9, 7, 10, 9, 8, 4, 12, 4, 12, 10, 8, 11, 5, 9, 14, 6, 7, 12, 16, 11, 12, 13, 11, 14, 15, 7, 18, 15, 10, 5, 7, 13, 18, 16, 6, 8, 16, 15, 20, 17, 11, 18, 22, 10, 6, 10, 14, 19, 21, 17, 10, 20, 9, 21, 24, 6, 24
Offset: 1

Views

Author

Antti Karttunen, Jun 05 2014

Keywords

Comments

Each n occurs A000041(n) times in total.
Where are the first and the last occurrence of each n located?

Crossrefs

Cf. A243504 (the products of parts), A241918, A000041, A227183, A075158, A056239, A241909.
Sum of prime indices of A241916, the even bisection of A358195.
Sums of even-indexed rows of A358172.
A112798 lists prime indices, length A001222, sum A056239, max A061395.

Programs

  • Mathematica
    Table[If[n==1,0,With[{y=Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]},Last[y]*Length[y]+Last[y]-Total[y]+Length[y]-1]],{n,100}] (* Gus Wiseman, Jan 09 2023 *)

Formula

a(n) = Sum_{i=A203623(n-1)+2..A203623(n)+1} A241918(i).
a(n) = A056239(A241909(n)).
a(n) = A227183(A075158(n-1)).
a(A000040(n)) = a(A000079(n)) = n for all n >= 1.
a(A122111(n)) = a(n) for all n.
a(A243051(n)) = a(n) for all n, and likewise for A243052, A243053 and other rows of A243060.
a(n) = A061395(n) * A001222(n) + A061395(n) - A056239(n) + A001222(n) - 1. - Gus Wiseman, Jan 09 2023
a(n) = A326844(2n) + A001222(n). - Gus Wiseman, Jan 09 2023

A243052 Integer sequence induced by second order Bulgarian solitaire operation on partition list A241918: a(n) = A241909(A243072(A241909(n))).

Original entry on oeis.org

1, 2, 4, 3, 8, 6, 16, 5, 9, 12, 32, 35, 64, 24, 18, 25, 128, 15, 256, 539, 36, 48, 512, 14, 27, 96, 25, 17303, 1024, 175, 2048, 125, 72, 192, 54, 21, 4096, 384, 144, 154, 8192, 3773, 16384, 485537, 245, 768, 32768, 70, 81, 45, 288, 26977283, 65536, 10, 108, 3146, 576, 1536, 131072
Offset: 1

Views

Author

Antti Karttunen, May 29 2014

Keywords

Comments

The usual Bulgarian Solitaire operation (the "first order" version, cf. A243051) applied to an unordered integer partition means: subtract one from each part, and add a new part as large as there were parts in the old partition.
The "Second Order Bulgarian Solitaire" operation means that after subtracting one from each part of the old partition (and discarding the parts that diminished to zero), we apply the (first order) Bulgarian operation to the remaining partition before adding a new part as large as there were parts in the original partition.
How the partitions are encoded in this case, please see A241918.

Crossrefs

Second row of A243060.

Programs

  • Scheme
    (define (A243052 n) (explist->n (ascpart_to_prime-exps (bulgarian-operation-n-th-order (prime-exps_to_ascpart (primefacs->explist n)) 2))))
    (define (bulgarian-operation-n-th-order ascpart n) (if (or (zero? n) (null? ascpart)) ascpart (let ((newpart (length ascpart))) (let loop ((newpartition (list)) (ascpart ascpart)) (cond ((null? ascpart) (sort (cons newpart (bulgarian-operation-n-th-order newpartition (- n 1))) <)) (else (loop (if (= 1 (car ascpart)) newpartition (cons (- (car ascpart) 1) newpartition)) (cdr ascpart))))))))
    ;; Other required functions and libraries, please see A243051.

Formula

a(n) = A241909(A243072(A241909(n))).

A243053 Integer sequence induced by third-order Bulgarian solitaire operation on partition list A241918: a(n) = A241909(A243073(A241909(n))).

Original entry on oeis.org

1, 2, 4, 3, 8, 6, 16, 5, 9, 12, 32, 10, 64, 24, 18, 7, 128, 15, 256, 20, 36, 48, 512, 55, 27, 96, 25, 40, 1024, 30, 2048, 49, 72, 192, 54, 21, 4096, 384, 144, 637, 8192, 60, 16384, 80, 50, 768, 32768, 22, 81, 45, 288, 160, 65536, 35, 108, 22627, 576, 1536, 131072
Offset: 1

Views

Author

Antti Karttunen, May 29 2014

Keywords

Comments

The usual (first-order) Bulgarian Solitaire operation (cf. A243051) applied to an unordered integer partition means: subtract one from each part, and add a new part as large as there were parts in the old partition.
The "Second-Order Bulgarian Operation" means that after subtracting one from each part of the old partition (and discarding the parts that diminished to zero), we apply the (first-order) Bulgarian operation to the remaining partition before adding a new part as large as there were parts in the original partition.
Similarly, in "Third-Order Bulgarian Solitaire Operation", we apply the Second-Order Bulgarian operation to the remaining partition (after we have subtracted one from each part) before adding a new part as large as there were parts in the original partition.
How the partitions are encoded in this case, see A241918.

Crossrefs

Third row of A243060.
Differs from A122111 for the first time at n=24, where a(24) = 55, while A122111(24) = 14.

Programs

  • Scheme
    (define (A243053 n) (explist->n (ascpart_to_prime-exps (bulgarian-operation-n-th-order (prime-exps_to_ascpart (primefacs->explist n)) 3))))
    (define (bulgarian-operation-n-th-order ascpart n) (if (or (zero? n) (null? ascpart)) ascpart (let ((newpart (length ascpart))) (let loop ((newpartition (list)) (ascpart ascpart)) (cond ((null? ascpart) (sort (cons newpart (bulgarian-operation-n-th-order newpartition (- n 1))) <)) (else (loop (if (= 1 (car ascpart)) newpartition (cons (- (car ascpart) 1) newpartition)) (cdr ascpart))))))))
    ;; Other required functions and libraries, please see A243051.

Formula

a(n) = A241909(A243073(A241909(n))).

A243054 a(0)=1, and for n >= 1, a(n) = p_n * A002110(n) / 2, where p_n is the n-th prime.

Original entry on oeis.org

1, 2, 9, 75, 735, 12705, 195195, 4339335, 92147055, 2565568005, 93810551835, 3108687597015, 137283655493985, 6237130402307805, 281279368630905645, 14449909890829548135, 863612699645536185345, 56721430329549272852565, 3577295631461912614989735, 263253771961188946371949515
Offset: 0

Views

Author

Antti Karttunen, May 29 2014

Keywords

Comments

Fixed points of A243051.
From n >= 2 onward: a(n) = the product of the first n-1 odd primes multiplied by the n-th prime.

Crossrefs

Programs

Formula

a(0)=1, and for n >= 1, a(n) = A000040(n)*A002110(n)/2.
a(0)=1, a(1)=2 and for n >= 2, a(n) = A006530(A070826(n)) * A070826(n).
Showing 1-8 of 8 results.