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-6 of 6 results.

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

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

A064989 Multiplicative with a(2^e) = 1 and a(p^e) = prevprime(p)^e for odd primes p.

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 5, 1, 4, 3, 7, 2, 11, 5, 6, 1, 13, 4, 17, 3, 10, 7, 19, 2, 9, 11, 8, 5, 23, 6, 29, 1, 14, 13, 15, 4, 31, 17, 22, 3, 37, 10, 41, 7, 12, 19, 43, 2, 25, 9, 26, 11, 47, 8, 21, 5, 34, 23, 53, 6, 59, 29, 20, 1, 33, 14, 61, 13, 38, 15, 67, 4, 71, 31, 18, 17, 35, 22, 73, 3, 16
Offset: 1

Views

Author

Vladeta Jovovic, Oct 30 2001

Keywords

Comments

From Antti Karttunen, May 12 2014: (Start)
a(A003961(n)) = n for all n. [This is a left inverse function for the injection A003961.]
Bisections are A064216 (the terms at odd indices) and A064989 itself (the terms at even indices), i.e., a(2n) = a(n) for all n.
(End)
From Antti Karttunen, Dec 18-21 2014: (Start)
When n represents an unordered integer partition via the indices of primes present in its prime factorization (for n >= 2, n corresponds to the partition given as the n-th row of A112798) this operation subtracts one from each part. If n is of the form 2^k (a partition having just k 1's as its parts) the result is an empty partition (which is encoded by 1, having an "empty" factorization).
For all odd numbers n >= 3, a(n) tells which number is located immediately above n in square array A246278. Cf. also A246277.
(End)
Alternatively, if numbers are represented as the multiset of indices of prime factors with multiplicity, this operation subtracts 1 from each element and discards the 0's. - M. F. Hasler, Dec 29 2014

Examples

			a(20) = a(2^2*5) = a(2^2)*a(5) = prevprime(5) = 3.
		

Crossrefs

Cf. A064216 (odd bisection), A003961 (inverse), A151799.
Other sequences whose definition involve or are some other way related with this sequence: A105560, A108951, A118306, A122111, A156552, A163511, A200746, A241909, A243070, A243071, A243072, A243073, A244319, A245605, A245607, A246165, A246266, A246268, A246277, A246278, A246361, A246362, A246371, A246372, A246373, A246374, A246376, A246380, A246675, A246682, A249745, A250470.
Similar prime-shifts towards smaller numbers: A252461, A252462, A252463.

Programs

  • Haskell
    a064989 1 = 1
    a064989 n = product $ map (a008578 . a049084) $ a027746_row n
    -- Reinhard Zumkeller, Apr 09 2012
    (MIT/GNU Scheme, with Aubrey Jaffer's SLIB Scheme library)
    (require 'factor)
    (define (A064989 n) (if (= 1 n) n (apply * (map (lambda (k) (if (zero? k) 1 (A000040 k))) (map -1+ (map A049084 (factor n)))))))
    ;; Antti Karttunen, May 12 2014
    (definec (A064989 n) (if (= 1 n) n (* (A008578 (A055396 n)) (A064989 (A032742 n))))) ;; One based on given recurrence and utilizing memoizing definec-macro.
    (definec (A064989 n) (cond ((= 1 n) n) ((even? n) (A064989 (/ n 2))) (else (A163511 (/ (- (A243071 n) 1) 2))))) ;; Corresponds to one of the alternative formulas, but is very unpractical way to compute this sequence. - Antti Karttunen, Dec 18 2014
    
  • Maple
    q:= proc(p) prevprime(p) end proc: q(2):= 1:
    [seq(mul(q(f[1])^f[2], f = ifactors(n)[2]), n = 1 .. 1000)]; # Robert Israel, Dec 21 2014
  • Mathematica
    Table[Times @@ Power[Which[# == 1, 1, # == 2, 1, True, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger@ n, {n, 81}] (* Michael De Vlieger, Jan 04 2016 *)
  • PARI
    { for (n=1, 1000, f=factor(n)~; a=1; j=1; if (n>1 && f[1, 1]==2, j=2); for (i=j, length(f), a*=precprime(f[1, i] - 1)^f[2, i]); write("b064989.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 02 2009
    
  • PARI
    a(n) = {my(f = factor(n)); for (i=1, #f~, if ((p=f[i,1]) % 2, f[i,1] = precprime(p-1), f[i,1] = 1);); factorback(f);} \\ Michel Marcus, Dec 18 2014
    
  • PARI
    A064989(n)=factorback(Mat(apply(t->[max(precprime(t[1]-1),1),t[2]],Vec(factor(n)~))~)) \\ M. F. Hasler, Dec 29 2014
    
  • Python
    from sympy import factorint, prevprime
    from operator import mul
    from functools import reduce
    def a(n):
        f=factorint(n)
        return 1 if n==1 else reduce(mul, [1 if i==2 else prevprime(i)**f[i] for i in f])
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 15 2017
    
  • Python
    from math import prod
    from sympy import prevprime, factorint
    def A064989(n): return prod(prevprime(p)**e for p, e in  factorint(n>>(~n&n-1).bit_length()).items()) # Chai Wah Wu, Jan 05 2023

Formula

From Antti Karttunen, Dec 18 2014: (Start)
If n = product A000040(k)^e(k) then a(n) = product A008578(k)^e(k) [where A000040(n) gives the n-th prime, and A008578(n) gives 1 for 1 and otherwise the (n-1)-th prime].
a(1) = 1; for n > 1, a(n) = A008578(A055396(n)) * a(A032742(n)). [Above formula represented as a recurrence. Cf. A252461.]
a(1) = 1; for n > 1, a(n) = A008578(A061395(n)) * a(A052126(n)). [Compare to the formula of A252462.]
This prime-shift operation is used in the definitions of many other sequences, thus it can be expressed in many alternative ways:
a(n) = A200746(n) / n.
a(n) = A242424(n) / A105560(n).
a(n) = A122111(A122111(n)/A105560(n)) = A122111(A052126(A122111(n))). [In A112798-partition context: conjugate, remove the largest part (the largest prime factor), and conjugate again.]
a(1) = 1; for n > 1, a(2n) = a(n), a(2n+1) = A163511((A243071(2n+1)-1) / 2).
a(n) = A249818(A250470(A249817(n))). [A250470 is an analogous operation for "going one step up" in the square array A083221 (A083140).]
(End)
Product_{k=1..n} a(k) = n! / A307035(n). - Vaclav Kotesovec, Mar 21 2019
Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/2) * Product_{p prime} ((p^2-p)/(p^2-q(p))) = 0.220703928... , where q(p) = prevprime(p) (A151799) if p > 2 and q(2) = 1. - Amiram Eldar, Nov 18 2022

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.

A105560 a(1) = 1, and for n >= 2, a(n) = prime(bigomega(n)), where prime(n) = A000040(n) and bigomega(n) = A001222(n).

Original entry on oeis.org

1, 2, 2, 3, 2, 3, 2, 5, 3, 3, 2, 5, 2, 3, 3, 7, 2, 5, 2, 5, 3, 3, 2, 7, 3, 3, 5, 5, 2, 5, 2, 11, 3, 3, 3, 7, 2, 3, 3, 7, 2, 5, 2, 5, 5, 3, 2, 11, 3, 5, 3, 5, 2, 7, 3, 7, 3, 3, 2, 7, 2, 3, 5, 13, 3, 5, 2, 5, 3, 5, 2, 11, 2, 3, 5, 5, 3, 5, 2, 11, 7, 3, 2, 7, 3, 3, 3, 7, 2, 7, 3, 5, 3, 3, 3, 13, 2, 5, 5, 7
Offset: 1

Views

Author

Cino Hilliard, May 03 2005

Keywords

Comments

From Antti Karttunen, Jul 21 2014: (Start)
a(n) divides A122111(n), A242424(n), A243072(n), A243073(n) because a(n) divides all the terms in column n of A243070.
a(2n-1) divides A243505(n) and a(2n-1)^2 divides A122111(2n-1).
(End)

Crossrefs

Programs

  • Mathematica
    Table[Prime[Sum[FactorInteger[n][[i,2]],{i,1,Length[FactorInteger[n]]}]],{n,2,40}] (* Stefan Steinerberger, May 16 2007 *)
  • PARI
    d(n) = for(x=2,n,print1(prime(bigomega(x))","))
    
  • Python
    from sympy import prime, primefactors
    def a001222(n): return 0 if n==1 else a001222(n/primefactors(n)[0]) + 1
    def a(n): return 1 if n==1 else prime(a001222(n)) # Indranil Ghosh, Jun 15 2017

Formula

a(1) = 1, and for n >= 2, a(n) = A000040(A001222(n)).
From Antti Karttunen, Jul 21 2014: (Start)
a(n) = A008578(1 + A001222(n)).
a(n) = A006530(A122111(n)).
a(n) = A122111(n) / A122111(A064989(n)).
a(2n-1) = A122111(2n-1) / A243505(n).
a(n) = A242424(n) / A064989(n).
(End)

Extensions

a(1) = 1 prepended by Antti Karttunen, Jul 21 2014

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

Original entry on oeis.org

1, 2, 1, 4, 2, 1, 3, 4, 2, 1, 6, 3, 4, 2, 1, 6, 8, 3, 4, 2, 1, 10, 6, 8, 3, 4, 2, 1, 5, 12, 6, 8, 3, 4, 2, 1, 12, 5, 16, 6, 8, 3, 4, 2, 1, 9, 9, 5, 16, 6, 8, 3, 4, 2, 1, 14, 12, 9, 5, 16, 6, 8, 3, 4, 2, 1, 10, 20, 12, 9, 5, 16, 6, 8, 3, 4, 2, 1, 22, 10, 24, 12, 9, 5, 16, 6, 8, 3, 4, 2, 1, 15, 28, 10, 32, 12, 9, 5, 16, 6, 8, 3, 4, 2, 1, 18, 18, 40, 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), ... .
Please see comments and references in A242424 for more information about Bulgarian Solitaire.
Each row is a A241909-conjugate of the corresponding row in A243060.
Rows in both arrays converge towards A122111.
All the terms in column n are multiples of A105560(n).
The rows of this table (i.e., the corresponding functions) preserve A056239.
First point where row k differs from row k of A243060 seems to be A000040(k+2): primes from five onward: 5, 7, 11, 13, 17, 19, 23, 29, 31, ... and these seem to be also the points where that row differs for the first time from A122111.

Examples

			The top left corner of the array is:
  1,  2,  4,  3,  6,  6, 10,  5, 12,  9, 14, 10, 22, 15, 18, ...
  1,  2,  4,  3,  8,  6, 12,  5,  9, 12, 20, 10, 28, 18, 18, ...
  1,  2,  4,  3,  8,  6, 16,  5,  9, 12, 24, 10, 40, 24, 18, ...
  1,  2,  4,  3,  8,  6, 16,  5,  9, 12, 32, 10, 48, 24, 18, ...
  1,  2,  4,  3,  8,  6, 16,  5,  9, 12, 32, 10, 64, 24, 18, ...
		

Crossrefs

Row 1: A242424, Row 2: A243072, Row 3: A243073.
Rows converge towards A122111.

Programs

Formula

A(1,col) = A242424(col), otherwise, when row > 1, A(row,col) = A000040(A001222(col)) * A(row-1, A064989(col)).
Showing 1-6 of 6 results.