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.

Previous Showing 11-16 of 16 results.

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

A243353 Permutation of natural numbers which maps between the partitions as encoded in A227739 (binary based system, zero-based) to A112798 (prime-index based system, one-based).

Original entry on oeis.org

1, 2, 4, 3, 9, 8, 6, 5, 25, 18, 16, 27, 15, 12, 10, 7, 49, 50, 36, 75, 81, 32, 54, 125, 35, 30, 24, 45, 21, 20, 14, 11, 121, 98, 100, 147, 225, 72, 150, 245, 625, 162, 64, 243, 375, 108, 250, 343, 77, 70, 60, 105, 135, 48, 90, 175, 55, 42, 40, 63, 33, 28, 22, 13, 169, 242, 196, 363, 441, 200, 294, 605, 1225, 450, 144
Offset: 0

Views

Author

Antti Karttunen, Jun 05 2014

Keywords

Comments

Note the indexing: the domain includes zero, but the range starts from one.

Crossrefs

A243354 gives the inverse mapping.

Programs

  • Mathematica
    f[n_, i_, x_] := Which[n == 0, x, EvenQ@ n, f[n/2, i + 1, x], True, f[(n - 1)/2, i, x Prime@ i]]; Table[f[BitXor[n, Floor[n/2]], 1, 1], {n, 0, 74}] (* Michael De Vlieger, May 09 2017 *)
  • Python
    from sympy import prime
    import math
    def A(n): return n - 2**int(math.floor(math.log(n, 2)))
    def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
    def a005940(n): return b(n - 1)
    def a003188(n): return n^int(n/2)
    def a243353(n): return a005940(1 + a003188(n)) # Indranil Ghosh, May 07 2017
  • Scheme
    (define (A243353 n) (A005940 (+ 1 (A003188 n))))
    

Formula

a(n) = A005940(1+A003188(n)).
a(n) = A241909(1+A075157(n)). [With A075157's original starting offset]
For all n >= 0, A243354(a(n)) = n.
A227183(n) = A056239(a(n)). [Maps between the corresponding sums ...]
A227184(n) = A003963(a(n)). [... and products of parts of each partition].
For n >= 0, a(A037481(n)) = A002110(n). [Also "triangular partitions", the fixed points of Bulgarian solitaire, A226062 & A242424].
For n >= 1, a(A227451(n+1)) = 4*A243054(n).

A242422 Numbers in whose prime factorization the indices of primes sum to a triangular number.

Original entry on oeis.org

1, 2, 5, 6, 8, 13, 21, 22, 25, 27, 28, 29, 30, 36, 40, 46, 47, 48, 57, 64, 73, 76, 85, 86, 91, 102, 107, 117, 121, 123, 130, 136, 142, 147, 151, 154, 156, 164, 165, 175, 185, 189, 196, 197, 198, 201, 206, 208, 210, 217, 220, 222, 225, 243, 250, 252, 257, 264, 268, 270, 279, 280, 296, 298, 299, 300
Offset: 1

Views

Author

Antti Karttunen, May 16 2014

Keywords

Comments

Numbers k such that A010054(A056239(k)) is one, or equally, that A002262(A056239(k)) is zero.
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.
This sequence answers the question when we implement the operation on the partition list A112798: These are all such numbers that starting iterating A242424 from them leads eventually to a fixed point, which will be one of the primorial numbers, A002110.
Contains the same terms as rows of A215366 indexed with triangular numbers (A000217: 0, 1, 3, 6, ...), although not in the same order. {1}, {2}, {5, 6, 8}, {13, 21, 22, 25, 27, 28, 30, 36, 40, 48, 64}, etc.
Heinz numbers of integer partitions of triangular numbers. The Heinz number of an integer partition (y_1, ..., y_k) is prime(y_1) * ... * prime(y_k). - Gus Wiseman, Nov 13 2018

Examples

			1 is present as it has an empty factorization, for which the sum of prime indices is zero, and zero is also a triangular number.
2 = p_1 is present as 1 is a triangular number.
6 = p_1 * p_2 is present, as 1+2 = 3 is a triangular number.
300 = 2*2*3*5*5 = p_1 * p_1 * p_2 * p_3 * p_3 is present, as 1+1+2+3+3 = 10 is a triangular number.
Any primorial number p_1 * p_2 * p_3 * ... * p_n is present, as 1+2+3+...+n is by definition a triangular number.
The sequence of all integer partitions whose Heinz numbers are in the sequence begins: (), (1), (3), (2,1), (1,1,1), (6), (4,2), (5,1), (3,3), (2,2,2), (4,1,1), (10), (3,2,1), (2,2,1,1), (3,1,1,1), (9,1), (15), (2,1,1,1,1), (8,2), (1,1,1,1,1,1), (21), (8,1,1), (7,3), (14,1), (6,4). - _Gus Wiseman_, Nov 13 2018
		

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

Complement: A242423.
A002110 (primorial numbers) is a subsequence.

Programs

  • Mathematica
    triQ[n_]:=Module[{k,i},For[k=n;i=1,k>0,i++,k-=i];k==0];
    Select[Range[100],triQ[Total[Cases[FactorInteger[#],{p_,k_}:>PrimePi[p]*k]]]&] (* Gus Wiseman, Nov 13 2018 *)

A243073 Third-order Bulgarian solitaire operation on partition list A112798: a(1) = 1, a(n) = A000040(A001222(n)) * A243072(A064989(n)).

Original entry on oeis.org

1, 2, 4, 3, 8, 6, 16, 5, 9, 12, 24, 10, 40, 24, 18, 7, 56, 15, 88, 20, 36, 36, 104, 14, 27, 60, 25, 40, 136, 30, 152, 11, 54, 84, 54, 21, 184, 132, 90, 28, 232, 60, 248, 60, 50, 156, 296, 22, 108, 45, 126, 100, 328, 35, 81, 56, 198, 204, 344, 42, 376, 228, 100, 13, 135
Offset: 1

Views

Author

Antti Karttunen, May 29 2014

Keywords

Comments

The usual (first-order) Bulgarian Solitaire operation (cf. A242424) 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.
In this context, where the parts of partitions are encoded with the indices of primes in the prime factorization of n (as in A112798), A064989(n) gives the remaining partition after one has been subtracted from each part; A243072 applies the second-order Bulgarian operation to it; and multiplying with A000040(A001222(n)) adds a part as large as there originally were parts.

Crossrefs

Row 3 of A243070. Differs from A122111 for the first time at n=11.

Formula

a(1) = 1, a(n) = A000040(A001222(n)) * A243072(A064989(n)) = A105560(n) * A243072(A064989(n)).
a(n) = A241909(A243053(A241909(n))).

A322809 Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(n) = -1 if n is an odd prime, and f(n) = floor(n/2) for all other numbers.

Original entry on oeis.org

1, 2, 3, 4, 3, 5, 3, 6, 6, 7, 3, 8, 3, 9, 9, 10, 3, 11, 3, 12, 12, 13, 3, 14, 14, 15, 15, 16, 3, 17, 3, 18, 18, 19, 19, 20, 3, 21, 21, 22, 3, 23, 3, 24, 24, 25, 3, 26, 26, 27, 27, 28, 3, 29, 29, 30, 30, 31, 3, 32, 3, 33, 33, 34, 34, 35, 3, 36, 36, 37, 3, 38, 3, 39, 39, 40, 40, 41, 3, 42, 42, 43, 3, 44, 44, 45, 45, 46, 3, 47, 47, 48, 48, 49, 49, 50, 3, 51, 51, 52, 3, 53, 3, 54, 54
Offset: 1

Views

Author

Antti Karttunen, Dec 26 2018

Keywords

Comments

This sequence is a restricted growth sequence transform of a function f which is defined as f(n) = A004526(n), unless n is an odd prime, in which case f(n) = -1, which is a constant not in range of A004526. See the Crossrefs section for a list of similar sequences.
For all i, j:
A305801(i) = A305801(j) => a(i) = a(j),
a(i) = a(j) => A039636(i) = A039636(j).
For all i, j: a(i) = a(j) <=> A323161(i+1) = A323161(j+1).
The shifted version of this filter, A323161, has a remarkable ability to find many sequences related to primes and prime chains. - Antti Karttunen, Jan 06 2019

Crossrefs

A list of few similarly constructed sequences follows, where each sequence is an rgs-transform of such function f, for which the value of f(n) is the n-th term of the sequence whose A-number follows after a parenthesis, unless n is of the form ..., in which case f(n) is given a constant value outside of the range of that sequence:
A322809 (A004526, unless an odd prime) [This sequence],
A322589 (A007913, unless an odd prime),
A322591 (A007947, unless an odd prime),
A322805 (A252463, unless an odd prime),
A323082 (A300840, unless an odd prime),
A322822 (A300840, unless n > 2 and a Fermi-Dirac prime, A050376),
A322988 (A322990, unless a prime power > 2),
A323078 (A097246, unless an odd prime),
A322808 (A097246, unless a squarefree number > 2),
A322816 (A048675, unless an odd prime),
A322807 (A285330, unless an odd prime),
A322814 (A286621, unless an odd prime),
A322824 (A242424, unless an odd prime),
A322973 (A006370, unless an odd prime),
A322974 (A049820, unless n > 1 and n is in A046642),
A323079 (A060681, unless an odd prime),
A322587 (A295887, unless an odd prime),
A322588 (A291751, unless an odd prime),
A322592 (A289625, unless an odd prime),
A323369 (A323368, unless an odd prime),
A323371 (A295886, unless an odd prime),
A323374 (A323373, unless an odd prime),
A323401 (A323372, unless an odd prime),
A323405 (A323404, unless an odd prime).

Programs

  • PARI
    up_to = 65537;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A322809aux(n) = if((n>2)&&isprime(n),-1,(n>>1));
    v322809 = rgs_transform(vector(up_to,n,A322809aux(n)));
    A322809(n) = v322809[n];

Formula

a(n) = A323161(n+1) - 1.

A242423 Numbers in whose prime factorization the indices of primes do not sum to a triangular number.

Original entry on oeis.org

3, 4, 7, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 23, 24, 26, 31, 32, 33, 34, 35, 37, 38, 39, 41, 42, 43, 44, 45, 49, 50, 51, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 74, 75, 77, 78, 79, 80, 81, 82, 83, 84, 87, 88, 89, 90, 92, 93, 94, 95, 96, 97, 98, 99, 100
Offset: 1

Views

Author

Antti Karttunen, May 16 2014

Keywords

Comments

Numbers k such that A010054(A056239(k)) is zero, or equally, such that A002262(A056239(k)) is not zero.
These are numbers such that any iterations of A242424 started from them lead eventually to a cycle greater than one. Please see the comments and references at A242422.

Examples

			3 = p_2 is present, because 2 is not a triangular number.
4 = p_1 * p_1 is present, because 1+1 = 2 is not a triangular number.
		

Crossrefs

Previous Showing 11-16 of 16 results.