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.

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

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

Original entry on oeis.org

1, 2, 5, 14, 42, 165, 714, 3094, 14858, 79534, 447051, 2714690, 17395070, 114371070, 783152070, 5708587335, 43848093003, 342444658094, 2803119896185, 23619540863730, 201813981102615, 1793779293633437, 16342050964565645, 154170926013430326, 1518409177581024365
Offset: 1

Views

Author

Labos Elemer, Apr 27 2001

Keywords

Comments

Or, lower central divisor of n-th primorial.
Subsequence of A005117 (squarefree numbers). - Michel Marcus, Feb 22 2016

Examples

			n = 8: q(8) = 2*3*5*7*11*13*17*19 = 9699690. Its 128th and 129th divisors are {3094, 3135}: a(8) = 3094 and 3094 < A000196(9699690) = 3114 < 3135. [Corrected by _Colin Barker_, Oct 22 2010]
2*3*5*7 = 210 = 14*15 with difference of 1, so a(4) = 14.
		

Crossrefs

Programs

  • Maple
    F:= proc(n) local P,N,M;
         P:= {seq(ithprime(i),i=1..n)};
         N:= floor(sqrt(convert(P,`*`)));
         M:= map(convert, combinat:-powerset(P),`*`);
         max(select(`<=`,M,N))
    end proc:
    map(F, [$1..20]); # Robert Israel, Feb 22 2016
  • Mathematica
    a[n_] := (m = Times @@ Prime[Range[n]] ; dd = Divisors[m]; dd[[Length[dd]/2 // Floor]]); Table[Print[an = a[n]]; an, {n, 1, 25}] (* Jean-François Alcover, Oct 15 2016 *)
  • PARI
    a(n) = my(m=prod(i=1, n, prime(i))); divisors(m)[numdiv(m)\2]; \\ Michel Marcus, Feb 22 2016

Formula

a(n) = A060775(A002110(n)). - Labos Elemer, Apr 27 2001
a(n) = A002110(n)/A060796(n). - M. F. Hasler, Mar 21 2022

Extensions

More terms from Ed Pegg Jr, May 28 2001
a(16)-a(23) computed by Jud McCranie, Apr 15 2000
a(24) and a(25) from Robert Israel, Feb 22 2016
a(25) corrected by Jean-François Alcover, Oct 15 2016
a(26)-a(33) in b-file from Amiram Eldar, Apr 09 2020
Up to a(38) using b-file of A060796, by M. F. Hasler, Mar 21 2022
a(39)-a(70) in b-file from Max Alekseyev, Apr 20 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

A038667 Minimal value of |product(A) - product(B)| where A and B are a partition of {1,2,3,...,n}.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 6, 2, 18, 54, 30, 36, 576, 576, 840, 6120, 24480, 20160, 93696, 420480, 800640, 1305696, 7983360, 80313120, 65318400, 326592000, 2286926400, 3002360256, 13680979200, 37744574400, 797369149440, 1763653953600, 16753029012720, 16880461678080, 10176199188480, 26657309952000
Offset: 0

Views

Author

Keywords

Comments

Conjecture: The sequence of rational numbers A061057(n)/a(n) has 1 as a limit point. Question: What other limit points does the sequence have? - Richard Peterson, Jul 13 2023

Examples

			For n=1, we put 1 in one set and the other is empty; with the standard convention for empty products, both products are 1.
For n=13, the central pair of divisors of n! are 78975 and 78848. Since neither is divisible by 10, these values cannot be obtained. The next pair of divisors are 79200 = 12*11*10*6*5*2*1 and 78624 = 13*9*8*7*4*3, so a(13) = 79200 - 78624 = 576.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) local l, ll, g, gg, p, i; l:= [i$i=1..n]; ll:= [i!$i=1..n]; g:= proc(m, j, b) local mm, bb, k; if j=1 then m else mm:= m; bb:= b; for k to 2 while (mmbb then bb:= max(bb, g(mm, j-1, bb)) fi; mm:= mm*l[j] od; bb fi end; Digits:= 700; p:= ceil(sqrt(ll[n])); gg:= g(1, nops(l), 1); ll[n]/gg -gg end: a(0):=0:
    seq(a(n), n=0..20); #  Alois P. Heinz, Jul 09 2009, revised Oct 17 2015
  • Mathematica
    a[n_] := Module[{l, ll, g, gg, p, i}, l = Range[n]; ll = Array[Factorial, n]; g[m_, j_, b_] := g[m, j, b] = Module[{mm, bb, k}, If[j==1, m, mm=m; bb=b; For[k=1, mm bb , bb = Max[bb, g[mm, j-1, bb]]]; mm = mm*l[[j]]]; bb]]; p = Ceiling[Sqrt[ ll[[n]]]]; gg = g[1, Length[l], 1]; ll[[n]]/gg - gg]; a[0]=0; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 0, 35}] (* Jean-François Alcover, Feb 29 2016, after Alois P. Heinz *)
  • Python
    from math import prod, factorial
    from itertools import combinations
    def A038667(n):
        m = factorial(n)
        return 0 if n == 0 else min(abs((p:=prod(d))-m//p) for l in range(n,n//2,-1) for d in combinations(range(1,n+1),l)) # Chai Wah Wu, Apr 06 2022

Formula

a(n) = A200744(n) - A200743(n) = (A200744(n)^2 - A200743(n)^2) / A127180(n). - Max Alekseyev, Apr 08 2022
a(n) >= A061057(n).

Extensions

a(28)-a(31) from Alois P. Heinz, Jul 09 2009
a(1) and examples from Franklin T. Adams-Watters, Nov 22 2011
a(32)-a(33) from Alois P. Heinz, Nov 23 2011
a(34)-a(35) from Alois P. Heinz, Oct 17 2015

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

A349708 a(n) is the smallest positive number k such that (product of the first n odd primes) + k^2 is a square.

Original entry on oeis.org

1, 1, 4, 1, 19, 53, 58, 97, 181, 4244, 2122, 31126, 16451, 297392, 2444006, 622249, 2909047, 216182072, 62801719, 769709491, 32522441312, 37859955467, 129549407177, 286721160343, 101419856449, 107709289064864, 72441253480727, 56099073382147, 5249126879235893
Offset: 1

Views

Author

Richard Peterson, Dec 31 2021

Keywords

Comments

a(n) is half the difference between the middle two divisors of A070826(n + 1). - David A. Corneth, Jan 17 2022

Examples

			a(4)=1 because the product of the first 4 odd primes, 3*5*7*11 = 1155, is 34^2 - 1. a(5)=19 because 15015=3*5*7*11*13=124^2-19^2, and no positive integer less than 19 will work in this situation.
		

Crossrefs

Programs

  • PARI
    a(n) = my(k=1, p=prod(k=2, n+1, prime(k))); while (!issquare(k^2+p), k++); k; \\ Michel Marcus, Jan 10 2022
    
  • Python
    from math import isqrt
    from sympy import primorial, divisors
    def A349708(n):
        m = primorial(n+1)//2
        a = isqrt(m)
        d = max(filter(lambda d: d <= a, divisors(m,generator=True)))
        return (m//d-d)//2 # Chai Wah Wu, Mar 29 2022

Extensions

a(15)-a(26) and corrections to a(9) and a(11) from Jinyuan Wang, Jan 07 2022
a(27)-a(30) from Jon E. Schoenfield, Jan 16 2022

A350813 a(n) is the least positive number k such that the product of the first n primes that are congruent to 1 (mod 4) is equal to y^2 - k^2 for some integer y.

Original entry on oeis.org

2, 4, 24, 38, 16, 588, 5782, 5528, 80872, 319296, 3217476, 32301914, 20085008, 166518276, 2049477188, 17443412442, 27905362944, 233647747282, 886295348972, 134684992249108, 98002282636962, 392994156083892, 5283713761100536, 76642755213473624, 923250078609721236
Offset: 1

Views

Author

Richard Peterson, Jan 17 2022

Keywords

Comments

Because y^2-k^2=(y-k)(y+k), a method to make k as small as possible is to try to make y-k and y+k as nearly equal as possible.
Because each of y-k and y+k are made up of primes of form 1 mod 4, algebra shows that k=a(n) is always even.

Examples

			For n=3, m = 5*13*17. The "middle" most nearly equal divisor and codivisor of m are y-k=17 and y+k=65, whence a(n) = (65 - 17)/2 = 24.
		

Crossrefs

Programs

  • Python
    from math import prod, isqrt
    from itertools import islice
    from sympy import sieve, divisors
    def A350813(n):
        m = prod(islice(filter(lambda p: p % 4 == 1, sieve),n))
        a = isqrt(m)
        d = max(filter(lambda d: d <= a, divisors(m,generator=True)))
        return (m//d-d)//2 # Chai Wah Wu, Mar 29 2022

Extensions

Terms corrected by and more terms from Jinyuan Wang, Mar 17 2022

A317490 a(n) = min {i - j} where i*j is a factorization of the n-th partial product of the semiprimes (A112141).

Original entry on oeis.org

0, 2, 6, 3, 12, 3, 126, 153, 765, 1050, 5348, 14850, 85050, 501200, 91280, 3661983, 25633881, 66271296, 215467945, 254861640, 5311480020, 75327142968, 122703152000, 2187956957004, 3449084839200, 19305922856220, 11327171375520, 58038845751810, 2222926571960640
Offset: 1

Views

Author

Robert G. Wilson v, Jul 29 2018

Keywords

Examples

			a(1) =   0 since the first semiprime is    4 =    2 *    2;
a(2) =   2 since 4*6               =      24 =    4 *    6;
a(3) =   6 since 4*6*9             =     216 =   12 *   18;
a(4) =   3 since 4*6*9*10          =    2160 =   45 *   48;
a(5) =  12 since 4*6*9*10*14       =   30240 =  168 *  180;
a(6) =   3 since 4*6*9*10*14*15    =  453600 =  172 *  175;
a(7) = 126 since 4*6*9*10*14*15*21 = 9525600 = 3024 * 3150; etc.
		

Crossrefs

Inspired by A003681, and analogous to A061057 and A061060.
Cf. A112141.

Programs

  • Mathematica
    SemiPrimePi[n_] := Sum[PrimePi[n/Prime[i]] - i + 1, {i, PrimePi[Sqrt[n]]}]; SemiPrime[n_] := Block[{e = Floor[Log[2, n] + 1], a, b}, a = 2^e; Do[b = 2^p; While[SemiPrimePi@a < n, a = a + b]; a = a - b/2, {p, e, 0, -1}]; a + b/2]; a[n_] := Block[{sp = Times @@ Array[SemiPrime@# &, n], d}, d = DivisorSigma[0, sp]/2; -Subtract @@  Take[ Divisors@ sp, {d, d + 1}]]; a[1] = 0; Array[a, 29]
Showing 1-8 of 8 results.