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-10 of 13 results. Next

A061058 Duplicate of A060795.

Original entry on oeis.org

1, 2, 5, 14, 42, 165, 714, 3094, 14858, 79534, 447051, 2714690, 17395070
Offset: 1

Views

Author

Keywords

A277428 a(n) = the n-bit number in which the i-th bit is 1 if and only if prime(i) divides A060795(n).

Original entry on oeis.org

0, 1, 4, 9, 11, 22, 75, 105, 449, 425, 1426, 2837, 4765, 2775, 21895, 57558, 87602, 145177, 123788, 694479, 677326, 1516496, 3363284, 2048443, 26968428, 24488513, 98733728
Offset: 1

Views

Author

Luc Rousseau, Oct 14 2016

Keywords

Comments

a(n) is also the n-bit number in which the i-th bit is 1 if and only if prime(i) does not divide A060796(n).
a(n) is also the encoding of the fraction defined as follows:
Consider the set of fractions that can be built by only using each prime number from prime(1) to prime(n) exactly once as factors, either in the numerator or in the numerator. There are 2^n such fractions. One of them, let's call it x, has the property of yielding the result nearest to 1. a(n) is the n-bit number in which the i-th bit is 1 if prime(i) appears in the numerator of x, 0 if prime(i) appears in the denominator of x.
Remark: x is A060795(n) / A060796(n). Notice how in this prime-rank-to-bit representation, A060795(n) and A060796(n) are each other's bitwise negation.

Examples

			For n = 1, two distinct fractions can be written with the first prime number, namely 1/2 and 2. Of the two, 1/2 is nearer to 1. 1/2 has its 2 below the fraction bar, so its binary encoding is 0, which yields a(1) = 0.
For n = 2, four distinct fractions can be written with the first two prime numbers, namely 1/6, 2/3, 3/2 and 6. 2/3 is the nearest to 1. 2/3 has its 2 above the fraction bar and its 3 below, so its encoding is 01, which yields a(2) = 1.
		

Crossrefs

Encodes A060795 and A060796. Cf. A002110, A261144.

Programs

  • Java
    package oeis;
    public class BinaryEncodedBestPrimeSetup {
      // Brute force implementation... Can it be improved?
    public static int PRIME[] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, /* to be continued */ };
    public static void main(String args[]) {
      int nMax = PRIME.length; // number of terms of the sequence
      for (int n = 1; n <= nMax; n ++) {
       if (n > 1) {
        System.out.print(", ");
       }
       System.out.print(u(n));
      }
    }
    private static int u(int n) {
      double bestMul = 0.0;
      int bestSetup = -1;
      int s = 0; // binary-encoded setup number
      for (s = 0; s < (1 << n); s ++) {
       double mul = 1.0;
       int i = 0; // prime number #
       for (i = 0; i < n; i ++) {
        if ((s & (1 << i)) != 0) {
         mul *= PRIME[i]; // 1 = above fraction bar
        } else {
         mul /= PRIME[i]; // 0 = below fraction bar
        }
       }
       if (mul < 1.0) {
        if (mul > bestMul) {
         bestMul = mul;
         bestSetup = s;
        }
       }
      }
      return bestSetup;
    }
    }
    
  • Mathematica
    {0}~Join~Table[Function[p, FromDigits[#, 2] &@ Reverse@ MapAt[# + 1 &, ConstantArray[0, n], Partition[#, 1, 1]] &@ PrimePi@ FactorInteger[Numerator@ #][[All, 1]] &@ Max@ Select[Map[p/#^2 &, Divisors@ p], # < 1 &]][Times @@ Prime@ Range@ n], {n, 2, 23}] (* Michael De Vlieger, Oct 19 2016 *)
  • PARI
    a060795(n) = my(m=prod(i=1, n, prime(i))); divisors(m)[numdiv(m)\2];
    a(n) = {my(a95 = a060795(n)); v = vector(n, i, (a95 % prime(i))==0); subst(Polrev(v), x, 2); } \\ Michel Marcus, Dec 03 2016

Extensions

a(22)-a(27) from Michael De Vlieger, Oct 19 2016

A060796 Upper central divisor of n-th primorial.

Original entry on oeis.org

2, 3, 6, 15, 55, 182, 715, 3135, 15015, 81345, 448630, 2733549, 17490603, 114388729, 785147363, 5708795638, 43850489690, 342503171205, 2803419704514, 23622001517543, 201817933409378, 1793779635410490, 16342166369958702, 154171363634898185, 1518410187442699518, 15259831781575946565
Offset: 1

Views

Author

Labos Elemer, Apr 27 2001

Keywords

Comments

Also: Write product of first n primes as x*y with x < y and x maximal; sequence gives value of y. Indeed, p(n)# = primorial(n) = A002110(n) is never a square for n >= 1; all exponents in the prime factorization are 1. Therefore primorial(n) has N = 2^n distinct divisors. Since this is an even number, the N divisors can be grouped in N/2 pairs {d(k), d(N+1-k)} with product equal to p(n)#. One of the two is always smaller and one is larger than sqrt(p(n)#). This sequence gives the (2^(n-1)+1)-th divisor, which is the smallest one larger than sqrt(p(n)#). - M. F. Hasler, Sep 20 2011

Examples

			n = 8, q(8) = 2*3*5*7*11*13*17*19 = 9699690. Its 128th and 129th divisors are {3094, 3135}: a(8) = 3135, and 3094 < A000196(9699690) = 3114 < 3135. [Corrected by _M. F. Hasler_, Sep 20 2011]
		

Crossrefs

Programs

  • Mathematica
    k = 1; Do[k *= Prime[n]; l = Divisors[k]; x = Length[l]; Print[l[[x/2 + 1]]], {n, 1, 24}] (* Ryan Propper, Jul 25 2005 *)
  • PARI
    A060796(n) = divisors(prod(k=1,n,prime(k)))[2^(n-1)+1] \\ Requires stack size > 2^(n+5). - M. F. Hasler, Sep 20 2011

Formula

a(n) = A033677(A002110(n)).
a(n) = A002110(n)/A060795(n). - M. F. Hasler, Mar 21 2022

Extensions

More terms from Ryan Propper, Jul 25 2005
a(24)-a(37) in b-file calculated from A182987 by M. F. Hasler, Sep 20 2011
a(38) from David A. Corneth, Mar 21 2022
a(39)-a(70) in b-file from Max Alekseyev, Apr 20 2022

A061030 Factorial splitting: write n! = x*y*z with x

Original entry on oeis.org

1, 2, 4, 8, 15, 32, 64, 144, 330, 768, 1800, 4368, 10800, 27300, 70560, 184800, 494208, 1343680, 3704400, 10388250, 29560960, 85250880, 249318000, 738720000, 2216160000, 6729074352, 20675655000, 64247758848, 201820667904
Offset: 3

Views

Author

Ed Pegg Jr, May 25 2001

Keywords

Examples

			For n = 6, 6! = 720 = 8*9*10, so x=8, y=9, z=10.
		

References

  • Luc Kumps, personal communication.

Crossrefs

Extensions

a(10) and a(11) corrected and a(14)-a(31) from Donovan Johnson, May 11 2010

A061032 Factorial splitting: write n! = x*y*z with x

Original entry on oeis.org

3, 4, 6, 10, 21, 36, 81, 168, 360, 810, 1872, 4480, 11088, 27720, 71280, 186368, 496128, 1347192, 3720960, 10407936, 29576988, 85322160, 249500160, 738904320, 2216712960, 6732000000, 20680540160, 64260000000, 201860859375
Offset: 3

Views

Author

Ed Pegg Jr, May 25 2001

Keywords

Comments

We first maximize x and then minimize z, which may be different from doing the opposite way around. For example, 7! = 15*16*21 = 14*18*20 is the case when absolute maximum of x (=15) and absolute minimum of z (=20) cannot be achieved together. - Max Alekseyev, Jun 18 2022

References

  • Luc Kumps, personal communication.

Crossrefs

Extensions

a(10) and a(11) corrected and a(14)-a(31) from Donovan Johnson, May 11 2010
Definition and a(14), a(18), a(24) are corrected by Max Alekseyev, Apr 10 2022

A061031 Factorial splitting: write n! = x*y*z with x

Original entry on oeis.org

2, 3, 5, 9, 16, 35, 70, 150, 336, 770, 1848, 4455, 10920, 27648, 70720, 185895, 496125, 1344000, 3706560, 10395840, 29568000, 85299200, 249356800, 738840960, 2216522880, 6730407936, 20678434920, 64248260076, 201838500864
Offset: 3

Views

Author

Ed Pegg Jr, May 25 2001

Keywords

Comments

We first maximize x and then minimize z, which may be different from doing the opposite way around. For example, 7! = 15*16*21 = 14*18*20 is the case when absolute maximum of x (=15) and absolute minimum of z (=20) cannot be achieved together. - Max Alekseyev, Jun 18 2022

References

  • Luc Kumps, personal communication.

Crossrefs

Extensions

a(10) and a(11) corrected and a(14)-a(31) from Donovan Johnson, May 11 2010
Definition and a(14), a(18), a(24) are corrected by Max Alekseyev, Apr 10 2022

A061057 Factorial splitting: write n! = x*y with x <= y and x maximal; sequence gives value of y-x.

Original entry on oeis.org

0, 1, 1, 2, 2, 6, 2, 18, 54, 30, 36, 576, 127, 840, 928, 3712, 20160, 93696, 420480, 800640, 1305696, 7983360, 55056804, 65318400, 326592000, 2286926400, 2610934480, 13680979200, 18906930876, 674165366496, 326850970500, 16753029012720, 16880461678080
Offset: 1

Views

Author

Ed Pegg Jr, May 28 2001

Keywords

Comments

Difference between central divisors of n!. - Jaume Oliver Lafont, Mar 13 2009
For n > 1, n! will never be a square, because of primes in the last half of the factors. Therefore the divisors of n! come in pairs (x,y) with x*y = n! and x < y. The sequence gives the difference y-x between the pair nearest to the square root of n!. - Alois P. Heinz, Jul 06 2009
a(n) = 2 iff n belongs to A146968. - Max Alekseyev, Feb 06 2010

Examples

			2! = 1*2, with difference of 1.
3! = 2*3, with difference of 1.
4! = 4*6, with difference of 2.
5! = 10*12, with difference of 2.
6! = 24*30, with difference of 6.
7! = 70*72 with difference of 2.
The corresponding central divisors are two units apart (equivalently, n!+1=A038507(n) is a square) for n = 4, 5, 7 (see A146968).
		

Crossrefs

Programs

  • Maple
    A060777 := proc(n) local d,nd ; d := sort(convert(numtheory[divisors](n!),list)) ; nd := nops(d) ; op(floor(1+nd/2),d) ; end:
    A060776 := proc(n) local d,nd ; d := sort(convert(numtheory[divisors](n!),list)) ; nd := nops(d) ; op(floor(nd/2),d) ; end:
    A061057 := proc(n) A060777(n)-A060776(n) ; end:
    seq(A061057(n),n=2..27) ; # R. J. Mathar, Mar 14 2009
  • Mathematica
    Do[ With[ {k = Floor[ Sqrt[ x! ] ] - Do[ If[ Mod[ x!, Floor[ Sqrt[ x! ] ] - n ] == 0, Return[ n ] ], {n, 0, 10000000} ]}, Print[ {x, "! =", k, x!/k, x!/k - k} ] ], {x, 3, 22} ]
    f[n_] := Block[{k = Floor@ Sqrt[n! ]}, While[ Mod[n!, k] != 0, k-- ]; n!/k - k]; Table[f@n, {n, 2, 32}] (* Robert G. Wilson v, Jul 11 2009 *)
    Table[d=Divisors[n!]; len=Length[d]; If[OddQ[len], 0, d[[1 + len/2]] - d[[len/2]]], {n, 34}] (* Vincenzo Librandi, Jan 02 2016 *)
  • PARI
    for(k=2,25,d=divisors(k!);print(d[#d/2+1]-d[#d/2])) \\ Jaume Oliver Lafont, Mar 13 2009
    
  • Python
    from math import isqrt, factorial
    from sympy import divisors
    def A061057(n):
        k = factorial(n)
        m = max(d for d in divisors(k,generator=True) if d <= isqrt(k))
        return k//m-m # Chai Wah Wu, Apr 06 2022

Formula

a(n) = A060777(n) - A060776(n).
a(n) = A056737(A000142(n)). - Pontus von Brömssen, Jul 15 2023

Extensions

More terms from Dean Hickerson, Jun 13 2001
Edited by N. J. A. Sloane Jul 07 2009 at the suggestion of R. J. Mathar and Alois P. Heinz
a(41) from Robert G. Wilson v, Oct 03 2014

A061060 Write product of first n primes as x*y with x

Original entry on oeis.org

1, 1, 1, 1, 13, 17, 1, 41, 157, 1811, 1579, 18859, 95533, 17659, 1995293, 208303, 2396687, 58513111, 299808329, 2460653813, 3952306763, 341777053, 115405393057, 437621467859, 1009861675153, 6660853109087, 29075165225531
Offset: 1

Views

Author

Ed Pegg Jr, May 28 2001

Keywords

Examples

			a(4)=1: 2*3*5*7 = 210 = 14*15, so we can take x=14, y=15, with difference of 1.
Also: n=3: 2*3-5=1; n=4: 3*5-2*7=1; n=5: 5*11-2*3*7=13; n=6: 2*7*13-3*5*11=17; n=7: 5*11*13-2*3*7*17=1; n=8: 3*5*11*19-2*7*13*17=41
		

Crossrefs

Programs

  • Maple
    A061060aux := proc(l1,l2) local resul ; resul := product(l1[i],i=1..nops(l1)) ; resul := resul-product(l2[i],i=1..nops(l2)) ; RETURN(abs(resul)) ; end:
    A061060 := proc(n) local plist,i,subl,resul,j,l1,l2,k,d ; plist := [] ; resul := 1 ; for i from 1 to n do resul := resul*ithprime(i) ; plist := [op(plist), ithprime(i)] ; od; for i from 1 to n/2 do subl := combinat[choose](plist,i) ; for j from 1 to nops(subl) do l1 := op(j,subl) ; l2 := convert(plist,set) minus convert(l1,set) ; d := A061060aux(l1,l2) ; if d < resul then resul := d ; fi ; od; od ; RETURN(resul) ; end:
    for n from 3 to 19 do printf("%d,",A061060(n)) ; od ; # R. J. Mathar, Aug 26 2006 [This Maple program was attached to A121315. However I think it belongs here, so I renamed the variables and moved it to this entry. - N. J. A. Sloane, Sep 16 2005]
  • Mathematica
    (* first do *) Needs["DiscreteMath`Combinatorica`"] (* then *) f[n_] := Block[{arrayofnprimes = Array[Prime, n], primorial = Times @@ Array[Prime, n], diffmin = Infinity, adiff, sub}, If[n == 1, 1, Do[sub = Times @@ NthSubset[i, arrayofnprimes]; adiff = Abs[primorial/sub - sub]; If[adiff < diffmin, diffmin = adiff], {i, 2, 2^n/2}]; diffmin]]; Do[ Print@f@n, {n, 30}] (* Robert G. Wilson v, Sep 14 2006 *)

Formula

Conjecture: Limit_{N->oo} (Sum_{n=1..N} log(a(n))) / (Sum_{n=1..N} prime(n)) = 1/e (A068985). - Alain Rocchelli, Nov 13 2023

Extensions

Terms a(16)-a(45) in b-file computed by Jud McCranie, Apr 15 2000; Jan 12 2016
a(46)-a(60) in b-file from Don Reble, Jul 11 2020
a(61)-a(70) in b-file from Max Alekseyev, Apr 20 2022

A182987 Least a + b such that a*b = A002110(n), the product of the first n primes, where a, b are positive integers.

Original entry on oeis.org

2, 3, 5, 11, 29, 97, 347, 1429, 6229, 29873, 160879, 895681, 5448239, 34885673, 228759799, 1568299433, 11417382973, 87698582693, 684947829299, 5606539600699, 47241542381273, 403631914511993, 3587558929043927, 32684217334524347, 308342289648328511, 3036819365023723883
Offset: 0

Views

Author

Risto Kauppila, Feb 06 2011

Keywords

Comments

Original definition (not applicable for n = 0 and 1, but equivalent for n >= 2):
Let p(S) be product of integers in S. a(n) is minimum of p(S_1) + p(S_2) over all partitions of first n primes into sets S_1 and S_2.
Also: Least integer such that a(n)^2 - 4*A002110(n) is a square. - David Broadhurst, Sep 20 2011
The integers a,b are the two median divisors of primorial(n), a = A060795(n) = A060775(A002110(n)) and b = A060796(n) = A033677(A002110(n)). (For n = 0, a = b = 1 of course.) - M. F. Hasler, Sep 20 2011

Examples

			a(3) = 11 = min{ 2*3 + 5 = 11, 2*5 + 3 = 13, 3*5 + 2 = 17 }
Or, a(3) = 11 = min { 1+30, 2+15, 3+10, 5+6 } because A002110(3) = 2*3*5 = 30 = 2*15 = 3*10 = 5*6.
		

Crossrefs

Cf. A000196 (integer sqrt), A002110 (primorial), A010052 (is_square).

Programs

  • Mathematica
    a[0] = 2; a[n_] := Module[{m = Times @@ Prime[Range[n]]}, For[an = 2 Floor[Sqrt[m]] + 1, an <= m + 2, an += 2, If[IntegerQ[Sqrt[an^2 - 4 m]], Return[an]]]]; Table[an = a[n]; Print[an]; an, {n, 0, 25}] (* Jean-François Alcover, Oct 20 2016, adapted from PARI *)
  • PARI
    A182987(n)={if(n,vecsum(divisors(vecprod(primes(n)))[2^(n-1)..2^(n-1)+1]),2)}  \\ Needs stack size >= 2^(n+6). - M. F. Hasler, Sep 20 2011, edited Mar 24 2022
    
  • PARI
    A182987(n)={ n||return(2); my(m=prod(k=1,n,prime(k))); forstep(a=2*sqrtint(m)+1,m+2,2, issquare(a^2-4*m) & return(a)) }  \\ Slow for n >= 28, but needs not much memory. - M. F. Hasler, following an idea from David Broadhurst, Sep 20 2011
    
  • Python
    def A182987(n): # becomes slow for n >= 28, but not slower than memory-hungry
       # sum(divisors(primorial(n))[2**(n-1)-1:2**(n-1)+1]) if n else 2
       "Compute A182987(n) = sum of the two central divisors of primorial(n)."
       if n < 2: return n+2
       from math import isqrt # = A000196
       from sympy import primorial # = A002110
       from sympy.ntheory.primetest import is_square # = A010052
       m = primorial(n)*4; a = isqrt(m)|1  ### ceil(sqrt(m))**2 < m  for n = 26..27 !!
       while True:
          if is_square(a*a - m): return a
          a += 2
    # M. F. Hasler, Mar 21 2022

Formula

a(n) = A060795(n) + A060796(n). - M. F. Hasler, Sep 20 2011
Conjecture: Limit_{N->oo} (Sum_{n=1..N} log(a(n)-2*sqrt(prime(n)#))) / (Sum_{n=1..N} prime(n)) = 2/e - 1/2 (i.e., A135002 - 1/2). - Alain Rocchelli, Nov 30 2023

Extensions

First term and example corrected, as empty sets have product 1, by Phil Carmody, Sep 20 2011
Simpler definition and extension to n = 0 by M. F. Hasler, Sep 20 2011
b-file extended to a(59) with results from R. Gerbicz (cf. 2nd Broadhurst link) by M. F. Hasler, Mar 22 2022
a(60)-a(70) in b-file from Max Alekseyev, Apr 20 2022

A355189 Factorial splitting: write n! = x*y*z with x <= y <= z and minimal z-x; sequence gives value of x.

Original entry on oeis.org

1, 1, 1, 1, 2, 4, 8, 14, 32, 70, 140, 324, 768, 1800, 4368, 10800, 27300, 70560, 184800, 494208, 1343680, 3704400, 10388250, 29560960, 85250880, 249318000, 738720000, 2216160000, 6729074352, 20675655000, 64245312000, 201819656500, 640760440320
Offset: 0

Views

Author

Max Alekseyev, Jun 23 2022

Keywords

Comments

Apparently we have x < y < z for all n > 9. If so, using strict inequalities x < y < z in the definition would make the sequence undefined for n < 3 and affect only a(9) by switching from 9! = 70*72*72 to 9! = 63*72*80.

Crossrefs

Showing 1-10 of 13 results. Next