arXiv:2012.11565v2 [math.NT] 23 Mar 2021 nevl( interval contain h hwdta sso as soon as that showed who o all for fdsic rm atr of factors prime distinct of hoe 1.1. Theorem contain Ter¨av¨ainen on [20] rm iios.Ti steamo h urn note. current the of aim the is This divisors”. prime P X uswt lotra rcin rm[] n hudb bet impro to able be of should forms men one bilinear they [6], general particular from for fractions In estimates Kloosterman and with result. theory sums their sieve improve linear to using possibility the discuss tain htams l nevl flnt (log length of intervals all almost that relne 8 ] relne n wne 7 hwdta sso a soon as that showed [7] Iwaniec and Friedlander 9], [8, Friedlander eodcs h etrslsaedet e¨vann[0 h sho Ter¨av¨ainen who to [20] due are results > ε best the case second tmost at ut[4 oa sta lotalitraso length — z of claim intervals Riemann this all the from almost of far that is rather zeros today are the [14] we sult for hypotheses h strong conjecture Riemann such correlation the Without simultaneously pair assuming the this and established has [12] Brown oti rmsframs all almost for primes contain LOTPIE NAMS L EYSOTINTERVALS SHORT VERY ALL ALMOST IN PRIMES ALMOST 3 hnte a ht”twudb neetn ogtitgr ihat with integers get to interesting be would ”It that say they Then . ∞ → ec,a onas soon as Hence, ewieΩ( write We n[,BtenCrlay62 n rpsto .9 relne n Iw and Friedlander 6.29] Proposition and 6.28 Corollary Between [7, In h aeof case The n a s iia usinaotams-rms i.e. almost-primes, about question similar a ask can One ypoaiitcmdl,oeepcsta hr nevl ftetyp the of intervals short that expects one models, probabilistic By 2010 ,ams l nevl flnt lglog (log length of intervals all almost 0, P 2 x nmes eoeTra¨ie’ ok h etrsl a u t due was result Ter¨av¨ainen’s best Before the -numbers. work, ahmtc ujc Classification. Subject Mathematics lotalitras( intervals all almost , P vnulycmn rmrslso ehulesadIwaniec and Deshouillers arithm of the sums. with results Kloosterman sieve, from weighted Richert’s coming use eventually we proof the In ( Abstract. P k ∈ x x 2 2 − nmes nteohrhn,b oko u[1 ti nw htth that known is it [21] Wu of work by hand, other the On -numbers. rm atr or factors prime nmes rvosyi a nw,a osqec ftewr o work the of consequence a as known, was it Previously -numbers. − ( X/ h x log P 101 n 2 k o h oa ubro rm atr of factors prime of number total the for ) X , Let ,x X, ubr sese ic h aiybrirde o pl.Following apply. not does barrier parity the since easier is numbers / 232 eso hta onas soon as that show We ] E X with ] pr rma xetoa e fmeasure of set exceptional an from apart 2 x , h ubr,ta lotalitraso egh(log length of intervals all almost that numbers, ≥ contains ] ∞ → 2 x n and E ∈ x p h . x k | − n x with ( ∞ → h ∈ X/ ubr hthv exactly have that numbers = − 2 1. AS MATOM KAISA log ⇒ ( X 2 ≤ P X/ h X , Introduction XX 2 X log h with 2 ubr o l ucetylarge sufficiently all for numbers oti rdc fa ottoprimes. two most at of product a contain ] ≤ X , ∞ → X 12,11N36. 11N25, 1 ,x X, ≤ h / X x ) 8 1 ∞ → sso as soon as ] 3 X 1 . 1 51 X Ω( contain ] / lotalitraso length of intervals all almost , lotalitras( intervals all almost , 100 ) n oti an contain 6+ with ) AKI ¨ ≤ Then . ε 2 log ≍ X X h ∞ → P h X 1 19 / ∞ → 20 oti an contain -numbers. n E lotalintervals all almost , and oti primes. contain 2 k -number. P tcinformation etic with rm atr.I the In factors. prime naeae of averages on k O ω ubr hthave that numbers ( ( e ht o any for that, wed X/h n x X o h number the for ) E ( e − s 3 iaa[17] Mikawa o ∞ → ) t function. eta h x x h . ubrand number h etre- best the exponential X (log − . ∞ → ve h ypothesis ottwo most inthat tion ) Heath- . 3 log . h X 51 P log aniec 19 ) with ,x X, con- 5 x , X to e f ] ] 2 KAISA MATOMAKI¨

First note that the upper bound part of Theorem 1.1 is immediate from [7, Corollary 6.28]. In the proof of the lower bound part we use Richert’s weighted sieve, sieving primes < Xδ with the β-sieve (with β = 30) and primes Xδ with the linear sieve with well-factorable weights. To get more flexibility with≥ the error terms, we also use Vaughan’s identity. The arithmetic information comes from bounds for averages of Kloosterman sums due to Deshouillers and Iwaniec [4]. In the above-mentioned work Mikawa [17] also used weighted sieve and estimates for Kloosterman sums but he did not take advantage of cancellations among the sieve weights for which reason he needed longer intervals (see Remark 2.2 below for more information about [17]).

2. Setting up the sieves Let us introduce the set-up of Richert’s [18] weighted sieve following [7, Chapter 25]. Define D := X5/9, z := D1/4 = X5/36, and y := D9/10 = X1/2. For x (X/2,X] and 2 h X1/100, write (x) = (x h log X, x] N and ∈ ≤ ≤ A − ∩ P (z)= p 2 but ω(n) 2 (since≪ such numbers∈ are divisible by p2 for some p>z). Hence, to deduce Theorem≤ 1.1 it suffices to show that (1) w h n ≫ n (x) (n,P∈AX(z))=1 for all x (X/2,X] apart from an exceptional set of measure O(X/h). Writing,∈ for N, B⊆ S( ,z) := n : (n, P (z))=1 and = n N: dn , B |{ ∈B }| Bd { ∈ ∈ B} we have log p (2) w = S( (x),z) 1 S( (x) ,z). n A − − log y A p n (x) z p<2y ≤   (n,P∈AX(z))=1 X To find a lower bound for S( (x),z), we introduce β-sieve and linear sieve weights (see e.g. [7, Section 6.4]). A Remark 2.1. The reason that we do not use only the linear sieve is that using β-sieve (with e.g. β = 30) to sieve out primes < Xδ makes getting certain mean square estimates (like (20) below) easier. However it is suggested in [7, between Corollary ALMOST PRIMES IN ALMOST ALL VERY SHORT INTERVALS 3

6.28 and Proposition 6.29] that one could prove such mean square estimates also for the linear sieve alone. On the other hand, the reason that we do not use only the β-sieve with β = 30 is that the linear sieve leads to superior sieving results — in particular our lower bound for (2) would be negative if we only used the β-sieve. Let β = 30, let δ > 0 be small and take w = Xδ and E = X1/1000. Write also

P (w,z)= w pp >...>p ,p p p2 p >...>p ,p p p p >...>p ,p p pβ < E for all odd m , E { 1 ··· r | 1 2 r 1 ··· m m } β − := e = p p P (w): p >p >...>p ,p p p < E for all even m . E { 1 ··· r | 1 2 r 1 ··· m m } ± Now define the upper and lower bound linear sieve weights λd± = µ(d)1d and ∈D N the upper and lower bound β-sieve weights ρe± = µ(e)1e ± , so that, for any n , (see e.g. [7, Equations (6.26) and (6.27) with = n ])∈E ∈ A { } + λ− 1 λ d ≤ (n,P (w,z))=1 ≤ d d n d n X| X| + and ρ− 1 ρ . e ≤ (n,P (w))=1 ≤ e e n e n X| X| We cannot obtain a lower bound for 1(n,P (z)) directly by multiplying the lower bounds for 1(n,P (w,z))=1 and 1(n,P (w))=1 since for some n both lower bounds might be negative. However, we can derive a lower bound for 1(n,P (z))=1 that is familiar from the vector sieve (see e.g. [11, Lemma 10.1]):

1(n,P (z))=1 = 1(n,P (w,z))=11(n,P (w))=1

= λ+ 1 λ+ 1 1  d  (n,P (w))=1 −  d − (n,P (w,z))=1 (n,P (w))=1 d n d n X| X|     + + + λ ρ− λ 1 ρ ≥ d e −  d − (n,P (w,z))=1 e d n e n d n e n X| X| X| X| + + + +  λ ρ− λ ρ + λ−ρ = α−, ≥ d e − d e d e k d n e n k n X| X|  X| where + + + + αk− = 1k P (z) λ ρ− + λ− ρ λ ρ | (k,P (w,z)) (k,P (w)) (k,P (w,z)) (k,P (w)) − (k,P (w,z)) (k,P (w)) say. Hence  

(3) S( (x),z) α− (x) . A ≥ d |A d| d P (z) |X

Note that αk− are supported on k DE, so they are lower bound sieve weights with level DE. ≤ Let us now turn to obtaining an upper bound for S( (x)p,z). If we can obtain level of distribution DE for (x), we can typically applyA a sieve of level DE/p to A (x)p. However, it will be technically convenient if the level is more stable when p Avaries and if p has a smooth weight. To achieve this we introduce a smooth partition of the unity. Let ψ : R [0, 1] + → be a smooth function such that ψ(x) = 0 for x 1 and ψ(x) = 1 for x √2. ≤ ≥ 4 KAISA MATOMAKI¨

Defining then σ : R [0, 1] by + → ψ(x) if 0 < x √2; σ(x) := ≤ 1 ψ x if x> √2, ( − √2 the function σ(x) is compactly supported  in [1, 2], and for all x R we have ∈ + x σ a =1. √2 a Z   X∈ Consequently, writing log z log y = 2, N, I log √2 − log √2 ∩     we have, for any p P, ∈ =1, if z p 2y; √2  a    [0, 1], otherwise. X∈I ∈ Hence  (4) log p p log p 1 S( (x)p,z) σ a 1 S( (x)p,z). − log y A ≤ √2 − log y A z p<2y   a p     ≤X X∈I X a a a+2 Note that, for a , the smooth weight σ(p/√2 ) is supported on p [√2 , √2 ] [z/4, 2y]. ∈ I ∈ ⊆ For a , let ∈ I a+2 Da = D/√2 , + := d = p p P (w,z): p >p >...>p ,p p p2

(5) 1 = 1 1 λ+ ρ+ = α+ , (n,P (z))=1 (n,P (w,z))=1 (n,P (w))=1 ≤  d,a  e  k,a d n e n k n X| X| X| where     + + + αk,a := 1k P (z)λ ρ . | (k,P (w,z)),a (k,P (w)) a+2 Note that α+ are supported on k D E = DE/√2 . k,a ≤ a Combining (2) and (4) and then using (3) and (5) we obtain p log p wn S( (x),z) σ 1 1 ≥ A − √ a − log y (n,P (z))=1 n (x) a p 2 n (x) ∈I     p (n,P∈AX(z))=1 X X ∈AX

p log p + α− (x)d σ a 1 α (x)dp . ≥ d |A |− √2 − log y d,a|A | d P (z) a p     d P (z) |X X∈I X |X Writing, for e d, dp , ∈{ } h log X h log X (x) = + (x) |A e| e |A e|− e   we see that, for every x (X/2,X], ∈ + w h log X M(z,y)+ E−(x,y,z) E (x,y,z), n ≥ · − n (x) (n,P∈AX(z))=1 ALMOST PRIMES IN ALMOST ALL VERY SHORT INTERVALS 5 where

α+ αd− p log p d,a M(z,y) := σ a 1 d − √2 − log y dp d P (z) a p     d P (z) X| X∈I X |X h log X E−(x,y,z) := α− (x) d |A d|− d d P (z)   X| + p log p + h log X E (x,y,z) := σ a 1 α (x)dp . √2 − log y d,a |A |− dp a p     d P (z)   X∈I X |X

Hence, in order to establish that (1) holds for all x (X/2,X] apart from an exceptional set of measure O(X/h), it suffices to show that∈

1 (6) M(z,y) ≫ log X and that

X 2 (7) E±(x,y,z) dx hX. | | ≪ ZX/2

We will establish (6) in Section 3. Then we will do some preliminary work on type I sums in almost all very short intervals in Section 4 before establishing (7) in Section 5.

Remark 2.2. We have not optimized the level of distribution or the sieve weights as the current set-up suffices for obtaining P2-numbers. As pointed out to the author by James Maynard and Maksym Radziwil l,it might be possible to alternatively use Greaves’ most sophisticated weighted sieve [10] together with Bettin-Chandee [1] estimates for Kloosterman sums. In this alternative approach the estimation of S2 from Proposition 4.1 below would be simpler whereas the sieve weights and thereby the estimation of S1 would become more complicated. On the other hand, after the completion of this work, the author realised, thanks to a comment by Andrew Granville, that it would probably suffice to use Kloost- erman sum estimates based on the Weil bound as Mikawa [17] does. This would again simplify the treatment of S2. However, our results in Section 4 give better bilinear level of distribution in almost all short intervals, which might be of benefit for other applications, so we have decided to keep the current approach.

3. Handling the main term M(z,y)

Take a small ε′ > 0 and write V (z) := (1 1/p). Let F (s) and f(s) be the p

(8) f(4) = eγ log(3)/2 and, for 0

Recall that w = Xδ and z = D1/4. We get from standard results for β-sieve (see e.g. [7, Lemma 6.8 and (12.4, 12.5)] — note that [7, (12.4)] actually holds for 6 KAISA MATOMAKI¨ s> 0) that, once δ is small enough in terms of ε′,

+ + + + M(z,y) 1 λ ρ λ− ρ λ ρ = d e− + d e d e V (z) V (z) d e d e − d e d P (w,z) e P (w) d P (w,z) e P (w) d P (w,z) e P (w)  | X |X | X |X | X |X + + p log p 1 λd,a ρe σ a 1 − √2 − log y p d e a p     d P (w,z) e P (w) X∈I X | X |X  (F (4) ε′)(1 ε′) + (f(4) ε′)(1 ε′) (F (4) + ε′)(1 + ε′) ≥ − − − − − p log p 1 log Da σ a 1 F + ε′ (1 + ε′) − √2 − log y p log z a p         X∈I X log p 1 log D/p f(4) 1 F 100ε′. ≥ − − log y p log z − z

γ y 1/4 M(z,y) e log(3) γ log t 1 log D dt 2e 1 200ε′ V (z) ≥ 2 − − log y t log(D/t) log t − Zz   γ 9/10 e log(3) γ 10α 1 dα = 2e 1 200ε′. 2 − − 9 4(1 α) α − Z1/4   − Evaluating the integral, we obtain M(z,y) eγ 1 10 log 3 1 log(27) log(15/2) 200ε′. V (z) ≥ 2 − log 3 − 9 −    By a numerical calculation we see that indeed M(z,y) 1/ log X once ε′ is small enough. ≫

4. Type I sums in almost all short intervals For g : R R, we denote by g the Fourier transform → ∞ g(x)=b g(ξ)e( ξx)dξ. − Z−∞ We shall use the following generalb result as a starting point for showing (7).

Proposition 4.1. Let X H 2. For d N, define ≥ ≥ ∈ d πmH 2 γ := sin . d,H πm d m 1    (m,dX≥)=1

Let λd R be bounded for all d, and let g : R R be a smooth function compactly ∈ 1 δ → supported on [1/4, 2]. Let 2 D X − for some δ > 0. Then ≤ 0 ≤ 2

∞ y λd 3 3 g  λd H  dy = S1 + S2 + S3 + O(H (log X) ), X − d Z−∞ d D0,m N d D0   y ≤H

2

λm S1 := 2g(0)X γd,H   , m d D0 m D0 X≤ m 0X≤ (mod d)   ≡  b   d m g(0)X S := (H k ) λ λ g 1 1 , 2 d1 d2   − | | m ,m X − [d1, d2] 0< k H d1,d2 D0 1 2   X| |≤ (d X,d≤) k d1m1=Xd2m2+k 1 2 |  b  2  2  n 1 S := H g λ g(0)HX λ . 3 X  d − X10  d n d n n X10 d n X   X| ≤X X|   b   Remark 4.2. This can be compared with [7, Proposition 6.25] which is non-trivial 1/2 C for D0 < X (log X)− . For our choices of λd we will be able to estimate Sj succesfully for a wider range of D0.

Proof of Proposition 4.1. We start by squaring out, obtaining

2

∞ y λd S := g  λd H  dy X − d Z−∞ d D0,m N d D0   y ≤H

∞ y λd1 ∞ y = g  λd dy 2H g  λd2  dy X − d1 X Z−∞ d D0,m N d1 D0 Z−∞ d2 D0,m N   y ≤H

d m+H ∞ y 2 y g  λd2  dy = λd2 g dy X d2m X Z−∞ d2 D0,m N d2 D0 m Z   y ≤H

2 2 ∞ y 2 λd 3 S = g  λd dy H Xg(0) + O(X− ). X −  d  Z−∞ d D0,m N d D0   y ≤H

Squaring out, the first term equals

∞ y λd λd g 1y H

2 d1m1 H = (H k ) λd1 λd2 g + O τ(n)τ(n + k) . − | | m ,m X  X  k H d1,d2 D0 1 2   k H n 2X | X|≤ (d X,d≤) k d1m1=Xd2m2+k | X|≤ X≤ 1 2 |   The error term here is O(H3(log X)3) and consequently, subtracting and adding the expected main term, (9)

d m g(0)X S = (H k ) λ λ g 1 1 d1 d2   − | | m ,m X − [d1, d2] k H d1,d2 D0 1 2   | X|≤ (d X,d≤) k d1m1=Xd2m2+k 1 2 |  b   2  λ λ λ + g(0)X (H k ) d1 d2 H2Xg(0) d + O(H3(log X)3). − | | [d1, d2] −  d  k H d1,d2 D0 d D0 | |≤ ≤ ≤ X (d1X,d2) k X b | b   The k = 0 summands of the first line contribute S2 whereas the k = 0 summand equals 6

d m g(0)X H λ λ g 1 1 d1 d2   m ,m X − [d1, d2] d1,d2 D0 1 2   X≤ d1mX1=d2m2 b   2  n 1 = H g λd g(0)HX λd1 λd2 10 1+ O(1) X   − X 10 n d n d1,d2 D0 n X   | ≤ X X X [d≤X,d ] n   b 1 2 | = S3 + O(1).

Hence it suffices to show that the second line of (9) contributes S1, i.e.

λd1 λd2 2 (10) g(0)X (d1, d2) (H k ) H  = S1. d1d2 − | | − d1,d2 D0 k H ≤ X  (d| X,d|≤ ) k  b  1 2 |  Here the sum over k equals   H H (d1, d2)+ H (d1, d2) H − − (d1,d2) H +2 (H r(d1, d2)) = H +2 − (d1, d2) 2 j k 1 r H/(d1,d2)   ≤ ≤⌊X ⌋ H H = H + 2H (d , d ) (d , d ) . (d , d ) − 1 2 − (d , d ) 1 2  1 2    1 2   H H Writing θd ,d := , this equals 1 2 (d1,d2) −⌊ (d1,d2) ⌋ H H2 H+ θ (H (d , d )+θ (d , d )) = +(d , d )θ (1 θ ), (d , d ) − d1,d2 − 1 2 d1,d2 1 2 (d , d ) 1 2 d1,d2 − d1,d2  1 2  1 2 ALMOST PRIMES IN ALMOST ALL VERY SHORT INTERVALS 9 so (10) reduces to the claim

λd1 λd2 2 (11) g(0)X (d1, d2) θd1,d2 (1 θd1,d2 )= S1. d1d2 − d ,d D 1 X2≤ 0 Writing ψ(x) forb the one-periodic function which is x(1 x) for x [0, 1] we see − ∈ that θd1,d2 (1 θd1,d2 ) = ψ(H/(d1, d2)). It is easy to see that we have the Fourier expansion − 1 1 1 1 1 cos(2πkx) ψ(x)= e(kx)= 6 − 2π2 k2 6 − π2 k2 k=0 k 1 X6 X≥ 1 1 1 2 sin(πkx)2 2 sin(πkx)2 = − = . 6 − π2 k2 π2 k2 k 1 k 1 X≥ X≥ Hence the left hand side of (11) equals λ λ (d , d ) πkH 2 2g(0)X d1 d2 1 2 sin . d1d2 πk (d1, d2) d1,d2 D0 k 1    X≤ X≥ Writing k = emb with e = (k, (d1, d2)), this equals λ λ (d , d ) πemH 2 2g(0)X d1 d2 1 2 sin . d1d2 πem (d1, d2) d ,d D e 1 m 1 1 2≤ 0 ≥ ≥    X e (Xd1,d2) (m,(d1X,d2)/e)=1 b | Substituting d = (d1, d2)/e, this is λ λ d πmH 2 2g(0)X d1 d2 sin d1d2 πm d d ,d D d 1 m 1 1 2≤ 0 ≥ ≥    X d (Xd1,d2) (m,dX)=1 b | λd1 λd2 =2g(0)X γd,H , d1d2 d D d ,d D ≤ 0 1 2≤ 0 X d (Xd1,d2) b | and (11) follows. 

In order to estimate S2 we shall use consequences of the work of Deshouillers and Iwaniec [4] on averages of Kloosterman sums. The following two lemmas and their proofs have very much in common with [2, Theorems 5 and 7] and [3, 5]. Note that [2, Theorem 5] was used in a similar context in [15] whereas results from [3, 5] have been used in studying almost all intervals of length Xθ. Lemma 4.3. Let H X and let g be a smooth compactly supported function. Let M ,N 1 satisfy ≤ 0 0 ≥ X1 ε (12) N M , and max M 2N ,M 3/2N 2,M 7/4N 3/2 − 0 ≤ 0 { 0 0 0 0 0 0 }≤ H for some ε> 0. Then, whenever M,N 1 are such that ≥ M M , N N ,Q M N , ≤ 0 ≤ 0 ≤ 0 0 and αm,βn and γq are bounded complex coefficients, one has (13)

ℓmn g(0)X 1 ε/3 αmβn γq  g  X − . X − [mn,q] ≪ 0< k H m M q Q ℓ   X| |≤ nX∼N (mn,qX∼ ) k ℓmn=kX(mod q) b  ∼ |    

10 KAISA MATOMAKI¨

In particular this holds for H X1/60 with ε =1/300 if ≤ N M X21/50 and max MN,Q X14/25. ≤ ≤ { }≤ Proof. Writing δ = (mn,q), the left hand side of (13) is at most

ℓmn g(0)X αmβn γδc  g  . X − cmn 0<δ

By Poisson summation, this equals

X ℓX kℓmn/δ α β γ g e . m n δc cmn cmn c 0<δ − is O(X− ). Write m = µd with µ δ | | δX1 ε/20 | and (δ/µ,d) = 1. Then n = νv with ν = δ/µ and mn/δ = dv so that (dv,c) = 1. With this notation we are led to γ α β X c δc µd νv k,δ c µd νv 0<δ

ℓX ∞ ℓX δcd ∞ δcd ℓ g = g(ξ)e ξ dξ = g ξ e ξ dξ. δcdv −δcdv X X −v   Z−∞   Z−∞     Henceb (14) is bounded by

X1+ε/60 udv δ α(u, v)e ≪ MNQ c 0<δ

for certain bounded coefficients α(u, v) (depending also on δ and µ, but not on c and d). Now, for each δ and µ, we apply [5, Lemma 1] with C =2Q/δ,D =2M/µ,V = 2 1 ε/20 2N/ν,U = HMNQ/(δ X − ), and ̺ = 1. Notice that in this notation we have 2 4 1 ε/20 CDUV =8H(MNQ) /(δ X − ). Hence, by [5, Lemma 1], (14) is

1 MQ 1/2 HMNQ N 1/4 H1/2X1/2+ε/20 + + ≪ δ δµ δ2X1 ε/20 ν 0<δ

The sums over δ and µ clearly contribute O(Xε/100). Hence it suffices to show that HMNQ 1/4 H1/2X1/2 (MQ)1/2 + + N " X (15)   3 1/4 HMNQ 2 H(MN) Q 1 ε/2 MQ + N (Q + N )+ X − . · X X ≪     # 2 3 Let us insert our bounds for M,N,Q, noting that Q+N 2M0N0 and H(MN) Q 4 4 ≤ ≤ H(M0N0) which is smaller than H(M0N0) M0 which is our upper bound for MQ HMNQ (Q + N 2). Hence the left hand side of (15) is · · H1/2M N H1/2X1/2 M N 1/2 + 0 0 + N 1/2 M 3/4N 1/2 ≪ 0 0 X1/2 0 0 0   ! H1/2X1/2M N 1/2 + HM 7/4N 3/2 + H1/2X1/2M 3/4N ≪ 0 0 0 0 0 0 1 ε/2 and it is easy to see that this is O(X − ) provided that (12) holds. 7/25 The second claim follows from the first one by choosing M0 = max X ,M 14/25 { } and N0 = X /M0.  Lemma 4.4. Let g : R5 R be a smooth compactly supported function. Write → g5(x1, x2, x3, x4,u) for the Fourier transform of g with respect to the fifth coordinate, i.e. ∞ b g (x , x , x , x ,u)= g(x , x , x , x , ξ)e( ξu)dξ. 5 1 2 3 4 1 2 3 4 − Z−∞ Let D ,M 1 satisfy 0 0 ≥ b X1 ε (16) max M 4,D M 3/2,D4/3M 1/3 − { 0 0 0 0 0 }≤ H for some ε> 0. Then, whenever Q,M,N 1 are such that ≥ Q MN, M,R M and MN,QR D ≤ ≤ 0 ≤ 0 and αm and γr are bounded complex coefficients, one has (17) m n q r ℓmn α γ g , , , , m r M N Q R X 0< k H m M q ℓ   X| |≤ X∼n rXR ℓmn=kX(mod qr) ∼ (qr,mn) k | m n q r X 1 ε/3 g5 , , , , 0 X − . − M N Q R [mn,qr] ! ≪  

In particular this holds for H X1/60b with ε =1/300 if ≤ max MN,QR X31/50, and max M, R X6/25. { }≤ { }≤ Proof. We argue as in the beginning of the previous proof writing δ = (mn,qr),m = µd and n = νv with µν = δ and (δ/µ,d). This time we also write r = µ′s with µ′ δ | and (s,δ/µ′) = 1. Then q = ν′c with ν′ = δ/µ′ and qr/δ = cs. Now (cs, dv) = 1. With this notation we are, instead of (14), led to γ ′ 1 α X c µ s µd k,δ s c µd 0<δ

Writing

µd νv ν c µ s ℓX cv ∞ µd νv ν c µ s cv ℓ g , , ′ , ′ , = g , , ′ , ′ , ξ e ξ dξ 5 M N Q R δdvcs X 5 M N Q R X δsd   Z−∞     andb n = kℓ, (18) is

X1+ε/60 ndv δ b ′ g∗ ′ (c,v,d,n,s)e , MNQR d,n,s,δ,µ,µ δ,µ,µ cs ≪ ′ HMNQR c,v 0<δ

for any νi 0 for 1 i 5, with the implied constant depending only on νi. ≥ ≤ ≤ 2 1 ε/20 We apply [4, Theorem 12] with C Q/ν′,D N/ν,N = HMNQR/(δ X − ), R = ≍ ≍ M/µ = Mν/δ and S = R/µ′ = ν′R/δ (strictly speaking we need to first make a smooth dyadic partition of g∗), obtaining the bound

1/2 1/2+ε/20 H X 1 1/2 1/2 QR νν′MR HMNQR Q MN 1/2 ν ν′ 2 + 2 1 ε/20 + (NQ) δ ′ δ δ δ X − ν′ δ 0<δMN we can interchange the roles of M,N with those of R,Q in the claim (17) by writing ℓmn k (mod qr) first as ℓmn = k+ℓ′qr, then using ≡ m n q r ℓmn m n q r ℓ qr H g , , , , = g , , , , ′ + O M N Q R X M N Q R X X       and finally re-writing ℓmn = k + ℓ′qr as ℓ′qr = k (mod mn). Since N

5. Mean squares of E±(x,y,z) The aim of this section is to prove (7). We start by using Proposition 4.1 with H = h log X, D = DE, and g : R [0, 1] smooth supported on [1/4, 2] with 0 → g(x) = 1 for x [1/2, 1]; in case of E−(x,y,z) we take λd = αd− and in case of E+(x,y,z) we take∈

p log p + λd = σ a 1 αe,a. √2 − log y a d=pe     X∈I X

This gives

X 2 3 ε E±(x,y,z) S± + S± + S± + h X | | ≪ | 1 | | 2 | | 3 | ZX/2 with S1,S2,S3 as in Proposition 4.1 with the above choices of λd. In the next three subsections we show that S± hX for j =1, 2, 3. j ≪

5.1. Showing that S1± hX. Noticing that γd,h log X dh log X, it suffices to show that ≪ ≪

2

α− 1 (20) d  m  m ≪ log X d DE m DE ≤X m 0X≤ (mod d)   ≡    and

2 + p log p αm,a 1 (21) d  σ a 1  . √2 − log y mp ≪ log X d DE a p     m DaE ≤X X∈I X mp 0≤X (mod d)   ≡    Splitting the sum over p in (21) according to whether p d or not and applying the inequality x + y 2 2x2 +2y2, we see that the left hand| side of (21) is | | ≤

2 + p log p αm,a d  σ a 1  ≪ √2 − log y mp d DE a p d     m DaE ≤X X∈I X| m 0≤X (mod d/p)   ≡   2 + p log p αm,a + + + d  σ a 1  =: S1,1 + S1,2, √2 − log y mp d DE a p∤d     m DaE ≤X X∈I X m 0≤X (mod d)   ≡    say. 14 KAISA MATOMAKI¨

+ Let us first consider S1,1. Applying Cauchy-Schwarz and then substituting d = pd′, we see that

2 + αm,a S+ d   1,1 ≪ mp a √2a p √2a+2 d DE m DaE X∈I ≤X≤ ≤Xp d m 0≤X (mod d/p)  |  ≡    2 + 1 αm,a d′   ≪ a a+2 p ′ m a √2 p √2 d DaE m DaE X∈I ≤X≤ ≤X m 0≤X (mod d′)   ≡   2  + αm,a max d′   . ≪ a ′ m ∈I d DaE m DaE ≤X m 0≤X (mod d′)   ≡   

+ Let us now turn to S1,2. By evaluating the sum over p first and then applying Cauchy-Schwarz, we see that

2 2 + + 1 αm,a 1 αm,a S+ d   d   1,2 ≪ a m ≪ a m d DE a m DaE a d DE m DaE ≤X X∈I m 0≤X (mod d)  X∈I ≤X m 0≤X (mod d)   ≡   ≡   2  

+ αm,a max d   . ≪ a m ∈I d DaE m DaE ≤X m 0≤X (mod d)   ≡   

Hence (21) reduces to showing that

2 + αm,a 1 max d   , a m ≪ log X ∈I d DaE m DaE ≤X m 0≤X (mod d)   ≡    a claim very similar to (20). A similar more general claim will be encountered also in [16]1.

1In the first arXiv version of [16] we used different sieve weights and utilized an incorrect version of Lemma 5.1 below (see Remark 5.2 below), so one should look at a more recent version (which is not yet on arXiv) ALMOST PRIMES IN ALMOST ALL VERY SHORT INTERVALS 15

+ + Note first that the supports of λ(m,P (w,z)),a and ρ(m,P (w)) imply that, for any a , ∈ I 2 + αm,a d   m d DaE m DaE ≤X m 0≤X (mod d)   ≡    2 + + 1m P (z)λ(m,P (w,z)),aρ(m,P (w)) d  |  ≪ m d DaE m DaE ≤X m 0≤X (mod d)   ≡   2  2 + λ+ ρm1 m2,a d1   d2   ≪ m1 m2 d1 E m E,m P (w) d2 Da m D ,m P (w,z) ≤ 1≤ 1| ≤ 2≤ a 2| d1XP (w) m 0X (mod d )  d2 XP (w,z)  m 0X (mod d )  |  1≡ 1  |  2≡ 2      Here the sum over d2 is 1 1 1 2 d2 2 1+ 1+ 1. ≪ · d2 p ≪ p ≪ d2 Da w p

We can argue similarly with (20) and thus, noting that the support of ρm± is contained in [1, E], it suffices to show that 2

ρ± 1 (22) d  m  . m ≪ log X d P (w) m P (w) |X m 0X| (mod d)   ≡   +  We shall concentrate on the claim for ρm, the case of ρm− follows similarly. A similar claim was shown in [9] and also in [7, Lemma 6.18] though there is a slight mistake in the latter proof. For completeness, we provide a detailed proof here. The starting point for proving (22) is the following lemma. Lemma 5.1. Let w 1, let λ be complex numbers, and define θ := λ . ≥ d n d n d Write | 2 P

λm W := d   . m d P (w) m P (w) |X m 0X| (mod d)   ≡  Then  

1 b θbe1 θbe2 (23) W 1 2 | | . ≪ − p ϕ(b) e1e2ϕ(e1e2) p

Proof of Lemma 5.1. Notice that, by M¨obius inversion, λm = m=ab µ(a)θb. Hence, for d P (w), | P λ µ(a)θ θ µ(a) m = b = b m ab b a m P (w) ab P (w) b P (w) a P (w) m 0X| (mod d) dX| ab |X (a,b|X)=1 ≡ | d a (b,d) | θ µ(d/(b, d)) µ(a) = b b d/(b, d) a b P (w) a P (w) |X (a,bd/|X(b,d))=1 1 θ µ(d/(b, d)) 1 1 − = b 1 1 b d/(b, d) − p − p b P (w) p

+ Let us now return to showing (22). By the definition of ρe , we have (see e.g. [13, (6.29) with g(p)= 1p (n,P (w))]), for any n N, | ∈ + + θn := ρe = ρe = 1(n,P (w))=1 + Vr(n, w), e n e (n,P (w)) r odd X| | X X where

Vr(n, w) := 1

n=p1 pr d pr

β−1 r (25) p w := w( β ) r ≥ r (see e.g. [13, Section 6.3]). Hence

ω(n) r r 2 Vr(n, w) 2 − d(n) 2− 1(n,P (wr))=1d(n) . ≤ n ≤ p n = p w | X⇒ ≥ r Consequently

+ r 2 (26) ρ 2− 1 d(n) =: θ′ ,. e ≤ (n,P (wr ))=1 n e n r 0 X| X≥ ε say. Clearly θbe θ′ e θ′ . Plugging this into Lemma 5.1 and noticing that j ≤ bej ≪ j b the sums over e1 and e2 are bounded we obtain 2 + ρm 1 b 2 1 b 2 d   1 θ′ θ′ . m ≪ − p ϕ(b)2 b ≪ log X ϕ(b)2 b d P (w) m P (w) p

b 2 r b 4 r 16p θ′ 2− 1 d(b) 2− 1+ ϕ(b)2 b ≪ ϕ(b)2 (b,P (wr))=1 ≪ (p 1)2 b P (w) r 0 b P (w) r 0 wr p

5.2. Showing that S2± hX. We will establish that (27) ≪

d1m1 g(0)X 1 ε/10 α− α− g X − d1 d2   m ,m X − [d1, d2] ≪ 0< k h log X d1,d2 DE 1 2   | |≤ ≤ d m =d m +k X (d1X,d2) k 1 1 X2 2 b |     and

(28) p1 p2 log p1 log p2 σ a σ a 1 1 √2 1 √2 2 − log y − log y 0< k h log X a1,a2 p1,p2         | |≤X X∈I X

+ + d1p1m1 X 1 ε/10 α α g g(0) X − d1,a1 d2,a2  X − [d p , d p ]  ≪ m1,m2 1 1 2 2 dj Daj E   ≤X d1p1m1=Xd2p2m2+k (p1d1,p2d2) k   |  b  for some small ε> 0. These will follow from Lemmas 4.3 and 4.4. We shall concentrate on (28) which is more involved. It suffices to show that, for any P , P (z/4, 2y], any D DE/P , and any bounded α ,β , one has 1 2 ∈ i ≤ i d d

n1 n2 Λ(n1)Λ(n2)h1 h2 αd1 βd2 n ,n P1 P2 0< k h log X 1 2     d1 D1 | |≤X X d X∼D 2∼ 2 (d1n1,d2n2) k (29) |

d1n1m1 X 1 ε/5  g g(0)  X − m ,m X − [d1n1, d2n2] ≪ 1 2   d1m1n1=Xd2m2n2+k   b  whenever hj are smooth and supported on [1, 2]. 14/25 Now Dj Pj DE X and we can write d1m1n1 = d2m2n2 +k as d1m1n1 ≤ ≤ 5/36 ≡ k (mod d2n2). Furthermore, since P1 z/4 = X /4, we always have D1 5/9+1/1000 5/36 21/50 ≥ 21/50 ≤ DE/P1 4X − X . Consequently, if P1 X , then (29) follows from≤ the second part≤ of Lemma 4.3 with N = min≤D , P and M = { 1 1} max D1, P1 . Noting{ that} d n m d n m H (30) g 1 1 1 = g 2 2 2 + O X X X       and that the summation condition can be written also as d2m2n2 k (mod d1n1), 21/50 ≡− we obtain the claim also in case P2 X . ≤21/50 In the remaining case P1, P2 > X , we apply Vaughan’s identity (see e.g. 1/3 [13, Proposition 13.4] with y = z = Pj ) to n1 and n2. Then it suffices to show that we have (31)

(1) (2) (1) (2) u1 v1 u2 v2 αu1 αu2 βv1 βv2 h1 , h2 , αd1 βd2 U1 P1/U1 U2 P2/U2 0< k h log X u1 U1 d D ∼     1 1 | |≤X u2XU2 d2X∼D2 v ∼,v ∼ 1 2 (d1u1v1,d2u2v2) k |

d1u1v1m1 X 1 2ε  g g(0)  X − m ,m X − [d1u1v1, d2u2v2] ≪ 1 2   d1m1u1v1=Xd2m2u2v2+k   b 

ALMOST PRIMES IN ALMOST ALL VERY SHORT INTERVALS 19 for any h (y ,y ) smooth and supported on [1, 2] [1, 2], any D DE/P and j 1 2 × i ≤ i any bounded coefficients α(j)(u),β(j)(v) such that either U [P 1/3/4, P 1/2], or j ∈ j j U P 1/3/4 and β(j)(v) = 1 for every v. Note that the sums in (31) are supported j ≤ j on d u v DE X14/25. j j j ≪ ≤ Write V = P /U . Since P > X21/50 and U P 1/2, we have D U j j j 1 1 ≤ 1 1 · 1 ≤ DE/P 1/2 X21/50. Hence if V X21/50, the claim follows from the second part 1 ≤ 1 ≤ of Lemma 4.3 with N = min D1U1, V1 and M = max D1U1, V1 . Similarly, using { } 21/50 { } a variant of (30) the claim follows if V2 X . 21/50≤ (j) In the remaining case V1, V2 > X , we have β (vj ) = 1 for every vj . Fur- thermore D U DE/V X7/50. Hence the claim follows from the second part j j ≪ j ≪ of Lemma 4.4 with M = D1U1,N = V1,Q = V2, and R = D2U2. Hence we have established (28). The claim (27) follows similarly to (28), except we use the well-factorability of the linear sieve weights (see [7, Section 12.7]) to 21/50 decompose λ± into convolutions with both factors X , so we can always d1 apply Lemma 4.3. ≤

10 5.3. Showing that S3± hX. Finally we need to show that, for Y 2X,X , we have ≪ ∈{ } 2 Y (32) α−  d  ≪ log X n Y d n X≤ X| and   2 p log p Y (33)  σ 1 α+  . √ a − log y d,a ≪ log X n Y a p n 2 d P (z) ≤ ∈I     X X X| pd|Xn   |    Here α+ = λ+ ρ+ ρ+ d,a d,a e ≪ e d P (z) d P (w,z) e (n,P (w)) e (n,P (w)) pd|Xn | pdXn | X | X | | and, after inserting this to (33), the sums over a and p in (33) are bounded for a given n. Hence (33) reduces to showing 2 Y (34) ρ+  e  ≪ log X n Y e (n,P (w)) X≤ | X   for Y 2X,X10 . Similarly ∈{ }

+ α− ρ + ρ− d ≪ e e d n e (n,P (w)) e (n,P (w)) X| | X | X and thus (32) follows once we have shown that

2 Y ρ±  e  ≪ log X n Y e (n,P (w)) X≤ | X   for Y 2X,X10 . Let∈{ us concentrate} on showing (34) for Y = 2X as other claims follow in the same way. Recall (26) and the definition of the parameter wr from (25). Using (26) 20 KAISA MATOMAKI¨ and applying Cauchy-Schwarz and Shiu bound (see [19]) 2 + r 4 ρ 2− 1 d(n)  e  ≪ (n,P (wr))=1 n 2X e (n,P (w)) r 0 n 2X X≤ | X X≥ X≤   r 1 16 X 2− 1 1+ ≪ − p p r 0 p 2X   wr

[1] Sandro Bettin and Vorrapan Chandee. Trilinear forms with Kloosterman fractions. Adv. Math., 328:1234–1262, 2018. [2] E. Bombieri, J. B. Friedlander, and H. Iwaniec. Primes in arithmetic progressions to large moduli. Acta Math., 156(3-4):203–251, 1986. [3] J.-M. Deshouillers and H. Iwaniec. Power mean values of the Riemann zeta function. Math- ematika, 29(2):202–212 (1983), 1982. [4] J.-M. Deshouillers and H. Iwaniec. Kloosterman sums and Fourier coefficients of cusp forms. Invent. Math., 70(2):219–288, 1982/83. [5] J.-M. Deshouillers and H. Iwaniec. Power mean-values for Dirichlet’s polynomials and the Riemann zeta-function. II. Acta Arith., 43(3):305–312, 1984. [6] W. Duke, J. Friedlander, and H. Iwaniec. Bilinear forms with Kloosterman fractions. Invent. Math., 128(1):23–43, 1997. [7] John Friedlander and Henryk Iwaniec. Opera de cribro, volume 57 of American Mathematical Society Colloquium Publications. American Mathematical Society, Providence, RI, 2010. [8] John B. Friedlander. Sifting short intervals. Math. Proc. Cambridge Philos. Soc., 91(1):9–15, 1982. [9] John B. Friedlander. Sifting short intervals. II. Math. Proc. Cambridge Philos. Soc., 92(3):381–384, 1982. [10] G. Greaves. The weighted linear sieve and Selberg’s λ2-method. Acta Arith., 47(1):71–96, 1986. [11] Glyn Harman. Prime-detecting sieves, volume 33 of London Mathematical Society Mono- graphs Series. Princeton University Press, Princeton, NJ, 2007. [12] D. R. Heath-Brown. Gaps between primes, and the pair correlation of zeros of the zeta function. Acta Arith., 41(1):85–99, 1982. [13] Henryk Iwaniec and Emmanuel Kowalski. Analytic , volume 53 of American Mathematical Society Colloquium Publications. American Mathematical Society, Providence, RI, 2004. [14] Chaohua Jia. Almost all short intervals containing prime numbers. Acta Arith., 76(1):21–84, 1996. [15] Kaisa Matom¨aki. A note on smooth numbers in short intervals. Int. J. Number Theory, 6(5):1113–1116, 2010. [16] Kaisa Matom¨aki and Maksym Radziwi l l. Multiplicative functions in short intervals II. Pre- print (2020), arXiv:2007.04290. [17] Hiroshi Mikawa. Almost-primes in arithmetic progressions and short intervals. Tsukuba J. Math., 13(2):387–401, 1989. [18] H.-E. Richert. Selberg’s sieve with weights. Mathematika, 16:1–22, 1969. [19] P. Shiu. A Brun-Titchmarsh theorem for multiplicative functions. J. Reine Angew. Math., 313:161–170, 1980. ALMOST PRIMES IN ALMOST ALL VERY SHORT INTERVALS 21

[20] Joni Ter¨av¨ainen. Almost primes in almost all short intervals. Math. Proc. Cambridge Philos. Soc., 161(2):247–281, 2016. [21] Jie Wu. Almost primes in short intervals. Sci. China Math., 53(9):2511–2524, 2010.

Department of Mathematics and Statistics, University of Turku, 20014 Turku, Fin- land Email address: [email protected]