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
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]
Cf.
A060755,
A000196,
A002110,
A033677,
A060776,
A060777,
A061057,
A060795 (x),
A061060 (y-x),
A182987 (x+y),
A061030,
A061031,
A061032,
A061033,
A200744.
-
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 *)
-
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
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
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.
Cf.
A000196,
A060776,
A060777,
A061057,
A060796 (y),
A061060 (y-x),
A182987 (x+y),
A061030,
A061031,
A061032,
A061033,
A060755,
A033677,
A200743.
-
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
-
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 *)
-
a(n) = my(m=prod(i=1, n, prime(i))); divisors(m)[numdiv(m)\2]; \\ Michel Marcus, Feb 22 2016
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
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).
Cf.
A000142,
A060776,
A060777,
A060795,
A060796,
A061060,
A061030,
A061031,
A061032,
A061033,
A005563,
A038507,
A038667,
A056737,
A146968.
-
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
-
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 *)
-
for(k=2,25,d=divisors(k!);print(d[#d/2+1]-d[#d/2])) \\ Jaume Oliver Lafont, Mar 13 2009
-
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
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
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.
-
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
-
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 *)
-
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
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
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.
- Max Alekseyev, Table of n, a(n) for n = 0..70
- David Broadhurst, Re: adding to prime number [primes in A182987], primenumbers group, Sep 20 2011.
- David Broadhurst and others, Adding to prime number, digest of 28 messages in primenumbers Yahoo group, Sep 19, 2011 - Sep 22, 2011.
-
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 *)
-
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
-
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
-
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
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
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
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.
-
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
-
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
a(15)-a(26) and corrections to a(9) and a(11) from
Jinyuan Wang, Jan 07 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
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.
-
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
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
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.
-
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.
Comments