Introduction
For a positive integer k k k let v 2 ( k ) v_2(k) v 2 ( k ) denote the exponent of 2 in k k k . In a joint paper with J. Dixmier, J.-L. Nicolas considered the function
c ( n ) = ∑ k = 1 n 2 v 2 ( k ) , n ≥ 1 , (1) c(n)=\sum_{k=1}^{n}2^{v_2(k)},\qquad n\ge1, \tag*{(1)} c ( n ) = k = 1 ∑ n 2 v 2 ( k ) , n ≥ 1 , (1)
which is the exponent of 1 + X 1+X 1 + X in the factorization of ( 1 + X ) ( 1 + X 2 ) ⋯ ( 1 + X n ) (1+X)(1+X^2)\cdots(1+X^n) ( 1 + X ) ( 1 + X 2 ) ⋯ ( 1 + X n ) into irreducible factors over F 2 [ X ] \mathbb{F}_2[X] F 2 [ X ] , and in his list of open questions [1 ] he asked how often a power of 2 belongs to the image of c c c . The sequence ( c ( n ) ) n ≥ 1 = 1 , 3 , 4 , 8 , 9 , 11 , 12 , 20 , … (c(n))_{n\ge1}=1,3,4,8,9,11,12,20,\ldots ( c ( n ) ) n ≥ 1 = 1 , 3 , 4 , 8 , 9 , 11 , 12 , 20 , … of the partial sums of the highest power of 2 dividing k k k is the sequence M2344 of the encyclopedia of Sloane and Plouffe [2 ] . It satisfies the recurrence c ( 2 n ) = 2 c ( n ) + n c(2n)=2c(n)+n c ( 2 n ) = 2 c ( n ) + n and the formulas c ( 2 r ) = 2 r − 1 ( r + 2 ) c(2^r)=2^{r-1}(r+2) c ( 2 r ) = 2 r − 1 ( r + 2 ) and c ( 2 r − 1 ) = r 2 r − 1 c(2^r-1)=r2^{r-1} c ( 2 r − 1 ) = r 2 r − 1 [1 ] , and the recurrence splits at half, a class of recurrences whose identities and periodic oscillations are studied by Hwang, Janson and Tsai [3 ] . With
A = { a ≥ 0 : 2 a ∈ c ( N ) } , A ( x ) = # { a ∈ A : a ≤ x } , B ( x ) = # { a ∈ Z ∩ [ 0 , x ] : a ∉ A } , (2) \mathcal{A}=\{a\geq0:2^a\in c(\mathbb{N})\},\qquad A(x)=\#\{a\in\mathcal{A}:a\leq x\},\qquad B(x)=\#\{a\in\mathbb{Z}\cap[0,x]:a\notin\mathcal{A}\}, \tag*{(2)} A = { a ≥ 0 : 2 a ∈ c ( N )} , A ( x ) = # { a ∈ A : a ≤ x } , B ( x ) = # { a ∈ Z ∩ [ 0 , x ] : a ∈ / A } , (2)
Nicolas showed that A ( x ) → ∞ A(x)\to\infty A ( x ) → ∞ and B ( x ) → ∞ B(x)\to\infty B ( x ) → ∞ , and asked whether the behaviour of A ( x ) A(x) A ( x ) can be made precise; his table gives, for instance, the values 635 for x = 1000 x=1000 x = 1000 and 5963 for x = 10000 x=10000 x = 10000 [1 ] , which are the numbers of exponents 1 ≤ a ≤ x 1\leq a\leq x 1 ≤ a ≤ x in A \mathcal{A} A , that is A ( x ) − 1 A(x)-1 A ( x ) − 1 in the notation (2) , since c ( 1 ) = 2 0 c(1)=2^0 c ( 1 ) = 2 0 (§ 10 ). He obtained these limits from three families: 2 a ∉ c ( N ) 2^a\notin c(\mathbb{N}) 2 a ∈ / c ( N ) when a = 2 r + r − 2 a=2^r+r-2 a = 2 r + r − 2 ; a + ( 2 a − 11 ) / 3 ∈ A a+(2^a-11)/3\in\mathcal{A} a + ( 2 a − 11 ) /3 ∈ A for odd a a a ; and a + ( 2 a − 10 ) / 3 ∉ A a+(2^a-10)/3\notin\mathcal{A} a + ( 2 a − 10 ) /3 ∈ / A for even a a a [1 ] .
The same list contains a question on a family of fractions, namely the size of the largest numerator A ( N ) A(N) A ( N ) of ∏ n ≤ N ( ( n + 1 ) / n ) ε ( n ) \prod_{n\leq N}((n+1)/n)^{\varepsilon(n)} ∏ n ≤ N (( n + 1 ) / n ) ε ( n ) with ε ( n ) ∈ { − 1 , 0 , 1 } \varepsilon(n)\in\{-1,0,1\} ε ( n ) ∈ { − 1 , 0 , 1 } ; for that question de la Bretèche, Pomerance and Tenenbaum proved log A ( N ) = { κ + o ( 1 ) } N log N \log A(N)=\{\kappa+o(1)\}N\log N log A ( N ) = { κ + o ( 1 )} N log N with an explicit constant κ ≈ 0.107005 \kappa\approx0.107005 κ ≈ 0.107005 [4 ] . The present paper is concerned with the question on c ( n ) c(n) c ( n ) only.
Contributions. We prove the following results.
The identity c ( n ) = n + 1 2 ∑ i ∈ B ( n ) 2 i c(n)=n+\frac{1}{2}\sum_{i\in\mathcal{B}(n)}2^i c ( n ) = n + 2 1 ∑ i ∈ B ( n ) 2 i , where B ( n ) \mathcal{B}(n) B ( n ) is the set of positions of the binary digits 1 of n n n , equivalently c ( n ) = n + ∑ k ≥ 1 2 k − 1 ⌊ n / 2 k ⌋ c(n)=n+\sum_{k\geq1}2^{k-1}\lfloor n/2^k\rfloor c ( n ) = n + ∑ k ≥ 1 2 k − 1 ⌊ n / 2 k ⌋ , and the equivalence a ∈ A ⟺ 2 a + 3 = ∑ j ∈ T 2 j 2 j a\in\mathcal{A}\Longleftrightarrow2^{a+3}=\sum_{j\in T}2^{j2^j} a ∈ A ⟺ 2 a + 3 = ∑ j ∈ T 2 j 2 j for a finite set T T T of positive integers (Lemma 2.1, Theorem 2.2 ).
The numbers j 2 j j2^j j 2 j form a superincreasing sequence. Consequently, for every a ≥ 0 a\geq0 a ≥ 0 there is at most one integer K ≥ 2 K\geq2 K ≥ 2 that can be the largest element of T T T , namely the solution of K + ⌈ log 2 K ⌉ = a + 3 K+\lceil\log_2K\rceil=a+3 K + ⌈ log 2 K ⌉ = a + 3 , and such a K K K fails to exist exactly for a = 2 r + r − 2 a=2^r+r-2 a = 2 r + r − 2 , r ≥ 1 r\geq1 r ≥ 1 (Theorem 3.3 ). This recovers the first family of Nicolas and shows that it is the only obstruction of this kind.
Infinite explicit families of members of A \mathcal{A} A , given by the closed formula c ( 2 K − 2 + 2 K − s − 2 ) = 2 K + h − 3 c(2^{K-2}+2^{K-s-2})=2^{K+h-3} c ( 2 K − 2 + 2 K − s − 2 ) = 2 K + h − 3 for s = 2 k s=2^k s = 2 k , k ≥ 0 k\geq0 k ≥ 0 , h ≡ k ( m o d 2 k + 1 ) h\equiv k\pmod{2^k+1} h ≡ k ( mod 2 k + 1 ) and K = ( 2 h + s + s ) / ( 2 s + 1 ) K=(2^{h+s}+s)/(2^s+1) K = ( 2 h + s + s ) / ( 2 s + 1 ) (Theorem 5.1 ), and infinite explicit families of non-members, indexed by s = 3 s=3 s = 3 and by s = 2 i s=2^i s = 2 i , i ≥ 1 i\geq1 i ≥ 1 (Theorem 6.1 ). The second and third families of Nicolas are the cases s = 1 s=1 s = 1 of Theorem 5.1 and s = 2 s=2 s = 2 of Theorem 6.1 . These families are complete in the following sense: they are exactly the exponents that Algorithm 1 decides in at most one iteration (Theorem 6.2 ).
A ( x ) ≥ ( 2 + o ( 1 ) ) log 2 x , B ( x ) ≥ ( 5 4 + E 2 + o ( 1 ) ) log 2 x , E = ∑ i ≥ 1 1 2 i − 1 = 1.6066951 … , A(x)\geq(2+o(1))\log_2x,\qquad B(x)\geq\left(\frac{5}{4}+\frac{E}{2}+o(1)\right)\log_2x,\qquad E=\sum_{i\geq1}\frac{1}{2^i-1}=1.6066951\ldots, A ( x ) ≥ ( 2 + o ( 1 )) log 2 x , B ( x ) ≥ ( 4 5 + 2 E + o ( 1 ) ) log 2 x , E = i ≥ 1 ∑ 2 i − 1 1 = 1.6066951 … ,
so that 5 4 + E 2 = 2.0533475 … \frac{5}{4}+\frac{E}{2}=2.0533475\ldots 4 5 + 2 E = 2.0533475 … .
The states of the recursion form a forest: the roots are the states ( J , 0 ) (J,0) ( J , 0 ) , one at each level, and the failing states, whose number up to level L L L is given by an explicit formula; each state ( J ′ , w ′ ) (J',w') ( J ′ , w ′ ) has exactly v 2 ( J ′ + 1 + w ′ ) v_2(J'+1+w') v 2 ( J ′ + 1 + w ′ ) children; and the initial states are the states with J + 1 + w J+1+w J + 1 + w a power of 2 (Theorem 8.4 ). The root of the tree of a successful state is determined by the least element of its representing set, and exactly half of the successful states of each level lie in the tree of the root $(1,0) (Proposition 8.5). The sets S J S_J S J satisfy the recursion S J = { c / 2 : c ∈ S J − 1 } ∪ { ( c + J ) / 2 : c ∈ S J − 1 odd } S_J=\{c/2:c\in S_{J-1}\}\cup\{(c+J)/2:c\in S_{J-1}\text{ odd}\} S J = { c /2 : c ∈ S J − 1 } ∪ {( c + J ) /2 : c ∈ S J − 1 odd } for odd J J J and S J = { c / 2 , c + J / 2 : c ∈ S J − 1 even } S_J=\{c/2,c+J/2:c\in S_{J-1}\text{ even}\} S J = { c /2 , c + J /2 : c ∈ S J − 1 even } for even J J J ; in particular S J S_J S J is periodic with period J / 2 J/2 J /2 for even J J J (Theorem 8.6 ). The symmetry yields three further explicit families, among them c ( 2 2 r − 1 ) = 2 2 r + r − 1 c(2^{2^r}-1)=2^{2^r+r-1} c ( 2 2 r − 1 ) = 2 2 r + r − 1 (Theorem 8.7 ), and the improved bounds A ( x ) ≥ ( 3.9655 … + o ( 1 ) ) log 2 x A(x)\geq(3.9655\ldots+o(1))\log_2x A ( x ) ≥ ( 3.9655 … + o ( 1 )) log 2 x and B ( x ) ≥ ( 2.8178 … + o ( 1 ) ) log 2 x B(x)\geq(2.8178\ldots+o(1))\log_2x B ( x ) ≥ ( 2.8178 … + o ( 1 )) log 2 x (Theorem 8.8 ). The sets S J S_J S J of successful states, the roots ( J , 0 ) (J,0) ( J , 0 ) : the number N ( J ) = ∣ S J ∣ N(J)=|S_J| N ( J ) = ∣ S J ∣ counts the sets T ⊆ { 1 , … , J } T\subseteq\{1,\ldots,J\} T ⊆ { 1 , … , J } with ∑ j ∈ T j 2 j ≡ 0 ( m o d 2 J + 1 ) \sum_{j\in T}j2^j\equiv0\pmod{2^{J+1}} ∑ j ∈ T j 2 j ≡ 0 ( mod 2 J + 1 ) , S J S_J S J is symmetric under w ↦ J − 1 − w w\mapsto J-1-w w ↦ J − 1 − w , N ( 2 k + 1 ) = N ( 2 k ) N(2k+1)=N(2k) N ( 2 k + 1 ) = N ( 2 k ) , and $4\mid N(J)$ for J ≥ 4 J\geq4 J ≥ 4 (§ 8 ).
The analogue for every prime p p p (§ 9 ), with the complete description of the immediate failures, the bottom-up recursion and the symmetry w ↦ ( p − 1 ) K − w w \mapsto(p-1)K-w w ↦ ( p − 1 ) K − w (Theorems 9.6 and 9.7 ): c p ( n ) = ∑ k ≤ n p v p ( k ) c_p(n)=\sum_{k\le n}p^{v_p(k)} c p ( n ) = ∑ k ≤ n p v p ( k ) is the exponent of 1 − X 1-X 1 − X in ( 1 − X ) ( 1 − X p ) ⋯ ( 1 − X p n ) (1-X)(1-X^p)\cdots(1-X^{p^n}) ( 1 − X ) ( 1 − X p ) ⋯ ( 1 − X p n ) over F p [ X ] \mathbb{F}_p[X] F p [ X ] ; the reduction to digit sums of the numbers p i ( ( p − 1 ) i + p ) p^i((p-1)i+p) p i (( p − 1 ) i + p ) , the unique candidate, the exponents ( p g − 1 ) / ( p − 1 ) + g − 1 (p^g-1)/(p-1)+g-1 ( p g − 1 ) / ( p − 1 ) + g − 1 without candidate, the recursion, and explicit families, among them a family of non-members with no analogue for p = 2 p=2 p = 2 (Theorems 9.3 , 9.4 and 9.5 ).
Experiments (§ 10 ) with exact integer arithmetic: a verification of the statements above by three independent methods, among them a brute-force search over n ≤ 2 24 n\le2^{24} n ≤ 2 24 ; the values of A ( x ) A(x) A ( x ) and B ( x ) B(x) B ( x ) for x ≤ 20000 x\le20000 x ≤ 20000 , which agree with the table of Nicolas; the sets S J S_J S J for J ≤ 65536 J\le65536 J ≤ 65536 , from which A ( x ) A(x) A ( x ) is obtained for x ≤ 65000 x\le65000 x ≤ 65000 ; and the proportion of exponents in A \mathcal{A} A among the candidates K ∈ ( 2 h − 1 , 2 h ] K\in(2^{h-1},2^h] K ∈ ( 2 h − 1 , 2 h ] for h ≤ 16 h\le16 h ≤ 16 .
§ 2 proves the identity and the equivalence, § 3 treats the largest element of T T T , § 4 gives the recursion, Sections 5 and § 6 give the explicit families, § 7 proves the counting bounds, § 8 studies the successful states, § 9 treats an arbitrary prime, § 10 reports the experiments and § 11 concludes.
Notation. N = { 1 , 2 , 3 , … } \mathbb{N}=\{1,2,3,\ldots\} N = { 1 , 2 , 3 , … } . For n ≥ 1 n\ge1 n ≥ 1 , B ( n ) ⊂ { 0 , 1 , 2 , … } B(n)\subset\{0,1,2,\ldots\} B ( n ) ⊂ { 0 , 1 , 2 , … } is the set of positions of the digits 1 in the binary expansion of n n n , so that n = ∑ i ∈ B ( n ) 2 i n=\sum_{i\in B(n)}2^i n = ∑ i ∈ B ( n ) 2 i . For J ≥ 0 J\ge0 J ≥ 0 we put
E J = { ∑ j ∈ T j 2 j : T ⊆ { 1 , … , J } } , E = ⋃ J ≥ 0 E J , (3) E_J=\left\{\sum_{j\in T}j2^j:T\subseteq\{1,\ldots,J\}\right\},\qquad E=\bigcup_{J\ge0}E_J, \tag*{(3)} E J = ⎩ ⎨ ⎧ j ∈ T ∑ j 2 j : T ⊆ { 1 , … , J } ⎭ ⎬ ⎫ , E = J ≥ 0 ⋃ E J , (3)
with E 0 = { 0 } E_0=\{0\} E 0 = { 0 } (empty sum).
The function c ( n ) c(n) c ( n ) and sums of j 2 j j2^j j 2 j
Lemma 2.1. For every r ≥ 0 r\ge0 r ≥ 0 , c ( 2 r ) = 2 r − 1 ( r + 2 ) c(2^r)=2^{r-1}(r+2) c ( 2 r ) = 2 r − 1 ( r + 2 ) , and for every n ≥ 1 n\ge1 n ≥ 1 ,
c ( n ) = ∑ i ∈ B ( n ) 2 i − 1 ( i + 2 ) = n + 1 2 ∑ i ∈ B ( n ) i 2 i . (4) c(n)=\sum_{i\in B(n)}2^{i-1}(i+2)=n+\frac{1}{2}\sum_{i\in B(n)}i2^i. \tag*{(4)} c ( n ) = i ∈ B ( n ) ∑ 2 i − 1 ( i + 2 ) = n + 2 1 i ∈ B ( n ) ∑ i 2 i . (4)
Proof. For r ≥ 0 r\ge0 r ≥ 0 , the number of k ∈ [ 1 , 2 r − 1 ] k\in[1,2^r-1] k ∈ [ 1 , 2 r − 1 ] with v 2 ( k ) = v v_2(k)=v v 2 ( k ) = v is 2 r − 1 − v 2^{r-1-v} 2 r − 1 − v for 0 ≤ v ≤ r − 1 0\le v\le r-1 0 ≤ v ≤ r − 1 , so c ( 2 r − 1 ) = ∑ v = 0 r − 1 v 2 r − 1 − v = r 2 r − 1 c(2^r-1)=\sum_{v=0}^{r-1}v2^{r-1-v}=r2^{r-1} c ( 2 r − 1 ) = ∑ v = 0 r − 1 v 2 r − 1 − v = r 2 r − 1 and c ( 2 r ) = r 2 r − 1 + 2 r = 2 r − 1 ( r + 2 ) c(2^r)=r2^{r-1}+2^r=2^{r-1}(r+2) c ( 2 r ) = r 2 r − 1 + 2 r = 2 r − 1 ( r + 2 ) . If m ≥ 0 m\ge0 m ≥ 0 and 1 ≤ s < 2 m 1\le s<2^m 1 ≤ s < 2 m , then v 2 ( 2 m + k ) = v 2 ( k ) v_2(2^m+k)=v_2(k) v 2 ( 2 m + k ) = v 2 ( k ) for 1 ≤ k ≤ s 1\le k\le s 1 ≤ k ≤ s , hence c ( 2 m + s ) = c ( 2 m ) + c ( s ) c(2^m+s)=c(2^m)+c(s) c ( 2 m + s ) = c ( 2 m ) + c ( s ) . Writing n = 2 n 1 + ⋯ + 2 n t n=2^{n_1}+\cdots+2^{n_t} n = 2 n 1 + ⋯ + 2 n t with n 1 > ⋯ > n t n_1>\cdots>n_t n 1 > ⋯ > n t and applying this relation t − 1 t-1 t − 1 times gives c ( n ) = ∑ l = 1 t c ( 2 n l ) = ∑ i ∈ B ( n ) 2 i − 1 ( i + 2 ) c(n)=\sum_{l=1}^t c(2^{n_l})=\sum_{i\in B(n)}2^{i-1}(i+2) c ( n ) = ∑ l = 1 t c ( 2 n l ) = ∑ i ∈ B ( n ) 2 i − 1 ( i + 2 ) . Finally 2 i − 1 ( i + 2 ) = 1 2 i 2 i + 2 i 2^{i-1}(i+2)=\frac{1}{2}i2^i+2^i 2 i − 1 ( i + 2 ) = 2 1 i 2 i + 2 i and ∑ i ∈ B ( n ) 2 i = n \sum_{i\in B(n)}2^i=n ∑ i ∈ B ( n ) 2 i = n .
The first equality of (4) is formula (7.4) of [1 ] . The second form is equivalent to c ( n ) = n + ∑ k ≥ 1 2 k − 1 ⌊ n / 2 k ⌋ c(n)=n+\sum_{k\ge1}2^{k-1}\lfloor n/2^k\rfloor c ( n ) = n + ∑ k ≥ 1 2 k − 1 ⌊ n / 2 k ⌋ : since ⌊ n / 2 k ⌋ = ∑ i ∈ B ( n ) , i ≥ k 2 i − k \lfloor n/2^k\rfloor=\sum_{i\in B(n),\,i\ge k}2^{i-k} ⌊ n / 2 k ⌋ = ∑ i ∈ B ( n ) , i ≥ k 2 i − k ,
∑ k ≥ 1 2 k − 1 ⌊ n 2 k ⌋ = ∑ i ∈ B ( n ) ∑ k = 1 i 2 k − 1 2 i − k = ∑ i ∈ B ( n ) i 2 i − 1 . \sum_{k\ge1}2^{k-1}\left\lfloor\frac{n}{2^k}\right\rfloor
=\sum_{i\in B(n)}\sum_{k=1}^{i}2^{k-1}2^{i-k}
=\sum_{i\in B(n)}i2^{i-1}. k ≥ 1 ∑ 2 k − 1 ⌊ 2 k n ⌋ = i ∈ B ( n ) ∑ k = 1 ∑ i 2 k − 1 2 i − k = i ∈ B ( n ) ∑ i 2 i − 1 .
The binary form 1 2 ∑ i ∈ B ( n ) i 2 i \frac{1}{2}\sum_{i\in B(n)}i2^i 2 1 ∑ i ∈ B ( n ) i 2 i is the one used below.
Theorem 2.2. Let a ≥ 0 a\ge0 a ≥ 0 . Then a ∈ A a\in\mathcal{A} a ∈ A if and only if 2 a + 3 ∈ E 2^{a+3}\in E 2 a + 3 ∈ E . More precisely, if T T T is a finite set of positive integers with ∑ j ∈ T j 2 j = 2 a + 3 \sum_{j\in T}j2^j=2^{a+3} ∑ j ∈ T j 2 j = 2 a + 3 , then 1 ∉ T 1\notin T 1 ∈ / T , and n = ∑ j ∈ T 2 j − 2 n=\sum_{j\in T}2^{j-2} n = ∑ j ∈ T 2 j − 2 satisfies c ( n ) = 2 a c(n)=2^a c ( n ) = 2 a ; conversely, if c ( n ) = 2 a c(n)=2^a c ( n ) = 2 a , then T = B ( n ) + 2 T=B(n)+2 T = B ( n ) + 2 satisfies ∑ j ∈ T j 2 j = 2 a + 3 \sum_{j\in T}j2^j=2^{a+3} ∑ j ∈ T j 2 j = 2 a + 3 .
Proof. By (4), 8 c ( n ) = ∑ i ∈ B ( n ) ( i + 2 ) 2 i + 2 = ∑ j ∈ B ( n ) + 2 j 2 j 8c(n)=\sum_{i\in B(n)}(i+2)2^{i+2}=\sum_{j\in B(n)+2}j2^j 8 c ( n ) = ∑ i ∈ B ( n ) ( i + 2 ) 2 i + 2 = ∑ j ∈ B ( n ) + 2 j 2 j , which gives the converse part. For the direct part, every j ≥ 2 j\ge2 j ≥ 2 gives j 2 j ≡ 0 ( m o d 8 ) j2^j\equiv0\pmod8 j 2 j ≡ 0 ( mod 8 ) , while 1 ⋅ 2 1 = 2 1\cdot2^1=2 1 ⋅ 2 1 = 2 ; since 2 a + 3 ≡ 0 ( m o d 8 ) 2^{a+3}\equiv0\pmod8 2 a + 3 ≡ 0 ( mod 8 ) , 1 ∉ T 1\notin T 1 ∈ / T . As 2 a + 3 > 0 2^{a+3}>0 2 a + 3 > 0 , T ≠ ∅ T\ne\varnothing T = ∅ , so n = ∑ j ∈ T 2 j − 2 n=\sum_{j\in T}2^{j-2} n = ∑ j ∈ T 2 j − 2 is a positive integer with B ( n ) = T − 2 B(n)=T-2 B ( n ) = T − 2 , and 8 c ( n ) = ∑ j ∈ T j 2 j = 2 a + 3 8c(n)=\sum_{j\in T}j2^j=2^{a+3} 8 c ( n ) = ∑ j ∈ T j 2 j = 2 a + 3 .
:::
The largest element of T T T
Lemma 3.1. For every J ≥ 0 J \ge0 J ≥ 0 , ∑ j = 1 J j 2 j = ( J − 1 ) 2 J + 1 + 2 \sum_{j=1}^{J} j2^j = (J-1)2^{J+1}+2 ∑ j = 1 J j 2 j = ( J − 1 ) 2 J + 1 + 2 . In particular max E J = ( J − 1 ) 2 J + 1 + 2 < ( J + 1 ) 2 J + 1 \max\mathcal{E}_J=(J-1)2^{J+1}+2<(J+1)2^{J+1} max E J = ( J − 1 ) 2 J + 1 + 2 < ( J + 1 ) 2 J + 1 .
Proof. The identity holds for J = 0 J=0 J = 0 , and if it holds for J J J , then ( J − 1 ) 2 J + 1 + 2 + ( J + 1 ) 2 J + 1 = J 2 J + 2 + 2 (J-1)2^{J+1}+2+(J+1)2^{J+1}=J2^{J+2}+2 ( J − 1 ) 2 J + 1 + 2 + ( J + 1 ) 2 J + 1 = J 2 J + 2 + 2 . The inequality is 2 < 2 J + 2 2<2^{J+2} 2 < 2 J + 2 .
Lemma 3.2. Let J ≥ 1 J \ge1 J ≥ 1 and V ∈ E J V \in\mathcal{E}_J V ∈ E J with V > 0 V>0 V > 0 , and let T ⊆ { 1 , … , J } T\subseteq\{1,\ldots,J\} T ⊆ { 1 , … , J } with ∑ i ∈ T i 2 i = V \sum_{i\in T}i2^i=V ∑ i ∈ T i 2 i = V . Then max T \max T max T is the largest j ∈ { 1 , … , J } j\in\{1,\ldots,J\} j ∈ { 1 , … , J } with j 2 j ≤ V j2^j\le V j 2 j ≤ V , and T T T is unique. Consequently, if V > 0 V>0 V > 0 and j j j is the largest element of { 1 , … , J } \{1,\ldots,J\} { 1 , … , J } with j 2 j ≤ V j2^j\le V j 2 j ≤ V , then V ∈ E J V\in\mathcal{E}_J V ∈ E J if and only if V − j 2 j ∈ E j − 1 V-j2^j\in\mathcal{E}_{j-1} V − j 2 j ∈ E j − 1 .
Proof. Let m = max T m=\max T m = max T , so m 2 m ≤ V m2^m\le V m 2 m ≤ V . If some j j j with m < j ≤ J m<j\le J m < j ≤ J satisfied j 2 j ≤ V j2^j\le V j 2 j ≤ V , Lemma 3.1 would give V ≤ ∑ i = 1 m i 2 i < ( m + 1 ) 2 m + 1 ≤ j 2 j ≤ V V\le\sum_{i=1}^{m}i2^i<(m+1)2^{m+1}\le j2^j\le V V ≤ ∑ i = 1 m i 2 i < ( m + 1 ) 2 m + 1 ≤ j 2 j ≤ V , a contradiction. Hence m m m is determined by V V V , and uniqueness of T T T follows by induction on ∣ T ∣ |T| ∣ T ∣ applied to V − m 2 m ∈ E m − 1 V-m2^m\in\mathcal{E}_{m-1} V − m 2 m ∈ E m − 1 . For the last statement, if V ∈ E J V\in\mathcal{E}_J V ∈ E J the representing set has largest element j j j , so V − j 2 j ∈ E j − 1 V-j2^j\in\mathcal{E}_{j-1} V − j 2 j ∈ E j − 1 ; conversely, adding j j j to a set representing V − j 2 j V-j2^j V − j 2 j in E j − 1 \mathcal{E}_{j-1} E j − 1 represents V V V in E J \mathcal{E}_J E J .
For K ≥ 2 K\ge2 K ≥ 2 put
h ( K ) = ⌈ log 2 K ⌉ , β ( K ) = K + h ( K ) . (5) h(K)=\lceil\log_2 K\rceil,\qquad\beta(K)=K+h(K). \tag*{(5)} h ( K ) = ⌈ log 2 K ⌉ , β ( K ) = K + h ( K ) . (5)
Theorem 3.3. Let b ≥ 3 b\ge3 b ≥ 3 .
If 2 b ∈ E 2^b\in\mathcal{E} 2 b ∈ E and T T T is the set representing 2 b 2^b 2 b , then K = max T K=\max T K = max T satisfies K ≥ 2 K\ge2 K ≥ 2 and β ( K ) = b \beta(K)=b β ( K ) = b .
The map β \beta β is strictly increasing on { 2 , 3 , … } \{2,3,\ldots\} { 2 , 3 , … } , and { b ≥ 3 } ∖ β ( { 2 , 3 , … } ) = { 2 r + r + 1 : r ≥ 1 } \{b\ge3\}\setminus\beta(\{2,3,\ldots\})=\{2^r+r+1:r\ge1\} { b ≥ 3 } ∖ β ({ 2 , 3 , … }) = { 2 r + r + 1 : r ≥ 1 } .
If b = β ( K ) b=\beta(K) b = β ( K ) and h = h ( K ) h=h(K) h = h ( K ) , then 0 ≤ 2 h − K ≤ K − 2 0\le2^h-K\le K-2 0 ≤ 2 h − K ≤ K − 2 , and 2 b ∈ E 2^b\in\mathcal{E} 2 b ∈ E if and only if 2 K ( 2 h − K ) ∈ E K − 1 2^K(2^h-K)\in\mathcal{E}_{K-1} 2 K ( 2 h − K ) ∈ E K − 1 .
In particular, for a ≥ 0 a\ge0 a ≥ 0 : if a = 2 r + r − 2 a=2^r+r-2 a = 2 r + r − 2 with r ≥ 1 r\ge1 r ≥ 1 , then a ∉ A a\notin\mathcal{A} a ∈ / A ; otherwise there is exactly one K ≥ 2 K\ge2 K ≥ 2 with β ( K ) = a + 3 \beta(K)=a+3 β ( K ) = a + 3 , and a ∈ A a\in\mathcal{A} a ∈ A if and only if 2 K ( 2 h ( K ) − K ) ∈ E K − 1 2^K(2^{h(K)}-K)\in\mathcal{E}_{K-1} 2 K ( 2 h ( K ) − K ) ∈ E K − 1 .
Proof. (1) By Lemma 3.1 , K 2 K ≤ 2 b ≤ ( K − 1 ) 2 K + 1 + 2 K2^K\le2^b\le(K-1)2^{K+1}+2 K 2 K ≤ 2 b ≤ ( K − 1 ) 2 K + 1 + 2 . If K = 1 K=1 K = 1 this gives 2 b = 2 2^b=2 2 b = 2 , contradicting b ≥ 3 b\ge3 b ≥ 3 ; so K ≥ 2 K\ge2 K ≥ 2 . Put g = b − K g=b-K g = b − K . Then 2 g ≥ K ≥ 2 2^g\ge K\ge2 2 g ≥ K ≥ 2 , so g ≥ 1 g\ge1 g ≥ 1 , and 2 g ≤ 2 K − 2 + 2 1 − K < 2 K − 1 2^g\le2K-2+2^{1-K}<2K-1 2 g ≤ 2 K − 2 + 2 1 − K < 2 K − 1 , hence 2 g ≤ 2 K − 2 2^g\le2K-2 2 g ≤ 2 K − 2 . Thus K ≤ 2 g < 2 K K\le2^g<2K K ≤ 2 g < 2 K , that is g = ⌈ log 2 K ⌉ g=\lceil\log_2 K\rceil g = ⌈ log 2 K ⌉ and b = β ( K ) b=\beta(K) b = β ( K ) .
(2) β ( K + 1 ) − β ( K ) = 1 + ⌈ log 2 ( K + 1 ) ⌉ − ⌈ log 2 K ⌉ \beta(K+1)-\beta(K)=1+\lceil\log_2(K+1)\rceil-\lceil\log_2K\rceil β ( K + 1 ) − β ( K ) = 1 + ⌈ log 2 ( K + 1 )⌉ − ⌈ log 2 K ⌉ , and ⌈ log 2 ( K + 1 ) ⌉ > ⌈ log 2 K ⌉ \lceil\log_2(K+1)\rceil>\lceil\log_2K\rceil ⌈ log 2 ( K + 1 )⌉ > ⌈ log 2 K ⌉ exactly when K K K is a power of 2 2 2 , in which case the difference of the ceilings is 1 1 1 . Hence β \beta β increases by 1 1 1 at each step except from K = 2 r K=2^r K = 2 r to K = 2 r + 1 K=2^r+1 K = 2 r + 1 , where β ( 2 r ) = 2 r + r \beta(2^r)=2^r+r β ( 2 r ) = 2 r + r and β ( 2 r + 1 ) = 2 r + r + 2 \beta(2^r+1)=2^r+r+2 β ( 2 r + 1 ) = 2 r + r + 2 ; since β ( 2 ) = 3 \beta(2)=3 β ( 2 ) = 3 , the values b ≥ 3 b\ge3 b ≥ 3 not taken are exactly 2 r + r + 1 2^r+r+1 2 r + r + 1 , r ≥ 1 r\ge1 r ≥ 1 .
(3) Since 2 h − 1 < K ≤ 2 h 2^{h-1}<K\le2^h 2 h − 1 < K ≤ 2 h , we have K ≥ 2 h − 1 + 1 K\ge2^{h-1}+1 K ≥ 2 h − 1 + 1 , so 2 h ≤ 2 K − 2 2^h\le2K-2 2 h ≤ 2 K − 2 , which gives 0 ≤ 2 h − K ≤ K − 2 0\le2^h-K\le K-2 0 ≤ 2 h − K ≤ K − 2 . If 2 b ∈ E 2^b\in\mathcal{E} 2 b ∈ E , part (1) and part (2) show that the largest element of the representing set is K K K , and Lemma 3.2 gives 2 b − K 2 K = 2 K ( 2 h − K ) ∈ E K − 1 2^b-K2^K=2^K(2^h-K)\in\mathcal{E}_{K-1} 2 b − K 2 K = 2 K ( 2 h − K ) ∈ E K − 1 . Conversely, if 2 K ( 2 h − K ) ∈ E K − 1 2^K(2^h-K)\in\mathcal{E}_{K-1} 2 K ( 2 h − K ) ∈ E K − 1 , adding K K K to the representing set represents 2 b 2^b 2 b .
The final statement follows from Theorem 2.2 with b = a + 3 b=a+3 b = a + 3 .
The exponents a = 2 r + r − 2 a=2^r+r-2 a = 2 r + r − 2 are those of the first family of Nicolas [1 ] . Theorem 3.3 shows that every other a a a has exactly one candidate leading term, and that the candidates K K K for a ≤ x a\le x a ≤ x are the integers 2 ≤ K ≤ K max ( x ) 2\le K\le K_{\max}(x) 2 ≤ K ≤ K m a x ( x ) , where K max ( x ) K_{\max}(x) K m a x ( x ) is the largest K K K with β ( K ) ≤ x + 3 \beta(K)\le x+3 β ( K ) ≤ x + 3 .
A recursion on small integers
By Theorem 3.3 (3), the membership of a a a in A \mathcal{A} A is the question whether 2 J + 1 w ∈ E J 2^{J+1}w\in\mathcal{E}_J 2 J + 1 w ∈ E J for the pair ( J , w ) = ( K − 1 , 2 h − K ) (J,w)=(K-1,2^h-K) ( J , w ) = ( K − 1 , 2 h − K ) , which satisfies J ≥ 1 J\ge1 J ≥ 1 and 0 ≤ w ≤ J − 1 0\le w\le J-1 0 ≤ w ≤ J − 1 . We call such a pair a state , and we call it successful if 2 J + 1 w ∈ E J 2^{J+1}w\in\mathcal{E}_J 2 J + 1 w ∈ E J .
Theorem 4.1. Let ( J , w ) (J,w) ( J , w ) be a state, that is J ≥ 1 J\ge1 J ≥ 1 and 0 ≤ w ≤ J − 1 0\le w\le J-1 0 ≤ w ≤ J − 1 .
If w = 0 w=0 w = 0 , the state is successful.
If w ≥ 1 w\ge1 w ≥ 1 , then J ≥ 2 J\ge2 J ≥ 2 ; let s s s be the least integer σ ≥ 1 \sigma\ge1 σ ≥ 1 with 2 σ w + σ ≥ J + 1 2^\sigma w+\sigma\ge J+1 2 σ w + σ ≥ J + 1 . Then 1 ≤ s ≤ J − 1 1\le s\le J-1 1 ≤ s ≤ J − 1 , and:
(a) if 2 s − 1 w + s = J + 1 2^{s-1}w+s=J+1 2 s − 1 w + s = J + 1 , the state is not successful;
(b) otherwise w ′ = 2 s w + s − J − 1 w' = 2^{s}w + s - J - 1 w ′ = 2 s w + s − J − 1 satisfies 0 ≤ w ′ ≤ J − s − 1 0 \le w' \le J - s - 1 0 ≤ w ′ ≤ J − s − 1 , the pair ( J − s , w ′ ) (J-s,w') ( J − s , w ′ ) is a state, and ( J , w ) (J,w) ( J , w ) is successful if and only if ( J − s , w ′ ) (J-s,w') ( J − s , w ′ ) is successful.
Proof. (1) $0 \in E_J$. (2) Since 1 ≤ w ≤ J − 1 1 \le w \le J - 1 1 ≤ w ≤ J − 1 , J ≥ 2 J \ge2 J ≥ 2 . For σ = J − 1 \sigma= J - 1 σ = J − 1 we have $2^{J-1}w + J - 1 \ge 2 + J - 1 = J + 1$, so s s s exists and s ≤ J − 1 s \le J - 1 s ≤ J − 1 . Put V = 2 J + 1 w > 0 V = 2^{J+1}w > 0 V = 2 J + 1 w > 0 and j = J + 1 − s j = J + 1 - s j = J + 1 − s , so 2 ≤ j ≤ J 2 \le j \le J 2 ≤ j ≤ J . For σ ∈ { 1 , … , J } \sigma\in\{1,\ldots,J\} σ ∈ { 1 , … , J } and i = J + 1 − σ i = J + 1 - \sigma i = J + 1 − σ , the inequality i 2 i ≤ V i2^i \le V i 2 i ≤ V is equivalent to J + 1 − σ ≤ 2 σ w J + 1 - \sigma\le2^\sigma w J + 1 − σ ≤ 2 σ w ; hence the largest i ≤ J i \le J i ≤ J with i 2 i ≤ V i2^i \le V i 2 i ≤ V corresponds to the least admissible σ \sigma σ , that is i = j i = j i = j . By Lemma 3.2, V ∈ E J V \in E_J V ∈ E J if and only if V − j 2 j = 2 j ( 2 s w − j ) = 2 j w ′ ∈ E j − 1 V - j2^j = 2^j(2^s w - j) = 2^j w' \in E_{j-1} V − j 2 j = 2 j ( 2 s w − j ) = 2 j w ′ ∈ E j − 1 , where w ′ = 2 s w − j = 2 s w + s − J − 1 ≥ 0 w' = 2^s w - j = 2^s w + s - J - 1 \ge0 w ′ = 2 s w − j = 2 s w + s − J − 1 ≥ 0 .
We bound w ′ w' w ′ from above. If s = 1 s = 1 s = 1 , then w ′ = 2 w − J ≤ J − 2 = j − 2 w' = 2w - J \le J - 2 = j - 2 w ′ = 2 w − J ≤ J − 2 = j − 2 . If s ≥ 2 s \ge2 s ≥ 2 , the minimality of s s s gives 2 s − 1 w + s − 1 ≤ J 2^{s-1}w + s - 1 \le J 2 s − 1 w + s − 1 ≤ J , hence 2 s w ≤ 2 J + 2 − 2 s 2^s w \le2J + 2 - 2s 2 s w ≤ 2 J + 2 − 2 s and w ′ ≤ J + 1 − s = j w' \le J + 1 - s = j w ′ ≤ J + 1 − s = j . Moreover w ′ = j − 1 w' = j - 1 w ′ = j − 1 would mean 2 s w = 2 j − 1 2^s w = 2j - 1 2 s w = 2 j − 1 , which is impossible because 2 s w 2^s w 2 s w is even. Therefore either w ′ ≤ j − 2 w' \le j - 2 w ′ ≤ j − 2 or w ′ = j w' = j w ′ = j , and w ′ = j w' = j w ′ = j is equivalent to 2 s w = 2 j 2^s w = 2j 2 s w = 2 j , that is 2 s − 1 w + s = J + 1 2^{s-1}w + s = J + 1 2 s − 1 w + s = J + 1 (which cannot occur for s = 1 s = 1 s = 1 since w ≤ J − 1 w \le J - 1 w ≤ J − 1 ). In case (a), w ′ = j w' = j w ′ = j and 2 j w ′ = j 2 j > ( j − 2 ) 2 j + 2 = max E j − 1 2^j w' = j2^j > (j - 2)2^j + 2 = \max E_{j-1} 2 j w ′ = j 2 j > ( j − 2 ) 2 j + 2 = max E j − 1 by Lemma 3.1, since 2 j + 1 > 2 2^{j+1} > 2 2 j + 1 > 2 ; hence V ∉ E J V \notin E_J V ∈ / E J . In case (b), w ′ ≤ j − 2 = ( J − s ) − 1 w' \le j - 2 = (J - s) - 1 w ′ ≤ j − 2 = ( J − s ) − 1 and J − s = j − 1 ≥ 1 J - s = j - 1 \ge1 J − s = j − 1 ≥ 1 , so ( J − s , w ′ ) (J-s,w') ( J − s , w ′ ) is a state, and 2 j w ′ = 2 ( J − s ) + 1 w ′ 2^j w' = 2^{(J-s)+1}w' 2 j w ′ = 2 ( J − s ) + 1 w ′ , so V ∈ E J V \in E_J V ∈ E J if and only if ( J − s , w ′ ) (J-s,w') ( J − s , w ′ ) is successful.
Algorithm 1 Membership of a a a in A \mathcal{A} A
Require: an integer a ≥ 0 a \ge0 a ≥ 0
b ← a + 3 b \leftarrow a + 3 b ← a + 3
if there is no K ≥ 2 K \ge2 K ≥ 2 with K + ⌈ log 2 K ⌉ = b K + \lceil\log_2 K\rceil= b K + ⌈ log 2 K ⌉ = b then
return a ∉ A a \notin\mathcal{A} a ∈ / A
end if
h ← ⌈ log 2 K ⌉ h \leftarrow\lceil\log_2 K\rceil h ← ⌈ log 2 K ⌉ ; J ← K − 1 J \leftarrow K - 1 J ← K − 1 ; w ← 2 h − K w \leftarrow2^h - K w ← 2 h − K
while w ≥ 1 w \ge1 w ≥ 1 do
s ← s \leftarrow s ← least σ ≥ 1 \sigma\ge1 σ ≥ 1 with 2 σ w + σ ≥ J + 1 2^\sigma w + \sigma\ge J + 1 2 σ w + σ ≥ J + 1
if 2 s − 1 w + s = J + 1 2^{s-1}w + s = J + 1 2 s − 1 w + s = J + 1 then
return a ∉ A a \notin\mathcal{A} a ∈ / A
end if
w ← 2 s w + s − J − 1 w \leftarrow2^s w + s - J - 1 w ← 2 s w + s − J − 1 ; J ← J − s J \leftarrow J - s J ← J − s
end while
return a ∈ A a \in\mathcal{A} a ∈ A
Corollary 4.2. Algorithm 1 decides whether a ∈ A a \in\mathcal{A} a ∈ A . It performs at most K − 2 ≤ a + 1 K - 2 \le a + 1 K − 2 ≤ a + 1 iterations of the loop, and every integer it handles, other than the bound 2 h ≤ 2 K − 2 2^h \le2K - 2 2 h ≤ 2 K − 2 of the initial step, is at most 2 K ≤ 2 a + 6 2K \le2a + 6 2 K ≤ 2 a + 6 . When it returns a ∈ A a \in\mathcal{A} a ∈ A , the indices j = J + 1 − s j = J + 1 - s j = J + 1 − s produced at the successive iterations, together with K K K , form the set T T T of Theorem 2.2, and n = ∑ j ∈ T 2 j − 2 n = \sum_{j \in T} 2^{j-2} n = ∑ j ∈ T 2 j − 2 satisfies c ( n ) = 2 a c(n) = 2^a c ( n ) = 2 a .
Proof. Correctness follows from Theorems 3.3 and 4.1. Each iteration decreases J J J by s ≥ 1 s \ge1 s ≥ 1 and keeps J ≥ 1 J \ge1 J ≥ 1 , starting from J = K − 1 J = K - 1 J = K − 1 , so there are at most K − 2 K - 2 K − 2 iterations; K ≤ β ( K ) − 1 = a + 2 K \le\beta(K) - 1 = a + 2 K ≤ β ( K ) − 1 = a + 2 . Throughout, $0 \le w \le J - 1 \le K - 2$, and in the computation of s s s only σ ≤ s \sigma\le s σ ≤ s are tested, with $2^\sigma w + \sigma \le 2^s w + s \le 2J + 2 - s \le 2K$ for s ≥ 2 s \ge2 s ≥ 2 by the proof of Theorem 4.1, and 2 w + 1 ≤ 2 K 2w + 1 \le2K 2 w + 1 ≤ 2 K for s = 1 s = 1 s = 1 . The last statement follows from the proof of Theorem 4.1 and Lemma 3.2.
Example 4.3. For a = 5 a = 5 a = 5 , b = 8 = β ( 5 ) b = 8 = \beta(5) b = 8 = β ( 5 ) , h = 3 h = 3 h = 3 and the initial state is ( 4 , 3 ) (4,3) ( 4 , 3 ) . The loop gives s = 1 s = 1 s = 1 and ( 3 , 2 ) (3,2) ( 3 , 2 ) , then s = 1 s = 1 s = 1 and ( 2 , 1 ) (2,1) ( 2 , 1 ) , then s = 1 s = 1 s = 1 and ( 1 , 0 ) (1,0) ( 1 , 0 ) , so 5 ∈ A 5 \in\mathcal{A} 5 ∈ A with T = { 5 , 4 , 3 , 2 } T = \{5,4,3,2\} T = { 5 , 4 , 3 , 2 } and n = 2 3 + 2 2 + 2 + 1 = 15 n = 2^3 + 2^2 + 2 + 1 = 15 n = 2 3 + 2 2 + 2 + 1 = 15 ; indeed c ( 15 ) = 32 c(15) = 32 c ( 15 ) = 32 [1 ] . For a = 6 a = 6 a = 6 , b = 9 = β ( 6 ) b = 9 = \beta(6) b = 9 = β ( 6 ) , h = 3 h = 3 h = 3 and the initial state is ( 5 , 2 ) (5,2) ( 5 , 2 ) ; here s = 2 s = 2 s = 2 and 2 1 ⋅ 2 + 2 = 6 = J + 1 2^1 \cdot2 + 2 = 6 = J + 1 2 1 ⋅ 2 + 2 = 6 = J + 1 , so 6 ∉ A 6 \notin\mathcal{A} 6 ∈ / A .
Explicit members of A \mathcal{A} A
Theorem 5.1. For every r ≥ 1 r \ge1 r ≥ 1 , c ( 2 2 r − 2 ) = 2 2 r + r − 3 c(2^{2^r-2}) = 2^{2^r+r-3} c ( 2 2 r − 2 ) = 2 2 r + r − 3 ; thus 2 r + r − 3 ∈ A 2^r + r - 3 \in\mathcal{A} 2 r + r − 3 ∈ A .
Let k ≥ 0 k \ge0 k ≥ 0 , s = 2 k s = 2^k s = 2 k , and let h ≥ k + 2 h \ge k + 2 h ≥ k + 2 with h ≡ k ( m o d 2 k + 1 ) h \equiv k \pmod{2^{k+1}} h ≡ k ( mod 2 k + 1 ) . Then
K = 2 h + s + s 2 s + 1 (6) K = \frac{2^{h+s} + s}{2^s + 1} \tag*{(6)} K = 2 s + 1 2 h + s + s (6)
is an integer with 2 h − 1 < K < 2 h 2^{h-1} < K < 2^h 2 h − 1 < K < 2 h and K − s ≥ 2 K - s \ge2 K − s ≥ 2 , and
c ( 2 K − 2 + 2 K − s − 2 ) = 2 K + h − 3 ; (7) c(2^{K-2} + 2^{K-s-2}) = 2^{K+h-3}; \tag*{(7)} c ( 2 K − 2 + 2 K − s − 2 ) = 2 K + h − 3 ; (7)
thus K + h − 3 = β ( K ) − 3 ∈ A K + h - 3 = \beta(K) - 3 \in\mathcal{A} K + h − 3 = β ( K ) − 3 ∈ A .
Proof. (1) By Lemma 2.1 with m = 2 r − 2 m = 2^r - 2 m = 2 r − 2 , c ( 2 m ) = 2 m − 1 ( m + 2 ) = 2 2 r − 3 2 r c(2^m) = 2^{m-1}(m + 2) = 2^{2^r-3}2^r c ( 2 m ) = 2 m − 1 ( m + 2 ) = 2 2 r − 3 2 r .
(2) Modulo 2 s + 1 2^s + 1 2 s + 1 we have 2 s ≡ − 1 2^s \equiv-1 2 s ≡ − 1 , hence 2 2 s ≡ 1 2^{2s} \equiv1 2 2 s ≡ 1 . Writing h = k + 2 s q h = k + 2sq h = k + 2 s q with q ≥ 0 q \ge0 q ≥ 0 we get 2 h ≡ 2 k = s 2^h \equiv2^k = s 2 h ≡ 2 k = s , and therefore 2 h + s + s ≡ − 2 h + s ≡ 0 ( m o d 2 s + 1 ) 2^{h+s} + s \equiv-2^h + s \equiv0 \pmod{2^s + 1} 2 h + s + s ≡ − 2 h + s ≡ 0 ( mod 2 s + 1 ) , so K K K is an integer. Next, K = 2 h − ( 2 h − s ) / ( 2 s + 1 ) K = 2^h - (2^h - s)/(2^s + 1) K = 2 h − ( 2 h − s ) / ( 2 s + 1 ) . Since s = 2 k < 2 h s = 2^k < 2^h s = 2 k < 2 h , K < 2 h K < 2^h K < 2 h ; since 2 s + 1 ≥ 3 2^s + 1 \ge3 2 s + 1 ≥ 3 , ( 2 h − s ) / ( 2 s + 1 ) < 2 h − 1 (2^h - s)/(2^s + 1) < 2^{h-1} ( 2 h − s ) / ( 2 s + 1 ) < 2 h − 1 , so K > 2 h − 1 K > 2^{h-1} K > 2 h − 1 . As h ≥ k + 2 h \ge k + 2 h ≥ k + 2 , s ≤ 2 h − 2 s \le2^{h-2} s ≤ 2 h − 2 and K − s ≥ 2 h − 1 + 1 − 2 h − 2 ≥ 2 K - s \ge2^{h-1} + 1 - 2^{h-2} \ge2 K − s ≥ 2 h − 1 + 1 − 2 h − 2 ≥ 2 . By Lemma 2.1, with K − 2 > K − s − 2 ≥ 0 K - 2 > K - s - 2 \ge0 K − 2 > K − s − 2 ≥ 0 ,
c ( 2 K − 2 + 2 K − s − 2 ) = 2 K − 3 K + 2 K − s − 3 ( K − s ) = 2 K − s − 3 ( K ( 2 s + 1 ) − s ) = 2 K − s − 3 2 h + s = 2 K + h − 3 . c(2^{K-2} + 2^{K-s-2}) = 2^{K-3}K + 2^{K-s-3}(K-s) = 2^{K-s-3}(K(2^s+1)-s) = 2^{K-s-3}2^{h+s} = 2^{K+h-3}. c ( 2 K − 2 + 2 K − s − 2 ) = 2 K − 3 K + 2 K − s − 3 ( K − s ) = 2 K − s − 3 ( K ( 2 s + 1 ) − s ) = 2 K − s − 3 2 h + s = 2 K + h − 3 .
Since 2 h − 1 < K < 2 h 2^{h-1} < K < 2^h 2 h − 1 < K < 2 h , h = h ( K ) h = h(K) h = h ( K ) and K + h = β ( K ) K + h = \beta(K) K + h = β ( K ) . □
For k = 0 k = 0 k = 0 (s = 1 s = 1 s = 1 ) the condition is that h ≥ 2 h \ge2 h ≥ 2 is even, K = ( 2 h + 1 + 1 ) / 3 K = (2^{h+1} + 1)/3 K = ( 2 h + 1 + 1 ) /3 , and the exponent is K + h − 3 = ( h + 1 ) + ( 2 h + 1 − 11 ) / 3 K + h - 3 = (h + 1) + (2^{h+1} - 11)/3 K + h − 3 = ( h + 1 ) + ( 2 h + 1 − 11 ) /3 ; with a = h + 1 a = h + 1 a = h + 1 this is the family a + ( 2 a − 11 ) / 3 a + (2^a - 11)/3 a + ( 2 a − 11 ) /3 , a a a odd, of Nicolas [1 ] . For k = 1 k = 1 k = 1 (s = 2 s = 2 s = 2 ), h ≡ 1 ( m o d 4 ) h \equiv1 \pmod4 h ≡ 1 ( mod 4 ) ; for instance h = 5 h = 5 h = 5 gives K = 26 K = 26 K = 26 and c ( 2 24 + 2 22 ) = 2 28 c(2^{24} + 2^{22}) = 2^{28} c ( 2 24 + 2 22 ) = 2 28 .
Explicit non-members of A
Theorem 6.1. Let s ≥ 2 s \ge2 s ≥ 2 and h ≥ 1 h \ge1 h ≥ 1 with s < 2 h s < 2^h s < 2 h and 2 h ≡ s ( m o d 2 s − 1 + 1 ) 2^h \equiv s \pmod{2^{s-1} + 1} 2 h ≡ s ( mod 2 s − 1 + 1 ) . Then
K = 2 h + s − 1 + s 2 s − 1 + 1 (8) K = \frac{2^{h+s-1} + s}{2^{s-1} + 1} \tag*{(8)} K = 2 s − 1 + 1 2 h + s − 1 + s (8) is an integer with 2 h − 1 < K < 2 h 2^{h-1} < K < 2^h 2 h − 1 < K < 2 h , and K + h − 3 = β ( K ) − 3 ∉ A K + h - 3 = \beta(K) - 3 \notin\mathcal{A} K + h − 3 = β ( K ) − 3 ∈ / A . The hypotheses hold in the following cases:
s = 2 i s = 2^i s = 2 i with i ≥ 1 i \ge1 i ≥ 1 , and h > i h > i h > i with h ≡ i ( m o d 2 ( 2 i − 1 ) ) h \equiv i \pmod{2(2^i - 1)} h ≡ i ( mod 2 ( 2 i − 1 )) ;
s = 3 s = 3 s = 3 , and h ≡ 3 ( m o d 4 ) h \equiv3 \pmod4 h ≡ 3 ( mod 4 ) .
Proof. Put M = 2 s − 1 + 1 M = 2^{s-1} + 1 M = 2 s − 1 + 1 . Since $2^{s-1} \equiv -1 \pmod M, $ 2 h + s − 1 + s ≡ − 2 h + s ≡ 0 ( m o d M ) , \$2^{h+s-1} + s \equiv-2^h + s \equiv0 \pmod M , $ 2 h + s − 1 + s ≡ − 2 h + s ≡ 0 ( mod M ) , so K K K is an integer. As K = 2 h − ( 2 h − s ) / M K = 2^h - (2^h - s)/M K = 2 h − ( 2 h − s ) / M with 0 < 2 h − s 0 < 2^h - s 0 < 2 h − s and M ≥ 3 M \ge3 M ≥ 3 , we get 2 h − 1 < K < 2 h 2^{h-1} < K < 2^h 2 h − 1 < K < 2 h , hence h = h ( K ) h = h(K) h = h ( K ) and K + h = β ( K ) K + h = \beta(K) K + h = β ( K ) . By Theorem 2.2 and Theorem 3.3 , K + h − 3 ∈ A K + h - 3 \in\mathcal{A} K + h − 3 ∈ A if and only if the state ( J , w ) = ( K − 1 , 2 h − K ) (J,w) = (K - 1, 2^h - K) ( J , w ) = ( K − 1 , 2 h − K ) is successful. Here w ≥ 1 w \ge1 w ≥ 1 , and K ≥ 3 K \ge3 K ≥ 3 because s ≥ 2 s \ge2 s ≥ 2 and s < 2 h s < 2^h s < 2 h force h ≥ 2 h \ge2 h ≥ 2 ; so J ≥ 2 J \ge2 J ≥ 2 . The definition of K K K is equivalent to K ( 2 s − 1 + 1 ) = 2 h + s − 1 + s K(2^{s-1} + 1) = 2^{h+s-1} + s K ( 2 s − 1 + 1 ) = 2 h + s − 1 + s , that is
2 s − 1 w + s = K = J + 1. 2^{s-1}w + s = K = J + 1. 2 s − 1 w + s = K = J + 1. We check that s s s is the least σ ≥ 1 \sigma\ge1 σ ≥ 1 with 2 σ w + σ ≥ J + 1 2^\sigma w + \sigma\ge J + 1 2 σ w + σ ≥ J + 1 . The function σ ↦ 2 σ w + σ \sigma\mapsto2^\sigma w + \sigma σ ↦ 2 σ w + σ is increasing; at σ = s − 1 ≥ 1 \sigma= s - 1 \ge1 σ = s − 1 ≥ 1 its value is J J J , and at σ = s \sigma= s σ = s it is 2 ( K − s ) + s = 2 K − s 2(K-s) + s = 2K - s 2 ( K − s ) + s = 2 K − s , which is at least K K K because K − s = ( 2 h − s ) ( 1 − 1 / M ) > 0 K - s = (2^h - s)(1 - 1/M) > 0 K − s = ( 2 h − s ) ( 1 − 1/ M ) > 0 . Hence Theorem 4.1 (2a) applies, and the state is not successful.
Case (1): M = 2 s − 1 + 1 M = 2^{s-1} + 1 M = 2 s − 1 + 1 with s = 2 i s = 2^i s = 2 i , so 2 2 ( s − 1 ) ≡ 1 ( m o d M ) 2^{2(s-1)} \equiv1 \pmod M 2 2 ( s − 1 ) ≡ 1 ( mod M ) and h = i + 2 ( s − 1 ) q h = i + 2(s - 1)q h = i + 2 ( s − 1 ) q gives 2 h ≡ 2 i = s 2^h \equiv2^i = s 2 h ≡ 2 i = s ; and s = 2 i < 2 h s = 2^i < 2^h s = 2 i < 2 h because h > i h > i h > i . Case (2): M = 5 M = 5 M = 5 , 2 4 ≡ 1 2^4 \equiv1 2 4 ≡ 1 and 2 3 ≡ 3 ( m o d 5 ) 2^3 \equiv3 \pmod5 2 3 ≡ 3 ( mod 5 ) , so h ≡ 3 ( m o d 4 ) h \equiv3 \pmod4 h ≡ 3 ( mod 4 ) gives 2 h ≡ 3 = s 2^h \equiv3 = s 2 h ≡ 3 = s ; and 3 < 2 h 3 < 2^h 3 < 2 h because h ≥ 3 h \ge3 h ≥ 3 . □
For s = 2 s = 2 s = 2 the condition is that h ≥ 3 h \ge3 h ≥ 3 is odd, K = ( 2 h + 1 + 2 ) / 3 K = (2^{h+1} + 2)/3 K = ( 2 h + 1 + 2 ) /3 , and the exponent is K + h − 3 = ( h + 1 ) + ( 2 h + 1 − 10 ) / 3 K + h - 3 = (h + 1) + (2^{h+1} - 10)/3 K + h − 3 = ( h + 1 ) + ( 2 h + 1 − 10 ) /3 ; with a = h + 1 a = h + 1 a = h + 1 this is the family a + ( 2 a − 10 ) / 3 a + (2^a - 10)/3 a + ( 2 a − 10 ) /3 , a a a even, of Nicolas [1 ] . For s = 3 s = 3 s = 3 and h = 3 h = 3 h = 3 , K = 7 K = 7 K = 7 and 7 ∉ A 7 \notin\mathcal{A} 7 ∈ / A ; for s = 4 s = 4 s = 4 and h = 8 h = 8 h = 8 , K = 228 K = 228 K = 228 and 233 ∉ A 233 \notin\mathcal{A} 233 ∈ / A .
The families of Theorems 5.1 and 6.1 are exactly the exponents decided by at most one iteration of Algorithm 1.
Theorem 6.2. Let a ≥ 0 a \ge0 a ≥ 0 have a candidate K K K (Theorem 3.3 ), let h = h ( K ) h=h(K) h = h ( K ) , and let ( J , w ) = ( K − 1 , 2 h − K ) (J,w)=(K-1,2^h-K) ( J , w ) = ( K − 1 , 2 h − K ) be the initial state.
Algorithm 1 returns a ∈ A a \in\mathcal{A} a ∈ A without any iteration if and only if K = 2 h K=2^h K = 2 h , that is, a a a is an exponent of Theorem 5.1 (1).
Algorithm 1 returns a ∈ A a \in\mathcal{A} a ∈ A after exactly one iteration if and only if a a a is an exponent of Theorem 5.1 (2), that is, K = ( 2 h + s + s ) / ( 2 s + 1 ) K=(2^{h+s}+s)/(2^s+1) K = ( 2 h + s + s ) / ( 2 s + 1 ) with s = 2 k s=2^k s = 2 k , k ≥ 0 k \ge0 k ≥ 0 , h ≥ k + 2 h \ge k+2 h ≥ k + 2 and h ≡ k ( m o d 2 k + 1 ) h \equiv k \pmod{2^{k+1}} h ≡ k ( mod 2 k + 1 ) .
Algorithm 1 returns a ∉ A a \notin\mathcal{A} a ∈ / A at its first iteration if and only if a a a is an exponent of Theorem 6.1 (1) or (2), that is, K = ( 2 h + s − 1 + s ) / ( 2 s − 1 + 1 ) K=(2^{h+s-1}+s)/(2^{s-1}+1) K = ( 2 h + s − 1 + s ) / ( 2 s − 1 + 1 ) with either s = 2 i s=2^i s = 2 i , i ≥ 1 i \ge1 i ≥ 1 , h > i h>i h > i and h ≡ i ( m o d 2 ( 2 i − 1 ) ) h \equiv i \pmod{2(2^i-1)} h ≡ i ( mod 2 ( 2 i − 1 )) , or s = 3 s=3 s = 3 and h ≡ 3 ( m o d 4 ) h \equiv3 \pmod4 h ≡ 3 ( mod 4 ) .
Proof. (1) The loop is not entered if and only if w = 0 w=0 w = 0 , that is K = 2 h K=2^h K = 2 h .
We use the following fact on residues. Let m ≥ 1 m \ge1 m ≥ 1 and N = 2 m + 1 N=2^m+1 N = 2 m + 1 . Since 2 m ≡ − 1 ( m o d N ) 2^m \equiv-1 \pmod N 2 m ≡ − 1 ( mod N ) , the residues of the powers 2 e 2^e 2 e , e ≥ 0 e \ge0 e ≥ 0 , are 2 l 2^l 2 l and N − 2 l N-2^l N − 2 l for 0 ≤ l ≤ m − 1 0 \le l \le m-1 0 ≤ l ≤ m − 1 ; these 2 m 2m 2 m residues are distinct, because N − 2 l ≥ 2 m − 1 + 1 > 2 m − 1 ≥ 2 l N-2^l \ge2^{m-1}+1>2^{m-1}\ge2^l N − 2 l ≥ 2 m − 1 + 1 > 2 m − 1 ≥ 2 l , so 2 2 2 has order 2 m 2m 2 m modulo N N N and 2 e ≡ 2 l ( m o d N ) 2^e \equiv2^l \pmod N 2 e ≡ 2 l ( mod N ) with 0 ≤ l ≤ m − 1 0 \le l \le m-1 0 ≤ l ≤ m − 1 holds if and only if e ≡ l ( m o d 2 m ) e \equiv l \pmod{2m} e ≡ l ( mod 2 m ) .
(2) Suppose w ≥ 1 w \ge1 w ≥ 1 . The first iteration ends with w ′ = 0 w'=0 w ′ = 0 , without failure, if and only if 2 s w + s = J + 1 = K 2^s w+s=J+1=K 2 s w + s = J + 1 = K for the least admissible s s s . Conversely, if 2 σ w + σ = K 2^\sigma w+\sigma=K 2 σ w + σ = K for some σ ≥ 1 \sigma\ge1 σ ≥ 1 , then σ \sigma σ is the least admissible value, because 2 σ − 1 w + σ − 1 = ( K + σ − 2 ) / 2 < K 2^{\sigma-1}w+\sigma-1=(K+\sigma-2)/2<K 2 σ − 1 w + σ − 1 = ( K + σ − 2 ) /2 < K (as σ < K \sigma<K σ < K ), and the failure condition 2 σ − 1 w + σ = ( K + σ ) / 2 = K 2^{\sigma-1}w+\sigma=(K+\sigma)/2=K 2 σ − 1 w + σ = ( K + σ ) /2 = K would give K = σ K=\sigma K = σ , which is impossible since K = 2 σ w + σ > σ K=2^\sigma w+\sigma>\sigma K = 2 σ w + σ > σ . Hence one-iteration success is equivalent to the existence of s ≥ 1 s \ge1 s ≥ 1 with 2 s ( 2 h − K ) + s = K 2^s(2^h-K)+s=K 2 s ( 2 h − K ) + s = K , that is K ( 2 s + 1 ) = 2 h + s + s K(2^s+1)=2^{h+s}+s K ( 2 s + 1 ) = 2 h + s + s , which requires 2 h + s + s ≡ 0 2^{h+s}+s\equiv0 2 h + s + s ≡ 0 , that is 2 h ≡ s ( m o d 2 s + 1 ) 2^h\equiv s\pmod{2^s+1} 2 h ≡ s ( mod 2 s + 1 ) .
Apply the fact with m = s m=s m = s : s < 2 s + 1 s<2^s+1 s < 2 s + 1 , and s = 2 s + 1 − 2 l s=2^s+1-2^l s = 2 s + 1 − 2 l with l ≤ s − 1 l\le s-1 l ≤ s − 1 would give s ≥ 2 s − 1 + 1 > s s\ge2^{s-1}+1>s s ≥ 2 s − 1 + 1 > s ; hence s = 2 l s=2^l s = 2 l for some l l l , which we call k k k , with k ≤ s − 1 k\le s-1 k ≤ s − 1 , and 2 h ≡ 2 k 2^h\equiv2^k 2 h ≡ 2 k gives h ≡ k ( m o d 2 k + 1 ) h\equiv k\pmod{2^{k+1}} h ≡ k ( mod 2 k + 1 ) . Moreover w ≥ 1 w\ge1 w ≥ 1 means K < 2 h K<2^h K < 2 h , which is s < 2 k s<2^k s < 2 k , that is h > k h>k h > k ; with h ≡ k ( m o d 2 k + 1 ) h\equiv k\pmod{2^{k+1}} h ≡ k ( mod 2 k + 1 ) this gives h ≥ k + 2 h\ge k+2 h ≥ k + 2 . Conversely, under these conditions Theorem 5.1 (2) gives K ( 2 s + 1 ) = 2 h + s + s K(2^s+1)=2^{h+s}+s K ( 2 s + 1 ) = 2 h + s + s with 1 ≤ w 1\le w 1 ≤ w .
(3) Suppose w ≥ 1 w\ge1 w ≥ 1 . By Theorem 4.1 , the first iteration fails if and only if 2 s − 1 w + s = J + 1 = K 2^{s-1}w+s=J+1=K 2 s − 1 w + s = J + 1 = K for the least admissible s s s , and then s ≥ 2 s\ge2 s ≥ 2 . Conversely, if 2 σ − 1 w + σ = K 2^{\sigma-1}w+\sigma=K 2 σ − 1 w + σ = K for some σ ≥ 2 \sigma\ge2 σ ≥ 2 , the proof of Theorem 6.1 shows that σ \sigma σ is the least admissible value. Hence first-iteration failure is equivalent to the existence of s ≥ 2 s\ge2 s ≥ 2 with K ( 2 s − 1 + 1 ) = 2 h + s − 1 + s K(2^{s-1}+1)=2^{h+s-1}+s K ( 2 s − 1 + 1 ) = 2 h + s − 1 + s , which requires 2 h ≡ s ( m o d M ) 2^h\equiv s\pmod M 2 h ≡ s ( mod M ) , M = 2 s − 1 + 1 M=2^{s-1}+1 M = 2 s − 1 + 1 , and w ≥ 1 w\ge1 w ≥ 1 is s < 2 h s<2^h s < 2 h . Apply the fact with m = s − 1 m=s-1 m = s − 1 ; note 2 ≤ s < M 2\le s<M 2 ≤ s < M . If s = 2 l s=2^l s = 2 l with l ≤ s − 2 l\le s-2 l ≤ s − 2 , then l ≥ 2 l\ge2 l ≥ 2 , and h ≡ l ( m o d 2 ( s − 1 ) ) h\equiv l\pmod{2(s-1)} h ≡ l ( mod 2 ( s − 1 )) , which with s < 2 h s<2^h s < 2 h is case (1) of Theorem 6.1 with i = l ≥ 2 i=l\ge2 i = l ≥ 2 . Otherwise s = M − 2 l s=M-2^l s = M − 2 l with 0 ≤ l ≤ s − 2 0\le l\le s-2 0 ≤ l ≤ s − 2 , that is 2 s − 1 + 1 − s = 2 l 2^{s-1}+1-s=2^l 2 s − 1 + 1 − s = 2 l . For s ≥ 4 s\ge4 s ≥ 4 this is impossible, since 2 s − 2 < 2 s − 1 + 1 − s < 2 s − 1 2^{s-2}<2^{s-1}+1-s<2^{s-1} 2 s − 2 < 2 s − 1 + 1 − s < 2 s − 1 . For s = 2 s=2 s = 2 , l = 0 l=0 l = 0 and 2 h ≡ M − 1 = 2 ( m o d 3 ) 2^h\equiv M-1=2\pmod3 2 h ≡ M − 1 = 2 ( mod 3 ) , that is h h h odd, and s < 2 h s<2^h s < 2 h gives h ≥ 3 h\ge3 h ≥ 3 : case (1) with i = 1 i=1 i = 1 . For s = 3 s=3 s = 3 , l = 1 l=1 l = 1 and 2 h ≡ 3 ( m o d 5 ) 2^h\equiv3\pmod5 2 h ≡ 3 ( mod 5 ) , that is h ≡ 3 ( m o d 4 ) h\equiv3\pmod4 h ≡ 3 ( mod 4 ) : case (2). Conversely, Theorem 6.1 shows that its exponents fail at the first iteration. □ \square □
Consequently, every exponent a a a that is not of the form 2 r + r − 2 2^r+r-2 2 r + r − 2 and is not covered by Theorems 5.1 and 6.1 requires at least two iterations of Algorithm 1 .
Counting functions
Theorem 7.1. As x → ∞ x\to\infty x → ∞ ,
A ( x ) ≥ 2 log 2 x − O ( log log x ) , B ( x ) ≥ ( 5 4 + E 2 ) log 2 x − O ( log log x ) . A(x)\ge2\log_2 x-O(\log\log x), \qquad B(x)\ge\left(\frac{5}{4}+\frac{E}{2}\right)\log_2 x-O(\log\log x). A ( x ) ≥ 2 log 2 x − O ( log log x ) , B ( x ) ≥ ( 4 5 + 2 E ) log 2 x − O ( log log x ) . where E = ∑ i ≥ 1 1 / ( 2 i − 1 ) = 1.6066951 … E=\sum_{i\ge1}1/(2^i-1)=1.6066951\ldots E = ∑ i ≥ 1 1/ ( 2 i − 1 ) = 1.6066951 … , so that 5 4 + E 2 = 2.0533475 … \frac{5}{4}+\frac{E}{2}=2.0533475\ldots 4 5 + 2 E = 2.0533475 …
Proof. Let x ≥ 16 x\ge16 x ≥ 16 and H = ⌊ log 2 x ⌋ − 1 ≥ 3 H=\lfloor\log_2x\rfloor-1\ge3 H = ⌊ log 2 x ⌋ − 1 ≥ 3 . If 1 ≤ h ≤ H 1\le h\le H 1 ≤ h ≤ H and 2 ≤ K ≤ 2 h 2\le K\le2^h 2 ≤ K ≤ 2 h , then β ( K ) − 3 ≤ 2 h + h − 3 ≤ x / 2 + log 2 x ≤ x \beta(K)-3\le2^h+h-3\le x/2+\log_2x\le x β ( K ) − 3 ≤ 2 h + h − 3 ≤ x /2 + log 2 x ≤ x . All exponents produced by Theorems 5.1 (2) and 6.1 are of the form β ( K ) − 3 \beta(K)-3 β ( K ) − 3 with 2 h − 1 < K < 2 h 2^{h-1}<K<2^h 2 h − 1 < K < 2 h , and β \beta β is injective (Theorem 3.3 (2)), so distinct values of K K K give distinct exponents. For fixed h h h , the integer K K K in (6) and in (8) equals 2 h − ( 2 h − s ) / ( 2 s + 1 ) 2^h-(2^h-s)/(2^s+1) 2 h − ( 2 h − s ) / ( 2 s + 1 ) and 2 h − ( 2 h − s ) / ( 2 s − 1 + 1 ) 2^h-(2^h-s)/(2^{s-1}+1) 2 h − ( 2 h − s ) / ( 2 s − 1 + 1 ) respectively, both strictly increasing in s s s , so distinct values of s s s in the same theorem give distinct values of K K K ; a member and a non-member are distinct.
Members. Theorem 5.1 (1) gives the H H H exponents β ( 2 h ) − 3 \beta(2^h)-3 β ( 2 h ) − 3 , 1 ≤ h ≤ H 1\le h\le H 1 ≤ h ≤ H , which are distinct from those of part (2) since there K < 2 h K<2^h K < 2 h . For 0 ≤ k ≤ κ = ⌊ log 2 H ⌋ 0\le k\le\kappa=\lfloor\log_2H\rfloor 0 ≤ k ≤ κ = ⌊ log 2 H ⌋ , the integers h = k + 2 k + 1 t h=k+2^{k+1}t h = k + 2 k + 1 t with 1 ≤ t ≤ ⌊ ( H − k ) / 2 k + 1 ⌋ 1\le t\le\lfloor(H-k)/2^{k+1}\rfloor 1 ≤ t ≤ ⌊( H − k ) / 2 k + 1 ⌋ satisfy
{#eq:7}
the hypotheses of Theorem 5.1 (2) and h ≤ H h \le H h ≤ H ; their number is at least ( H − k ) / 2 k + 1 − 1 (H-k)/2^{k+1}-1 ( H − k ) / 2 k + 1 − 1 . Summing over k k k and using ∑ k ≥ 0 k / 2 k + 1 = 1 \sum_{k\ge0} k/2^{k+1}=1 ∑ k ≥ 0 k / 2 k + 1 = 1 and 2 − κ − 1 H < 1 2^{-\kappa-1}H<1 2 − κ − 1 H < 1 ,
∑ k = 0 κ ( H − k 2 k + 1 − 1 ) ≥ H ( 1 − 2 − κ − 1 ) − 1 − ( κ + 1 ) ≥ H − log 2 H − 3. \sum_{k=0}^{\kappa}\left(\frac{H-k}{2^{k+1}}-1\right)\ge H(1-2^{-\kappa-1})-1-(\kappa+1)\ge H-\log_2 H-3. k = 0 ∑ κ ( 2 k + 1 H − k − 1 ) ≥ H ( 1 − 2 − κ − 1 ) − 1 − ( κ + 1 ) ≥ H − log 2 H − 3.
Hence A ( x ) ≥ 2 H − log 2 H − 3 = 2 log 2 x − O ( log log x ) A(x)\ge2H-\log_2 H-3=2\log_2 x-O(\log\log x) A ( x ) ≥ 2 H − log 2 H − 3 = 2 log 2 x − O ( log log x ) .
Non-members. Theorem 3.3 gives the H H H exponents 2 r + r − 2 ≤ x 2^r+r-2\le x 2 r + r − 2 ≤ x , 1 ≤ r ≤ H 1\le r\le H 1 ≤ r ≤ H , which are not of the form β ( K ) − 3 \beta(K)-3 β ( K ) − 3 . For 1 ≤ i ≤ κ 1\le i\le\kappa 1 ≤ i ≤ κ , the integers h = i + 2 ( 2 i − 1 ) t h=i+2(2^i-1)t h = i + 2 ( 2 i − 1 ) t with 1 ≤ t ≤ ⌊ ( H − i ) / ( 2 ( 2 i − 1 ) ) ⌋ 1\le t\le\lfloor(H-i)/(2(2^i-1))\rfloor 1 ≤ t ≤ ⌊( H − i ) / ( 2 ( 2 i − 1 ))⌋ satisfy Theorem 6.1 (1) and h ≤ H h\le H h ≤ H ; their number is at least ( H − i ) / ( 2 ( 2 i − 1 ) ) − 1 (H-i)/(2(2^i-1))-1 ( H − i ) / ( 2 ( 2 i − 1 )) − 1 . Since ∑ i > κ 1 / ( 2 ( 2 i − 1 ) ) ≤ ∑ i > κ 2 − i = 2 − κ < 2 / H \sum_{i>\kappa}1/(2(2^i-1))\le\sum_{i>\kappa}2^{-i}=2^{-\kappa}<2/H ∑ i > κ 1/ ( 2 ( 2 i − 1 )) ≤ ∑ i > κ 2 − i = 2 − κ < 2/ H and ∑ i ≥ 1 i / ( 2 ( 2 i − 1 ) ) < ∞ \sum_{i\ge1}i/(2(2^i-1))<\infty ∑ i ≥ 1 i / ( 2 ( 2 i − 1 )) < ∞ , the sum over i i i is at least 5 2 H − O ( log H ) \frac{5}{2}H-O(\log H) 2 5 H − O ( log H ) . Theorem 6.1 (2) gives the integers 3 ≤ h ≤ H 3\le h\le H 3 ≤ h ≤ H with h ≡ 3 ( m o d 4 ) h\equiv3\pmod4 h ≡ 3 ( mod 4 ) , at least H / 4 − 1 H/4-1 H /4 − 1 of them. Hence B ( x ) ≥ ( 1 + 1 4 + 5 2 ) H − O ( log H ) B(x)\ge(1+\frac14+\frac52)H-O(\log H) B ( x ) ≥ ( 1 + 4 1 + 2 5 ) H − O ( log H ) , and H = log 2 x + O ( 1 ) H=\log_2x+O(1) H = log 2 x + O ( 1 ) .
Successful states
For J ≥ 1 J\ge1 J ≥ 1 let
S J = { w : 0 ≤ w ≤ J − 1 , 2 J + 1 w ∈ E J } , N ( J ) = ∣ S J ∣ , S_J=\{w:0\le w\le J-1,\ 2^{J+1}w\in E_J\},\qquad N(J)=|S_J|, S J = { w : 0 ≤ w ≤ J − 1 , 2 J + 1 w ∈ E J } , N ( J ) = ∣ S J ∣ ,
so that S J S_J S J is the set of w w w for which the state ( J , w ) (J,w) ( J , w ) of § 4 is successful. By Theorems 2.2 and 3.3 , an exponent a a a with candidate K K K and h = h ( K ) h=h(K) h = h ( K ) belongs to A \mathcal A A if and only if 2 h − K ∈ S K − 1 2^h-K\in S_{K-1} 2 h − K ∈ S K − 1 .
Proposition 8.1. 1. For J ≥ 1 J\ge1 J ≥ 1 , N ( J ) = # { T ⊂ { 1 , … , J } : ∑ j ∈ T j 2 j ≡ 0 ( m o d 2 J + 1 ) } N(J)=\#\{T\subset\{1,\ldots,J\}:\sum_{j\in T}j2^j\equiv0\pmod{2^{J+1}}\} N ( J ) = # { T ⊂ { 1 , … , J } : ∑ j ∈ T j 2 j ≡ 0 ( mod 2 J + 1 )} .
For h ≥ 1 h\ge1 h ≥ 1 , the number of a ∈ A a\in\mathcal A a ∈ A whose candidate K K K lies in ( 2 h − 1 , 2 h ] (2^{h-1},2^h] ( 2 h − 1 , 2 h ] equals # { K ∈ ( 2 h − 1 , 2 h ] : 2 h − K ∈ S K − 1 } \#\{K\in(2^{h-1},2^h]:2^h-K\in S_{K-1}\} # { K ∈ ( 2 h − 1 , 2 h ] : 2 h − K ∈ S K − 1 } .
Proof. (1) By Lemma 3.2 , the map T ↦ ∑ j ∈ T j 2 j T\mapsto\sum_{j\in T}j2^j T ↦ ∑ j ∈ T j 2 j is injective on the subsets of { 1 , … , J } \{1,\ldots,J\} { 1 , … , J } . If ∑ j ∈ T j 2 j ≡ 0 ( m o d 2 J + 1 ) \sum_{j\in T}j2^j\equiv0\pmod{2^{J+1}} ∑ j ∈ T j 2 j ≡ 0 ( mod 2 J + 1 ) , the sum equals 2 J + 1 w 2^{J+1}w 2 J + 1 w with w ≥ 0 w\ge0 w ≥ 0 , and 2 J + 1 w ≤ ( J − 1 ) 2 J + 1 + 2 2^{J+1}w\le(J-1)2^{J+1}+2 2 J + 1 w ≤ ( J − 1 ) 2 J + 1 + 2 by Lemma 3.1 , so w ≤ J − 1 w\le J-1 w ≤ J − 1 and w ∈ S J w\in S_J w ∈ S J ; conversely every w ∈ S J w\in S_J w ∈ S J is obtained from exactly one T T T . (2) The map K ↦ β ( K ) − 3 K\mapsto\beta(K)-3 K ↦ β ( K ) − 3 is injective (Theorem 3.3 ), and β ( K ) − 3 ∈ A \beta(K)-3\in\mathcal A β ( K ) − 3 ∈ A if and only if 2 h − K ∈ S K − 1 2^h-K\in S_{K-1} 2 h − K ∈ S K − 1 .
Proposition 8.2. For every J ≥ 1 J\ge1 J ≥ 1 , w ∈ S J w\in S_J w ∈ S J if and only if J − 1 − w ∈ S J J-1-w\in S_J J − 1 − w ∈ S J .
Proof. For J = 1 J=1 J = 1 , S 1 = { 0 } S_1=\{0\} S 1 = { 0 } . Let J ≥ 2 J\ge2 J ≥ 2 , w ∈ S J w\in S_J w ∈ S J , and let T ⊂ { 1 , … , J } T\subset\{1,\ldots,J\} T ⊂ { 1 , … , J } represent V = 2 J + 1 w V=2^{J+1}w V = 2 J + 1 w . Since J + 1 ≥ 3 J+1\ge3 J + 1 ≥ 3 , V ≡ 0 ( m o d 8 ) V\equiv0\pmod8 V ≡ 0 ( mod 8 ) , and as in the proof of Theorem 2.2 , 1 ∉ T 1\notin T 1 ∈ / T . By Lemma 3.1 , ∑ j = 2 J j 2 j = ( J − 1 ) 2 J + 1 \sum_{j=2}^{J}j2^j=(J-1)2^{J+1} ∑ j = 2 J j 2 j = ( J − 1 ) 2 J + 1 , so the set { 2 , … , J } ∖ T \{2,\ldots,J\}\setminus T { 2 , … , J } ∖ T represents ( J − 1 ) 2 J + 1 − 2 J + 1 w = 2 J + 1 ( J − 1 − w ) (J-1)2^{J+1}-2^{J+1}w=2^{J+1}(J-1-w) ( J − 1 ) 2 J + 1 − 2 J + 1 w = 2 J + 1 ( J − 1 − w ) , and J − 1 − w ∈ S J J-1-w\in S_J J − 1 − w ∈ S J . Applying this to J − 1 − w J-1-w J − 1 − w gives the converse.
Proposition 8.3. For every k ≥ 1 k\ge1 k ≥ 1 , N ( 2 k + 1 ) = N ( 2 k ) N(2k+1)=N(2k) N ( 2 k + 1 ) = N ( 2 k ) , and 4 ∣ N ( J ) 4\mid N(J) 4 ∣ N ( J ) for every J ≥ 4 J\ge4 J ≥ 4 .
Proof. Let k ≥ 1 k\ge1 k ≥ 1 . For T ⊂ { 1 , … , 2 k + 1 } T\subset\{1,\ldots,2k+1\} T ⊂ { 1 , … , 2 k + 1 } put U = T ∖ { 2 k + 1 } U=T\setminus\{2k+1\} U = T ∖ { 2 k + 1 } and σ U = ∑ j ∈ U j 2 j \sigma_U=\sum_{j\in U}j2^j σ U = ∑ j ∈ U j 2 j . Since ( 2 k + 1 ) 2 2 k + 1 ≡ 2 2 k + 1 ( m o d 2 2 k + 2 ) (2k+1)2^{2k+1}\equiv2^{2k+1}\pmod{2^{2k+2}} ( 2 k + 1 ) 2 2 k + 1 ≡ 2 2 k + 1 ( mod 2 2 k + 2 ) , the condition ∑ j ∈ T j 2 j ≡ 0 ( m o d 2 2 k + 2 ) \sum_{j\in T}j2^j\equiv0\pmod{2^{2k+2}} ∑ j ∈ T j 2 j ≡ 0 ( mod 2 2 k + 2 ) is σ U ≡ − [ 2 k + 1 ∈ T ] 2 2 k + 1 ( m o d 2 2 k + 2 ) \sigma_U\equiv-[2k+1\in T]2^{2k+1}\pmod{2^{2k+2}} σ U ≡ − [ 2 k + 1 ∈ T ] 2 2 k + 1 ( mod 2 2 k + 2 ) . If σ U ≡ 0 ( m o d 2 2 k + 1 ) \sigma_U\equiv0\pmod{2^{2k+1}} σ U ≡ 0 ( mod 2 2 k + 1 ) , then σ U \sigma_U σ U is congruent to 0 0 0 or to 2 2 k + 1 2^{2k+1} 2 2 k + 1 modulo 2 2 k + 2 2^{2k+2} 2 2 k + 2 , and exactly one of the two choices for 2 k + 1 ∈ T 2k+1\in T 2 k + 1 ∈ T satisfies the condition; otherwise none does. By Proposition 8.1 (1), N ( 2 k + 1 ) = # { U ⊂ { 1 , … , 2 k } : σ U ≡ 0 ( m o d 2 2 k + 1 ) } = N ( 2 k ) N(2k+1)=\#\{U\subset\{1,\ldots,2k\}:\sigma_U\equiv0\pmod{2^{2k+1}}\}=N(2k) N ( 2 k + 1 ) = # { U ⊂ { 1 , … , 2 k } : σ U ≡ 0 ( mod 2 2 k + 1 )} = N ( 2 k ) .
Let k ≥ 2 k\ge2 k ≥ 2 . Since 2 k ⋅ 2 2 k = k 2 2 k + 1 ≡ 0 ( m o d 2 2 k + 1 ) 2k\cdot2^{2k}=k2^{2k+1}\equiv0\pmod{2^{2k+1}} 2 k ⋅ 2 2 k = k 2 2 k + 1 ≡ 0 ( mod 2 2 k + 1 ) , the element 2 k 2k 2 k does not affect the condition of Proposition 8.1 (1) for J = 2 k J=2k J = 2 k , so N ( 2 k ) = 2 Z N(2k)=2Z N ( 2 k ) = 2 Z with Z = # { U ⊂ { 1 , … , 2 k − 1 } : σ U ≡ 0 ( m o d 2 2 k + 1 ) } Z=\#\{U\subset\{1,\ldots,2k-1\}:\sigma_U\equiv0\pmod{2^{2k+1}}\} Z = # { U ⊂ { 1 , … , 2 k − 1 } : σ U ≡ 0 ( mod 2 2 k + 1 )} . For such U U U , 1 ∉ U 1\notin U 1 ∈ / U , because 2 k + 1 ≥ 5 2k+1\ge5 2 k + 1 ≥ 5 implies σ U ≡ 2 ( m o d 8 ) \sigma_U\equiv2\pmod8 σ U ≡ 2 ( mod 8 ) when 1 ∈ U 1\in U 1 ∈ U . By Lemma 3.1 , ∑ j = 2 2 k − 1 j 2 j = ( k − 1 ) 2 2 k + 1 = ( k − 2 ) 2 2 k + 2 2 k + 1 \sum_{j=2}^{2k-1}j2^j=(k-1)2^{2k+1}= (k-2)2^{2k}+2^{2k+1} ∑ j = 2 2 k − 1 j 2 j = ( k − 1 ) 2 2 k + 1 = ( k − 2 ) 2 2 k + 2 2 k + 1 , so U ↦ { 2 , … , 2 k − 1 } ∖ U U\mapsto\{2,\ldots,2k-1\}\setminus U U ↦ { 2 , … , 2 k − 1 } ∖ U maps the sets counted by Z Z Z to themselves; it is an involution without fixed points because { 2 , … , 2 k − 1 } ≠ ∅ \{2,\ldots,2k-1\}\ne\varnothing { 2 , … , 2 k − 1 } = ∅ . Hence Z Z Z is even and 4 ∣ N ( 2 k ) 4\mid N(2k) 4 ∣ N ( 2 k ) ; with N ( 2 k + 1 ) = N ( 2 k ) N(2k+1)=N(2k) N ( 2 k + 1 ) = N ( 2 k ) this gives 4 ∣ N ( J ) 4\mid N(J) 4 ∣ N ( J ) for all J ≥ 4 J\ge4 J ≥ 4 .
The recursion of Theorem 4.1 organizes all states into a forest. For a state ( J , w ) (J,w) ( J , w ) with w ≥ 1 w\ge1 w ≥ 1 that does not fail, let Φ ( J , w ) = ( J − s , 2 s w + s − J − 1 ) \Phi(J,w)=(J-s,2^sw+s-J-1) Φ ( J , w ) = ( J − s , 2 s w + s − J − 1 ) , with s s s as in Theorem 4.1 ; by that theorem, Φ ( J , w ) \Phi(J,w) Φ ( J , w ) is a state. We call ( J , w ) (J,w) ( J , w ) a root if w = 0 w=0 w = 0 or if ( J , w ) (J,w) ( J , w ) fails. For J ≥ 1 J\ge1 J ≥ 1 let F ( J ) F(J) F ( J ) be the number of states ( J , w ) (J,w) ( J , w ) that fail.
Theorem 8.4. 1. A state ( J , w ) (J,w) ( J , w ) with w ≥ 1 w\ge1 w ≥ 1 fails if and only if w = ( J + 1 − σ ) / 2 σ − 1 w=(J+1-\sigma)/2^{\sigma-1} w = ( J + 1 − σ ) / 2 σ − 1 for some integer σ ≥ 2 \sigma\ge2 σ ≥ 2 with 2 σ − 1 ∣ J + 1 − σ 2^{\sigma-1}\mid J+1-\sigma 2 σ − 1 ∣ J + 1 − σ and J + 1 − σ ≥ 2 σ − 1 J+1-\sigma\ge2^{\sigma-1} J + 1 − σ ≥ 2 σ − 1 . Distinct σ \sigma σ give distinct w w w , so F ( J ) F(J) F ( J ) is the number of such σ \sigma σ , and for every L ≥ 1 L\ge1 L ≥ 1 ,
∑ J = 1 L F ( J ) = ∑ σ = 2 L ⌊ L + 1 − σ 2 σ − 1 ⌋ . \sum_{J=1}^{L}F(J)=\sum_{\sigma=2}^{L}\left\lfloor\frac{L+1-\sigma}{2^{\sigma-1}}\right\rfloor. J = 1 ∑ L F ( J ) = σ = 2 ∑ L ⌊ 2 σ − 1 L + 1 − σ ⌋ .
Let ( J ′ , w ′ ) (J',w') ( J ′ , w ′ ) be a state and m = v 2 ( J ′ + 1 + w ′ ) m=v_2(J'+1+w') m = v 2 ( J ′ + 1 + w ′ ) . The states ( J , w ) (J,w) ( J , w ) with w ≥ 1 w\ge1 w ≥ 1 that do not fail and satisfy Φ ( J , w ) = ( J ′ , w ′ ) \Phi(J,w)=(J',w') Φ ( J , w ) = ( J ′ , w ′ ) are exactly the m m m states ( J ′ + σ , ( J ′ + 1 + w ′ ) / 2 σ ) (J'+\sigma,(J'+1+w')/2^\sigma) ( J ′ + σ , ( J ′ + 1 + w ′ ) / 2 σ ) , 1 ≤ σ ≤ m 1\le\sigma\le m 1 ≤ σ ≤ m .
The map Φ \Phi Φ makes the set of states a forest whose roots are the states ( J , 0 ) (J,0) ( J , 0 ) , J > 1 J>1 J > 1 , and the failing states; a state is successful if and only if the root of its tree is a state ( J , 0 ) (J,0) ( J , 0 ) . For every J ≥ 2 J\ge2 J ≥ 2 ,
N ( J ) = 1 + ∑ σ = 1 J − 1 # { w ′ ∈ S J − σ : 2 σ ∣ J − σ + 1 + w ′ } , J = 1 + F ( J ) + ∑ σ = 1 J − 1 # { 0 ≤ w ′ ≤ J − σ − 1 : 2 σ ∣ J − σ + 1 + w ′ } . N(J)=1+\sum_{\sigma=1}^{J-1}\#\{w'\in S_{J-\sigma}:2^\sigma\mid J-\sigma+1+w'\},\qquad J=1+F(J)+\sum_{\sigma=1}^{J-1}\#\{0\le w'\le J-\sigma-1:2^\sigma\mid J-\sigma+1+w'\}. N ( J ) = 1 + σ = 1 ∑ J − 1 # { w ′ ∈ S J − σ : 2 σ ∣ J − σ + 1 + w ′ } , J = 1 + F ( J ) + σ = 1 ∑ J − 1 # { 0 ≤ w ′ ≤ J − σ − 1 : 2 σ ∣ J − σ + 1 + w ′ } .
The initial states ( K − 1 , 2 h − K ) (K-1,2^h-K) ( K − 1 , 2 h − K ) , K ∈ ( 2 h − 1 , 2 h ] K\in(2^{h-1},2^h] K ∈ ( 2 h − 1 , 2 h ] , are exactly the states ( J , w ) (J,w) ( J , w ) with J + 1 + w = 2 h J+1+w=2^h J + 1 + w = 2 h .
Proof. (1) By Theorem 4.1 , ( J , w ) (J,w) ( J , w ) fails if and only if 2 s − 1 w + s = J + 1 2^{s-1}w+s=J+1 2 s − 1 w + s = J + 1 for the least admissible s s s . Conversely, suppose 2 σ − 1 w + σ = J + 1 2^{\sigma-1}w+\sigma=J+1 2 σ − 1 w + σ = J + 1 for some σ ≥ 2 \sigma\ge2 σ ≥ 2 . The function τ ↦ 2 τ w + τ \tau\mapsto2^\tau w+\tau τ ↦ 2 τ w + τ is increasing; at τ = σ − 1 \tau=\sigma-1 τ = σ − 1 its value is J < J + 1 J<J+1 J < J + 1 , and at τ = σ \tau=\sigma τ = σ it is 2 ( J + 1 − σ ) + σ = 2 J + 2 − σ ≥ J + 1 2(J+1-\sigma)+\sigma=2J+2-\sigma\ge J+1 2 ( J + 1 − σ ) + σ = 2 J + 2 − σ ≥ J + 1 , because J + 1 = 2 σ − 1 w + σ > σ J+1=2^{\sigma-1}w+\sigma>\sigma J + 1 = 2 σ − 1 w + σ > σ . Hence σ \sigma σ is the least admissible value and the state fails. Therefore ( J , w ) (J,w) ( J , w ) with w ≥ 1 w\ge1 w ≥ 1 fails if and only if w = ( J + 1 − σ ) / 2 σ − 1 w=(J+1-\sigma)/2^{\sigma-1} w = ( J + 1 − σ ) / 2 σ − 1 for some σ ≥ 2 \sigma\ge2 σ ≥ 2 , this quotient being an integer at least 1 1 1 ; such a w w w satisfies w ≤ ( J − 1 ) / 2 ≤ J − 1 w\le(J-1)/2\le J-1 w ≤ ( J − 1 ) /2 ≤ J − 1 , so ( J , w ) (J,w) ( J , w ) is a state. The quotient is strictly decreasing in σ \sigma σ , so distinct σ \sigma σ give distinct w w w . Finally, for fixed σ ≥ 2 \sigma\ge2 σ ≥ 2 , the integers J ≤ L J\le L J ≤ L with J + 1 − σ = 2 σ − 1 t J+1-\sigma=2^{\sigma-1}t J + 1 − σ = 2 σ − 1 t , t ≥ 1 t\ge1 t ≥ 1 , correspond to 1 ≤ t ≤ ( L + 1 − σ ) / 2 σ − 1 1\le t\le(L+1-\sigma)/2^{\sigma-1} 1 ≤ t ≤ ( L + 1 − σ ) / 2 σ − 1 , and there are none when σ > L \sigma>L σ > L ; summing over σ \sigma σ gives the formula.
(2) Put u = J ′ + 1 + w ′ u=J'+1+w' u = J ′ + 1 + w ′ ; since 0 ≤ w ′ ≤ J ′ − 1 0\le w'\le J'-1 0 ≤ w ′ ≤ J ′ − 1 , J ′ + 1 ≤ u ≤ 2 J ′ J'+1\le u\le2J' J ′ + 1 ≤ u ≤ 2 J ′ . If Φ ( J , w ) = ( J ′ , w ′ ) \Phi(J,w)=(J',w') Φ ( J , w ) = ( J ′ , w ′ ) with step s s s , then J = J ′ + s J=J'+s J = J ′ + s and 2 s w = w ′ + J + 1 − s = u 2^s w=w'+J+1-s=u 2 s w = w ′ + J + 1 − s = u , so 2 s ∣ u 2^s\mid u 2 s ∣ u , s ≤ m s\le m s ≤ m and w = u / 2 s w=u/2^s w = u / 2 s . Conversely, let 1 ≤ σ ≤ m 1\le\sigma\le m 1 ≤ σ ≤ m , J = J ′ + σ J=J'+\sigma J = J ′ + σ and w = u / 2 σ w=u/2^\sigma w = u / 2 σ . Then w ≥ 1 w\ge1 w ≥ 1 , and w ≤ u / 2 ≤ J ′ ≤ J − 1 w\le u/2\le J'\le J-1 w ≤ u /2 ≤ J ′ ≤ J − 1 , so ( J , w ) (J,w) ( J , w ) is a state. We have 2 σ w + σ = u + σ = J + 1 + w ′ ≥ J + 1 2^\sigma w+\sigma=u+\sigma=J+1+w'\ge J+1 2 σ w + σ = u + σ = J + 1 + w ′ ≥ J + 1 , and 2 σ − 1 w + σ − 1 = u / 2 + σ − 1 < J + 1 2^{\sigma-1}w+\sigma-1=u/2+\sigma-1<J+1 2 σ − 1 w + σ − 1 = u /2 + σ − 1 < J + 1 , since this is equivalent to w ′ < J ′ + 3 w'<J'+3 w ′ < J ′ + 3 ; so σ \sigma σ is the least admissible value. The failure condition 2 σ − 1 w + σ = J + 1 2^{\sigma-1}w+\sigma=J+1 2 σ − 1 w + σ = J + 1 would mean u = 2 J ′ + 2 u=2J'+2 u = 2 J ′ + 2 , that is w ′ = J ′ + 1 w'=J'+1 w ′ = J ′ + 1 , which is impossible. Finally 2 σ w + σ − J − 1 = u + σ − J ′ − σ − 1 = w ′ 2^\sigma w+\sigma-J-1=u+\sigma-J'-\sigma-1=w' 2 σ w + σ − J − 1 = u + σ − J ′ − σ − 1 = w ′ , so Φ ( J , w ) = ( J ′ , w ′ ) \Phi(J,w)=(J',w') Φ ( J , w ) = ( J ′ , w ′ ) .
(3) Φ \Phi Φ decreases J J J , so the orbit of every state ends at a root after finitely many steps, and every state that is not a root has exactly one image; this is a forest with the stated roots. By Theorem 4.1 , a state is successful if and only if its orbit ends at a state ( J , 0 ) (J,0) ( J , 0 ) . The states of level J J J are ( J , 0 ) (J,0) ( J , 0 ) , the F ( J ) F(J) F ( J ) failing states, and the states ( J , w ) (J,w) ( J , w ) with w ≥ 1 w\ge1 w ≥ 1 that do not fail; by part (2), the latter correspond bijectively to the pairs ( σ , w ′ ) (\sigma,w') ( σ , w ′ ) with 1 ≤ σ ≤ J − 1 1\le\sigma\le J-1 1 ≤ σ ≤ J − 1 , ( J − σ , w ′ ) (J-\sigma,w') ( J − σ , w ′ ) a state and 2 σ ∣ J − σ + 1 + w ′ 2^\sigma\mid J-\sigma+1+w' 2 σ ∣ J − σ + 1 + w ′ , through ( J , w ) ↦ ( σ , Φ ( J , w ) ) (J,w)\mapsto(\sigma,\Phi(J,w)) ( J , w ) ↦ ( σ , Φ ( J , w )) . Such a state is successful if and only if w ′ ∈ S J − σ w'\in S_{J-\sigma} w ′ ∈ S J − σ . Counting the successful states and all states of level J J J gives the two identities.
(4) If J = K − 1 J=K-1 J = K − 1 and w = 2 h − K w=2^h-K w = 2 h − K , then J + 1 + w = 2 h J+1+w=2^h J + 1 + w = 2 h . Conversely, if J + 1 + w = 2 h J+1+w=2^h J + 1 + w = 2 h with 0 ≤ w ≤ J − 1 0\le w\le J-1 0 ≤ w ≤ J − 1 , put K = J + 1 K=J+1 K = J + 1 ; then K = 2 h − w ≤ 2 h K=2^h-w\le2^h K = 2 h − w ≤ 2 h and 2 h ≤ 2 J < 2 K 2^h\le2J<2K 2 h ≤ 2 J < 2 K , so K ∈ ( 2 h − 1 , 2 h ] K\in(2^{h-1},2^h] K ∈ ( 2 h − 1 , 2 h ] and w = 2 h − K w=2^h-K w = 2 h − K .
By Theorem 8.4 (1), the number of failing states up to level L L L is at most ∑ σ ≥ 2 L / 2 σ − 1 = L \sum_{\sigma\ge2}L/2^{\sigma-1}=L ∑ σ ≥ 2 L / 2 σ − 1 = L , and there is exactly one root ( J , 0 ) (J,0) ( J , 0 ) at each level. By Theorem 8.4 (2), the number of children of a state ( J ′ , w ′ ) (J',w') ( J ′ , w ′ ) is v 2 ( J ′ + 1 + w ′ ) v_2(J'+1+w') v 2 ( J ′ + 1 + w ′ ) . Consequently, by parts (3) and (4), an exponent with candidate K K K belongs to I \mathcal{I} I if and only if the state ( K − 1 , 2 h ( K ) − K ) (K-1,2^{h(K)}-K) ( K − 1 , 2 h ( K ) − K ) , the unique state of level K − 1 K-1 K − 1 with J + 1 + w J+1+w J + 1 + w a power of 2, lies in the tree of a root ( J , 0 ) (J,0) ( J , 0 ) .
Proposition 8.5. Let ( J , w ) (J,w) ( J , w ) be a successful state with w > 1 w>1 w > 1 , and let T ⊂ { 1 , … , J } T\subset\{1,\ldots,J\} T ⊂ { 1 , … , J } be the set representing 2 J + 1 w 2^{J+1}w 2 J + 1 w . Then 1 ∉ T 1\notin T 1 ∈ / T , and the root of the tree of ( J , w ) (J,w) ( J , w ) is ( min T − 1 , 0 ) (\min T-1,0) ( min T − 1 , 0 ) . For every J ≥ 2 J\ge2 J ≥ 2 , exactly N ( J ) / 2 N(J)/2 N ( J ) /2 of the successful states of level J J J lie in the tree of the root ( 1 , 0 ) (1,0) ( 1 , 0 ) ; in particular N ( J ) N(J) N ( J ) is even.
Proof. Since J + 1 ≥ 3 J+1\ge3 J + 1 ≥ 3 , $2^{J+1}w\equiv 0\pmod 8$, so 1 ∉ T 1\notin T 1 ∈ / T , as in the proof of Theorem 2.2 . By the proof of Theorem 4.1 and Lemma 3.2 , if j = max T j=\max T j = max T then Φ ( J , w ) = ( j − 1 , w ′ ) \Phi(J,w)=(j-1,w') Φ ( J , w ) = ( j − 1 , w ′ ) , where T ∖ { j } T\setminus\{j\} T ∖ { j } represents 2 j w ′ 2^jw' 2 j w ′ . Applying this repeatedly removes the elements of T T T from the largest to the smallest; when the smallest element min T \min T min T is removed, the remaining set is empty, the state reached is ( min T − 1 , 0 ) (\min T-1,0) ( min T − 1 , 0 ) , and min T − 1 ≥ 1 \min T-1\ge1 min T − 1 ≥ 1 . Hence the root is ( min T − 1 , 0 ) (\min T-1,0) ( min T − 1 , 0 ) . Now let J ≥ 2 J\ge2 J ≥ 2 . The successful state ( J , 0 ) (J,0) ( J , 0 ) is represented by T = ∅ T=\varnothing T = ∅ and is its own root, different from ( 1 , 0 ) (1,0) ( 1 , 0 ) . A successful state of level J J J therefore lies in the tree of $(1,0) if and only if its representing set T T T satisfies min T = 2 \min T=2 min T = 2 , that is 2 ∈ T 2\in T 2 ∈ T , since 1 ∉ T 1\notin T 1 ∈ / T . The map T ↦ { 2 , … , J } ∖ T T\mapsto\{2,\ldots,J\}\setminus T T ↦ { 2 , … , J } ∖ T of the proof of Proposition 8.2 is a bijection of the set of representing sets of the states in S J S_J S J onto itself which exchanges the sets containing 2 and the sets not containing 2. Hence exactly half of the N ( J ) N(J) N ( J ) successful states have 2 ∈ T 2\in T 2 ∈ T .
The sets S J S_J S J can also be built from the smallest elements of T T T upwards.
Theorem 8.6. We have S 1 = { 0 } S_1=\{0\} S 1 = { 0 } , and for every J ≥ 2 J\ge2 J ≥ 2 :
if J J J is odd, S J = { c / 2 : c ∈ S J − 1 , c even } ∪ { ( c + J ) / 2 : c ∈ S J − 1 , c odd } S_J=\{c/2:c\in S_{J-1},\ c\ \text{even}\}\cup\{(c+J)/2:c\in S_{J-1},\ c\ \text{odd}\} S J = { c /2 : c ∈ S J − 1 , c even } ∪ {( c + J ) /2 : c ∈ S J − 1 , c odd } , and c ↦ w c\mapsto w c ↦ w is a bijection from S J − 1 S_{J-1} S J − 1 onto S J S_J S J ;
if J J J is even, S J = { c / 2 : c ∈ S J − 1 , c even } ∪ { c / 2 + J / 2 : c ∈ S J − 1 , c even } S_J=\{c/2:c\in S_{J-1},\ c\ \text{even}\}\cup\{c/2+J/2:c\in S_{J-1},\ c\ \text{even}\} S J = { c /2 : c ∈ S J − 1 , c even } ∪ { c /2 + J /2 : c ∈ S J − 1 , c even } , and the two sets are disjoint.
Consequently, N ( J ) = N ( J − 1 ) N(J)=N(J-1) N ( J ) = N ( J − 1 ) for odd J J J , N ( J ) = 2 # { c ∈ S J − 1 : c even } N(J)=2\#\{c\in S_{J-1}:c\ \text{even}\} N ( J ) = 2# { c ∈ S J − 1 : c even } for even J J J , and for even J J J and 0 ≤ w < J / 2 0\le w<J/2 0 ≤ w < J /2 , w ∈ S J w\in S_J w ∈ S J if and only if w + J / 2 ∈ S J w+J/2\in S_J w + J /2 ∈ S J .
Proof. S 1 = { 0 } S_1=\{0\} S 1 = { 0 } because E 1 = { 0 , 2 } \mathcal{E}_1=\{0,2\} E 1 = { 0 , 2 } and 4 ∤ 2 4\nmid2 4 ∤ 2 . Let J ≥ 2 J\ge2 J ≥ 2 . By Proposition 8.1 (1) and its proof, w ∈ S J w\in S_J w ∈ S J if and only if 2 J + 1 w = ∑ j ∈ T j 2 j 2^{J+1}w=\sum_{j\in T}j2^j 2 J + 1 w = ∑ j ∈ T j 2 j for a set T ⊂ { 1 , … , J } T\subset\{1,\ldots,J\} T ⊂ { 1 , … , J } , which is then unique. Write x = 1 x=1 x = 1 if J ∈ T J\in T J ∈ T and x = 0 x=0 x = 0 otherwise, and U = T ∖ { J } U=T\setminus\{J\} U = T ∖ { J } . If w ∈ S J w\in S_J w ∈ S J , then ∑ j ∈ U j 2 j = 2 J + 1 w − x J 2 J ≡ 0 ( m o d 2 J ) \sum_{j\in U}j2^j=2^{J+1}w-xJ2^J\equiv0\pmod{2^J} ∑ j ∈ U j 2 j = 2 J + 1 w − x J 2 J ≡ 0 ( mod 2 J ) , so c = 2 − J ∑ j ∈ U j 2 j ∈ S J − 1 c=2^{-J}\sum_{j\in U}j2^j\in S_{J-1} c = 2 − J ∑ j ∈ U j 2 j ∈ S J − 1 and
w = c + x J 2 . w=\frac{c+xJ}{2}. w = 2 c + x J .
Conversely, if c ∈ S J − 1 c\in S_{J-1} c ∈ S J − 1 , x ∈ { 0 , 1 } x\in\{0,1\} x ∈ { 0 , 1 } and c + x J c+xJ c + x J is even, then U ∪ { J } U\cup\{J\} U ∪ { J } (if x = 1 x=1 x = 1 ) or U U U (if x = 0 x=0 x = 0 ), where U U U represents c c c , represents 2 J + 1 ( c + x J ) / 2 2^{J+1}(c+xJ)/2 2 J + 1 ( c + x J ) /2 , so ( c + x J ) / 2 ∈ S J (c+xJ)/2\in S_J ( c + x J ) /2 ∈ S J . If J J J is odd, c + x J c+xJ c + x J is even exactly for x ≡ c ( m o d 2 ) x\equiv c\pmod2 x ≡ c ( mod 2 ) , which gives (1); the map c ↦ w c\mapsto w c ↦ w is injective because w w w determines T T T , hence U U U and c c c . If J J J is even, c + x J c+xJ c + x J is even exactly when c c c is even, with both x = 0 x=0 x = 0 and x = 1 x=1 x = 1 , which gives (2); since c ≤ J − 2 c\le J-2 c ≤ J − 2 , c / 2 < J / 2 ≤ c ′ / 2 + J / 2 c/2<J/2\le c'/2+J/2 c /2 < J /2 ≤ c ′ /2 + J /2 for all even c , c ′ ∈ S J − 1 c,c'\in S_{J-1} c , c ′ ∈ S J − 1 , so the two sets are disjoint. The consequences follow at once: for even J J J , S J = B ∪ ( B + J / 2 ) S_J=B\cup(B+J/2) S J = B ∪ ( B + J /2 ) with B = { c / 2 : c ∈ S J − 1 , c even } ⊆ [ 0 , J / 2 ) B=\{c/2:c\in S_{J-1},\ c\ \text{even}\}\subseteq[0,J/2) B = { c /2 : c ∈ S J − 1 , c even } ⊆ [ 0 , J /2 ) .
Theorem 8.6 gives a second proof of the equality N ( 2 k + 1 ) = N ( 2 k ) N(2k+1)=N(2k) N ( 2 k + 1 ) = N ( 2 k ) of Proposition 8.3 . In terms of Theorem 8.6 , an exponent a a a with candidate K K K belongs to A \mathcal{A} A if and only if 2 h ( K ) − K ∈ S K − 1 2^{h(K)}-K\in S_{K-1} 2 h ( K ) − K ∈ S K − 1 , where the sets S J S_J S J are obtained from S 1 = { 0 } S_1=\{0\} S 1 = { 0 } by the maps c ↦ c / 2 c\mapsto c/2 c ↦ c /2 and c ↦ ( c + J ) / 2 c\mapsto(c+J)/2 c ↦ ( c + J ) /2 of parts (1) and (2).
The symmetry of Proposition 8.2 transports the states decided by one step of the recursion to further initial states.
The first family below is the formula c ( 2 k − 1 ) = k 2 k − 1 c(2^k-1)=k2^{k-1} c ( 2 k − 1 ) = k 2 k − 1 of [1 ] at k = 2 r k=2^r k = 2 r .
Theorem 8.7.
For every r ≥ 0 r\ge0 r ≥ 0 , c ( 2 2 r − 1 ) = 2 2 r + r − 1 c(2^{2^r}-1)=2^{2^r+r-1} c ( 2 2 r − 1 ) = 2 2 r + r − 1 ; the candidate of the exponent 2 r + r − 1 2^r+r-1 2 r + r − 1 is K = 2 r + 1 K=2^r+1 K = 2 r + 1 .
Let i ≥ 1 i\ge1 i ≥ 1 , σ = 2 i − 1 + 1 \sigma=2^{i-1}+1 σ = 2 i − 1 + 1 , and let h ≥ σ + 2 h\ge\sigma+2 h ≥ σ + 2 with h ≡ i ( m o d σ + 1 ) h\equiv i\pmod{\sigma+1} h ≡ i ( mod σ + 1 ) . Then w = ( 2 h − 2 σ + 2 ) / ( 2 σ + 1 − 1 ) w=(2^h-2^\sigma+2)/(2^{\sigma+1}-1) w = ( 2 h − 2 σ + 2 ) / ( 2 σ + 1 − 1 ) is an even positive integer, K = 2 h − 1 + 1 + w / 2 K=2^{h-1}+1+w/2 K = 2 h − 1 + 1 + w /2 satisfies 2 h − 1 + 1 < K < 2 h 2^{h-1}+1<K<2^h 2 h − 1 + 1 < K < 2 h , and K + h − 3 ∈ A K+h-3\in\mathcal{A} K + h − 3 ∈ A .
Let i ≥ 2 i\ge2 i ≥ 2 , σ = 2 i − 1 + 1 \sigma=2^{i-1}+1 σ = 2 i − 1 + 1 , and let h ≥ σ + 1 h\ge\sigma+1 h ≥ σ + 1 with h ≡ i ( m o d σ ) h\equiv i\pmod{\sigma} h ≡ i ( mod σ ) . Then w = ( 2 h − 2 σ + 2 ) / ( 2 σ − 1 ) w=(2^h-2^\sigma+2)/(2^\sigma-1) w = ( 2 h − 2 σ + 2 ) / ( 2 σ − 1 ) is an even positive integer, K = 2 h − 1 + 1 + w / 2 K=2^{h-1}+1+w/2 K = 2 h − 1 + 1 + w /2 satisfies 2 h − 1 + 1 < K < 2 h 2^{h-1}+1<K<2^h 2 h − 1 + 1 < K < 2 h , and K + h − 3 ∉ A K+h-3\notin\mathcal{A} K + h − 3 ∈ / A .
Proof. (1) By the proof of Lemma 2.1, c ( 2 k − 1 ) = k 2 k − 1 c(2^k-1)=k2^{k-1} c ( 2 k − 1 ) = k 2 k − 1 ; take k = 2 r k=2^r k = 2 r . Then B ( 2 k − 1 ) + 2 = { 2 , … , k + 1 } \mathcal{B}(2^k-1)+2=\{2,\ldots,k+1\} B ( 2 k − 1 ) + 2 = { 2 , … , k + 1 } , whose largest element is K = 2 r + 1 K=2^r+1 K = 2 r + 1 .
(2) Put M = 2 σ + 1 − 1 M=2^{\sigma+1}-1 M = 2 σ + 1 − 1 . Since 2 σ + 1 ≡ 1 ( m o d M ) 2^{\sigma+1}\equiv1\pmod M 2 σ + 1 ≡ 1 ( mod M ) and h ≡ i ( m o d σ + 1 ) h\equiv i\pmod{\sigma+1} h ≡ i ( mod σ + 1 ) , 2 h ≡ 2 i = 2 σ − 2 ( m o d M ) 2^h\equiv2^i=2\sigma-2\pmod M 2 h ≡ 2 i = 2 σ − 2 ( mod M ) , so w w w is an integer; and w ≥ 1 w\ge1 w ≥ 1 because 2 h ≥ 2 σ + 2 = 2 M + 2 > M + 2 σ − 2 2^h\ge2^{\sigma+2}=2M+2>M+2\sigma-2 2 h ≥ 2 σ + 2 = 2 M + 2 > M + 2 σ − 2 . Put J ′ = 2 σ w − 1 ≥ 1 J'=2^\sigma w-1\ge1 J ′ = 2 σ w − 1 ≥ 1 and J = J ′ + σ J=J'+\sigma J = J ′ + σ . Since ν 2 ( J ′ + 1 ) ≥ σ \nu_2(J'+1)\ge\sigma ν 2 ( J ′ + 1 ) ≥ σ , Theorem 8.4 (2) shows that ( J , w ) (J,w) ( J , w ) is a state that does not fail, with Φ ( J , w ) = Φ ( J ′ , 0 ) \Phi(J,w)=\Phi(J',0) Φ ( J , w ) = Φ ( J ′ , 0 ) ; hence w ∈ S J w\in S_J w ∈ S J , and J − 1 − σ ∈ S J J-1-\sigma\in S_J J − 1 − σ ∈ S J by Proposition 8.2 . Moreover 2 J − w = 2 σ w + 2 σ − 2 − w = 2 h 2J-w=2^\sigma w+2\sigma-2-w=2^h 2 J − w = 2 σ w + 2 σ − 2 − w = 2 h , so w w w is even, and, with K = J + 1 K=J+1 K = J + 1 , K = 2 h − 1 + 1 + w / 2 K=2^{h-1}+1+w/2 K = 2 h − 1 + 1 + w /2 and 2 h − K = J − 1 − w ∈ S K − 1 2^h-K=J-1-w\in S_{K-1} 2 h − K = J − 1 − w ∈ S K − 1 . Since w ≥ 2 w\ge2 w ≥ 2 and w < 2 h − 2 w<2^h-2 w < 2 h − 2 , 2 h − 1 + 1 < K < 2 h 2^{h-1}+1<K<2^h 2 h − 1 + 1 < K < 2 h , so h = h ( K ) h=h(K) h = h ( K ) , and Theorem 3.3 gives K + h − 3 ∈ A K+h-3\in\mathcal{A} K + h − 3 ∈ A .
(3) Put M ′ = 2 σ − 1 M'=2^\sigma-1 M ′ = 2 σ − 1 . As in (2), 2 h ≡ 2 i = 2 σ − 2 ( m o d M ′ ) 2^h\equiv2^i=2\sigma-2\pmod{M'} 2 h ≡ 2 i = 2 σ − 2 ( mod M ′ ) , so w w w is an integer, and w ≥ 1 w\ge1 w ≥ 1 because 2 h ≥ 2 σ + 1 = 2 M ′ + 2 ≥ M ′ + 2 σ − 2 2^h\ge2^{\sigma+1}=2M'+2\ge M'+2\sigma-2 2 h ≥ 2 σ + 1 = 2 M ′ + 2 ≥ M ′ + 2 σ − 2 for σ ≥ 3 \sigma\ge3 σ ≥ 3 . Put J = 2 σ − 1 w + σ − 1 J=2^{\sigma-1}w+\sigma-1 J = 2 σ − 1 w + σ − 1 . Then J + 1 − σ = 2 σ − 1 w ≥ 2 σ − 1 J+1-\sigma=2^{\sigma-1}w\ge2^{\sigma-1} J + 1 − σ = 2 σ − 1 w ≥ 2 σ − 1 and w = ( J + 1 − σ ) / 2 σ − 1 w=(J+1-\sigma)/2^{\sigma-1} w = ( J + 1 − σ ) / 2 σ − 1 , so the state ( J , w ) (J,w) ( J , w ) fails by Theorem 8.4 (1), and w ∉ S J w\notin S_J w ∈ / S J ; by Proposition 8.2 , J − 1 − w ∉ S J J-1-w\notin S_J J − 1 − w ∈ / S J . Moreover 2 J − w = 2 σ w + 2 σ − 2 − w = M ′ w + 2 σ − 2 = 2 h 2J-w=2^\sigma w+2\sigma-2-w=M'w+2\sigma-2=2^h 2 J − w = 2 σ w + 2 σ − 2 − w = M ′ w + 2 σ − 2 = 2 h , and the conclusion follows as in (2).
:::
Theorem 8.8. As x → ∞ x\to\infty x → ∞ ,
A ( x ) ≥ ( 3 + C 1 ) log 2 x − O ( log log x ) , B ( x ) ≥ ( 5 4 + E 2 + C 2 ) log 2 x − O ( log log x ) , A(x)\ge(3+C_1)\log_2 x-O(\log\log x),\qquad B(x)\ge\left(\frac{5}{4}+\frac{E}{2}+C_2\right)\log_2 x-O(\log\log x), A ( x ) ≥ ( 3 + C 1 ) log 2 x − O ( log log x ) , B ( x ) ≥ ( 4 5 + 2 E + C 2 ) log 2 x − O ( log log x ) , where C 1 = ∑ k ≥ 0 1 / ( 2 k + 2 ) = 0.9655832 … C_1=\sum_{k\ge0}1/(2^k+2)=0.9655832\ldots C 1 = ∑ k ≥ 0 1/ ( 2 k + 2 ) = 0.9655832 … , C 2 = ∑ k ≥ 1 1 / ( 2 k + 1 ) = 0.7644997 … C_2=\sum_{k\ge1}1/(2^k+1)=0.7644997\ldots C 2 = ∑ k ≥ 1 1/ ( 2 k + 1 ) = 0.7644997 … and E E E is as in Theorem 7.1 ; thus 3 + C 1 = 3.9655832 … 3+C_1=3.9655832\ldots 3 + C 1 = 3.9655832 … and 5 4 + E 2 + C 2 = 2.8178473 … \frac54+\frac E2+C_2=2.8178473\ldots 4 5 + 2 E + C 2 = 2.8178473 …
Proof. We keep the notation H = ⌊ log 2 x ⌋ − 1 H=\lfloor\log_2 x\rfloor-1 H = ⌊ log 2 x ⌋ − 1 of the proof of Theorem 7.1 , whose families we use together with those of Theorem 8.7 . All the exponents are of the form β ( K ) − 3 \beta(K)-3 β ( K ) − 3 with K ≤ 2 h K\le2^h K ≤ 2 h , h ≤ H h\le H h ≤ H , hence at most x x x , and distinct values of K K K give distinct exponents. For h ≥ 4 h\ge4 h ≥ 4 , the integers K K K of Theorem 8.7 (2) and (3) satisfy K = 2 h − 1 + 1 + w / 2 K=2^{h-1}+1+w/2 K = 2 h − 1 + 1 + w /2 with w ≤ 2 h / 7 w\le2^h/7 w ≤ 2 h /7 , hence K < 2 3 2 h K<\frac{2}{3}2^h K < 3 2 2 h because 2 h − 1 ( 1 3 − 1 7 ) > 1 2^{h-1}\left(\frac{1}{3}-\frac{1}{7}\right)>1 2 h − 1 ( 3 1 − 7 1 ) > 1 ; the integers K K K of Theorems 5.1 (2) and 6.1 satisfy K > 2 h − 2 h / 3 = 2 3 2 h K>2^h-2^h/3=\frac{2}{3}2^h K > 2 h − 2 h /3 = 3 2 2 h , since there the denominators 2 s + 1 2^s+1 2 s + 1 and 2 s − 1 + 1 2^{s-1}+1 2 s − 1 + 1 are at least 3. In Theorem 8.7 (2) and (3), w / 2 w/2 w /2 is strictly decreasing in σ \sigma σ , and K > 2 h − 1 + 1 K>2^{h-1}+1 K > 2 h − 1 + 1 ; and for h ≥ 3 h\ge3 h ≥ 3 the integer 2 h − 1 + 1 2^{h-1}+1 2 h − 1 + 1 of Theorem 8.7 (1) differs from 2 h 2^h 2 h and from the integers of Theorem 5.1 (2), which exceed 2 3 2 h \frac{2}{3}2^h 3 2 2 h . Hence, for h ≥ 4 h\ge4 h ≥ 4 , all the integers K K K produced in the block ( 2 h − 1 , 2 h ] (2^{h-1},2^h] ( 2 h − 1 , 2 h ] are distinct.
Members. Besides the 2 H − log 2 H − 3 2H-\log_2 H-3 2 H − log 2 H − 3 exponents of the proof of Theorem 7.1 , Theorem 8.7 (1) gives one exponent for each 4 ≤ h ≤ H 4\le h\le H 4 ≤ h ≤ H , and Theorem 8.7 (2) gives, for each 1 ≤ i ≤ κ = ⌊ log 2 H ⌋ 1\le i\le\kappa=\lfloor\log_2 H\rfloor 1 ≤ i ≤ κ = ⌊ log 2 H ⌋ , at least ( H − σ − 1 ) / ( σ + 1 ) − 1 (H-\sigma-1)/(\sigma+1)-1 ( H − σ − 1 ) / ( σ + 1 ) − 1 integers h ∈ [ σ + 2 , H ] h\in[\sigma+2,H] h ∈ [ σ + 2 , H ] with h ≡ i ( m o d σ + 1 ) h\equiv i\pmod{\sigma+1} h ≡ i ( mod σ + 1 ) , where σ = 2 i − 1 + 1 \sigma=2^{i-1}+1 σ = 2 i − 1 + 1 . Since ∑ i > κ 1 / ( 2 i − 1 + 2 ) ≤ 2 1 − κ < 4 / H \sum_{i>\kappa}1/(2^{i-1}+2)\le2^{1-\kappa}<4/H ∑ i > κ 1/ ( 2 i − 1 + 2 ) ≤ 2 1 − κ < 4/ H and σ ≤ H / 2 + 1 \sigma\le H/2+1 σ ≤ H /2 + 1 for i ≤ κ i\le\kappa i ≤ κ , the sum over i i i is at least C 1 H − O ( log H ) C_1H-O(\log H) C 1 H − O ( log H ) .
Non-members. Besides the exponents of the proof of Theorem 7.1 , Theorem 8.7 (3) gives, for each 2 ≤ i ≤ κ 2\le i\le\kappa 2 ≤ i ≤ κ , at least ( H − σ ) / σ − 1 (H-\sigma)/\sigma-1 ( H − σ ) / σ − 1 integers h ∈ [ σ + 1 , H ] h\in[\sigma+1,H] h ∈ [ σ + 1 , H ] with h ≡ i ( m o d σ ) h\equiv i\pmod{\sigma} h ≡ i ( mod σ ) ; as above, the sum over i i i is at least ( ∑ i ≥ 2 1 / ( 2 i − 1 + 1 ) ) H − O ( log H ) = C 2 H − O ( log H ) (\sum_{i\ge2}1/(2^{i-1}+1))H-O(\log H)=C_2H-O(\log H) ( ∑ i ≥ 2 1/ ( 2 i − 1 + 1 )) H − O ( log H ) = C 2 H − O ( log H ) . Since H = log 2 x + O ( 1 ) H=\log_2x+O(1) H = log 2 x + O ( 1 ) , the bounds follow.
The analogue for an arbitrary prime
Let p p p be a prime and v p v_p v p the p p p -adic valuation. Put
c p ( n ) = ∑ k = 1 n p v p ( k ) , A p = { a ≥ 0 : p a ∈ c p ( N ) } , A p ( x ) = # { a ∈ A p : a ≤ x } , c_p(n)=\sum_{k=1}^{n}p^{v_p(k)},\qquad A_p=\{a\ge0:p^a\in c_p(\mathbb{N})\},\qquad A_p(x)=\#\{a\in A_p:a\le x\}, c p ( n ) = k = 1 ∑ n p v p ( k ) , A p = { a ≥ 0 : p a ∈ c p ( N )} , A p ( x ) = # { a ∈ A p : a ≤ x } ,
and B p ( x ) = # { a ∈ Z ∩ [ 0 , x ] : a ∉ A p } B_p(x)=\#\{a\in\mathbb{Z}\cap[0,x]:a\notin A_p\} B p ( x ) = # { a ∈ Z ∩ [ 0 , x ] : a ∈ / A p } , so that c 2 = c c_2=c c 2 = c , A 2 = A A_2=A A 2 = A , A 2 = A A_2=A A 2 = A and B 2 = B B_2=B B 2 = B . The interpretation of c c c recalled in § 1 extends to every prime.
Proposition 9.1. For every n ≥ 1 n\ge1 n ≥ 1 , c p ( n ) c_p(n) c p ( n ) is the exponent of 1 − X 1-X 1 − X in the factorization of ( 1 − X ) ( 1 − X 2 ) ⋯ ( 1 − X n ) (1-X)(1-X^2)\cdots(1-X^n) ( 1 − X ) ( 1 − X 2 ) ⋯ ( 1 − X n ) into irreducible factors over F p [ X ] \mathbb{F}_p[X] F p [ X ] .
Proof. Write k = p v k ′ k=p^v k' k = p v k ′ with p ∤ k ′ p\nmid k' p ∤ k ′ . In characteristic p p p , 1 − X k = ( 1 − X k ′ ) p v 1-X^k=(1-X^{k'})^{p^v} 1 − X k = ( 1 − X k ′ ) p v , and 1 − X k ′ = ( 1 − X ) ( 1 + X + ⋯ + X k ′ − 1 ) 1-X^{k'}=(1-X)(1+X+\cdots+X^{k'-1}) 1 − X k ′ = ( 1 − X ) ( 1 + X + ⋯ + X k ′ − 1 ) , where the second factor takes the value k ′ ≠ 0 k'\ne0 k ′ = 0 at X = 1 X=1 X = 1 ; hence 1 − X 1-X 1 − X divides 1 − X k 1-X^k 1 − X k exactly p v = p v p ( k ) p^v=p^{v_p(k)} p v = p v p ( k ) times, and the exponents add up over k ≤ n k\le n k ≤ n .
Lemma 9.2. 1. For every n ≥ 1 n\ge1 n ≥ 1 , c p ( p n ) = p c p ( n ) + ( p − 1 ) n c_p(pn)=pc_p(n)+(p-1)n c p ( p n ) = p c p ( n ) + ( p − 1 ) n .
For every m ≥ 0 m\ge0 m ≥ 0 , c p ( p m − 1 ) = m ( p − 1 ) p m − 1 c_p(p^m-1)=m(p-1)p^{m-1} c p ( p m − 1 ) = m ( p − 1 ) p m − 1 and c p ( p m ) = p m − 1 ( ( p − 1 ) m + p ) c_p(p^m)=p^{m-1}((p-1)m+p) c p ( p m ) = p m − 1 (( p − 1 ) m + p ) .
If n = ∑ i ≥ 0 d i p i n=\sum_{i\ge0}d_ip^i n = ∑ i ≥ 0 d i p i is the expansion of n n n in base p p p , then c p ( n ) = ∑ i ≥ 0 d i p i − 1 ( ( p − 1 ) i + p ) c_p(n)=\sum_{i\ge0}d_ip^{i-1}((p-1)i+p) c p ( n ) = ∑ i ≥ 0 d i p i − 1 (( p − 1 ) i + p ) .
Proof. (1) Among k ≤ p n k\le pn k ≤ p n , the ( p − 1 ) n (p-1)n ( p − 1 ) n integers prime to p p p contribute 1 each, and k = p k 1 k=pk_1 k = p k 1 with k 1 ≤ n k_1\le n k 1 ≤ n contributes p ⋅ p v p ( k 1 ) p\cdot p^{v_p(k_1)} p ⋅ p v p ( k 1 ) . For (2), for 0 ≤ v ≤ m − 1 0\le v\le m-1 0 ≤ v ≤ m − 1 , exactly ( p − 1 ) p m − v − 1 (p-1)p^{m-v-1} ( p − 1 ) p m − v − 1 integers k ∈ [ 1 , p m − 1 ] k\in[1,p^m-1] k ∈ [ 1 , p m − 1 ] have v p ( k ) = v v_p(k)=v v p ( k ) = v , which gives c p ( p m − 1 ) = c p ( p m ) − p m c_p(p^m-1)=c_p(p^m)-p^m c p ( p m − 1 ) = c p ( p m ) − p m . (3) Let m ≥ 0 m\ge0 m ≥ 0 , 1 ≤ d ≤ p − 1 1\le d\le p-1 1 ≤ d ≤ p − 1 and 0 ≤ s < p m 0\le s<p^m 0 ≤ s < p m . For 0 ≤ t ≤ d − 1 0\le t\le d-1 0 ≤ t ≤ d − 1 and 1 ≤ k ≤ p m − 1 1\le k\le p^m-1 1 ≤ k ≤ p m − 1 , v p ( t p m + k ) = v p ( k ) v_p(tp^m+k)=v_p(k) v p ( t p m + k ) = v p ( k ) , and v p ( t p m ) = m v_p(tp^m)=m v p ( t p m ) = m for 1 ≤ t ≤ d 1\le t\le d 1 ≤ t ≤ d ; hence c p ( d p m + s ) = d ( c p ( p m − 1 ) + p m ) + c p ( s ) = d c p ( p m ) + c p ( s ) c_p(dp^m+s)=d(c_p(p^m-1)+p^m)+c_p(s)=dc_p(p^m)+c_p(s) c p ( d p m + s ) = d ( c p ( p m − 1 ) + p m ) + c p ( s ) = d c p ( p m ) + c p ( s ) , with c p ( 0 ) = 0 c_p(0)=0 c p ( 0 ) = 0 . Induction on the number of nonzero digits and (2) give (3).
For p = 2 p=2 p = 2 , part (1) is the recurrence c ( 2 n ) = 2 c ( n ) + n c(2n)=2c(n)+n c ( 2 n ) = 2 c ( n ) + n of [1 ] , and part (3) is Lemma 2.1. Put t i = p c p ( p i ) = p i ( ( p − 1 ) i + p ) t_i=pc_p(p^i)=p^i((p-1)i+p) t i = p c p ( p i ) = p i (( p − 1 ) i + p ) for i ≥ 0 i\ge0 i ≥ 0 , and let E K ( p ) \mathcal{E}^{(p)}_K E K ( p ) be the set of sums ∑ 0 ≤ i < K d i t i \sum_{0\le i<K}d_it_i ∑ 0 ≤ i < K d i t i with 0 ≤ d i ≤ p − 1 0\le d_i\le p-1 0 ≤ d i ≤ p − 1 .
Theorem 9.3. 1. For a ≥ 0 a\ge0 a ≥ 0 , a ∈ A p a\in A_p a ∈ A p if and only if p a + 1 = ∑ i ≥ 0 d i t i p^{a+1}=\sum_{i\ge0}d_it_i p a + 1 = ∑ i ≥ 0 d i t i with 0 ≤ d i ≤ p − 1 0\le d_i\le p-1 0 ≤ d i ≤ p − 1 , not all zero; then n = ∑ i d i p i n=\sum_i d_ip^i n = ∑ i d i p i satisfies c p ( n ) = p a c_p(n)=p^a c p ( n ) = p a .
For every m ≥ 0 m\ge0 m ≥ 0 , ∑ 0 ≤ i < m ( p − 1 ) t i = m ( p − 1 ) p m < t m \sum_{0\le i<m}(p-1)t_i=m(p-1)p^m<t_m ∑ 0 ≤ i < m ( p − 1 ) t i = m ( p − 1 ) p m < t m . Hence a representation V = ∑ i d i t i V=\sum_i d_it_i V = ∑ i d i t i with digits 0 ≤ d i ≤ p − 1 0\le d_i\le p-1 0 ≤ d i ≤ p − 1 is unique, and its largest index K K K with d K ≠ 0 d_K\ne0 d K = 0 satisfies d K = ⌊ V / t K ⌋ d_K=\lfloor V/t_K\rfloor d K = ⌊ V / t K ⌋ .
For K ≥ 0 K \ge0 K ≥ 0 let g ( K ) g(K) g ( K ) be the least integer g ≥ 1 g \ge1 g ≥ 1 with p g ≥ ( p − 1 ) ( K + 1 ) + 1 p^g \ge(p-1)(K+1)+1 p g ≥ ( p − 1 ) ( K + 1 ) + 1 . If p b = ∑ i d i t i p^b=\sum_i d_i t_i p b = ∑ i d i t i has largest index K K K , then b = K + g ( K ) b=K+g(K) b = K + g ( K ) and d K = ⌊ p g ( K ) / ( ( p − 1 ) K + p ) ⌋ ∈ [ 1 , p − 1 ] d_K=\left\lfloor p^{g(K)}/((p-1)K+p)\right\rfloor\in[1,p-1] d K = ⌊ p g ( K ) / (( p − 1 ) K + p ) ⌋ ∈ [ 1 , p − 1 ] . The map K ↦ K + g ( K ) K\mapsto K+g(K) K ↦ K + g ( K ) is strictly increasing on { 0 , 1 , 2 , … } \{0,1,2,\ldots\} { 0 , 1 , 2 , … } , and the integers b ≥ 1 b\ge1 b ≥ 1 outside its image are exactly b = ( p g − 1 ) / ( p − 1 ) + g b=(p^g-1)/(p-1)+g b = ( p g − 1 ) / ( p − 1 ) + g , g ≥ 1 g\ge1 g ≥ 1 . Consequently, a ∉ A p a\notin\mathcal{A}_p a ∈ / A p for a = ( p g − 1 ) / ( p − 1 ) + g − 1 a=(p^g-1)/(p-1)+g-1 a = ( p g − 1 ) / ( p − 1 ) + g − 1 , g ≥ 1 g\ge1 g ≥ 1 , and every other a ≥ 0 a\ge0 a ≥ 0 has a unique candidate K K K with K + g ( K ) = a + 1 K+g(K)=a+1 K + g ( K ) = a + 1 .
Proof. (1) By Lemma 9.2 (3), p c p ( n ) = ∑ i d i t i p\,c_p(n)=\sum_i d_i t_i p c p ( n ) = ∑ i d i t i , and every digit vector with digits in [ 0 , p − 1 ] [0,p-1] [ 0 , p − 1 ] , not all zero, is the expansion of a unique n ≥ 1 n\ge1 n ≥ 1 .
(2) By Lemma 9.2 (2), ∑ i < m ( p − 1 ) t i = p c p ( p m − 1 ) = m ( p − 1 ) p m < p m ( ( p − 1 ) m + p ) = t m \sum_{i<m}(p-1)t_i=p\,c_p(p^m-1)=m(p-1)p^m<p^m((p-1)m+p)=t_m ∑ i < m ( p − 1 ) t i = p c p ( p m − 1 ) = m ( p − 1 ) p m < p m (( p − 1 ) m + p ) = t m . If K K K is the largest index with d K ≠ 0 d_K\ne0 d K = 0 , then 0 ≤ V − d K t K ≤ ∑ i < K ( p − 1 ) t i < t K 0\le V-d_Kt_K\le\sum_{i<K}(p-1)t_i<t_K 0 ≤ V − d K t K ≤ ∑ i < K ( p − 1 ) t i < t K , so d K = ⌊ V / t K ⌋ d_K=\lfloor V/t_K\rfloor d K = ⌊ V / t K ⌋ ; uniqueness follows by induction.
(3) Put u = ( p − 1 ) ( K + 1 ) u=(p-1)(K+1) u = ( p − 1 ) ( K + 1 ) and γ = b − K \gamma=b-K γ = b − K . From t K ≤ p b ≤ ∑ i ≤ K ( p − 1 ) t i = ( K + 1 ) ( p − 1 ) p K + 1 t_K\le p^b\le\sum_{i\le K}(p-1)t_i=(K+1)(p-1)p^{K+1} t K ≤ p b ≤ ∑ i ≤ K ( p − 1 ) t i = ( K + 1 ) ( p − 1 ) p K + 1 we get u + 1 = ( p − 1 ) K + p ≤ p γ ≤ p u u+1=(p-1)K+p\le p^\gamma\le pu u + 1 = ( p − 1 ) K + p ≤ p γ ≤ p u . The interval [ u + 1 , p u ] [u+1,pu] [ u + 1 , p u ] contains exactly one power of p p p : if g g g is least with p g ≥ u + 1 p^g\ge u+1 p g ≥ u + 1 , then g ≥ 1 g\ge1 g ≥ 1 because u + 1 ≥ p u+1\ge p u + 1 ≥ p , and p g − 1 ≤ u p^{g-1}\le u p g − 1 ≤ u , so p g ≤ p u p^g\le pu p g ≤ p u ; and p g + 1 > p u p^{g+1}>pu p g + 1 > p u . Hence γ = g ( K ) \gamma=g(K) γ = g ( K ) . Since p g ( K ) ≤ p u < p ( ( p − 1 ) K + p ) p^{g(K)}\le pu<p((p-1)K+p) p g ( K ) ≤ p u < p (( p − 1 ) K + p ) and p g ( K ) ≥ ( p − 1 ) K + p p^{g(K)}\ge(p-1)K+p p g ( K ) ≥ ( p − 1 ) K + p , part (2) gives 1 ≤ d K ≤ p − 1 1\le d_K\le p-1 1 ≤ d K ≤ p − 1 . Next, u u u increases by p − 1 p-1 p − 1 when K K K increases by 1, so g ( K + 1 ) − g ( K ) ∈ { 0 , 1 } g(K+1)-g(K)\in\{0,1\} g ( K + 1 ) − g ( K ) ∈ { 0 , 1 } , and g ( K + 1 ) = g ( K ) + 1 g(K+1)=g(K)+1 g ( K + 1 ) = g ( K ) + 1 exactly when p g ( K ) < ( p − 1 ) ( K + 2 ) + 1 p^{g(K)}<(p-1)(K+2)+1 p g ( K ) < ( p − 1 ) ( K + 2 ) + 1 , that is p g ( K ) − 1 ∈ [ u , u + p − 2 ] p^{g(K)}-1\in[u,u+p-2] p g ( K ) − 1 ∈ [ u , u + p − 2 ] . Both p g − 1 p^g-1 p g − 1 and u u u are multiples of p − 1 p-1 p − 1 , so this means p g ( K ) − 1 = u p^{g(K)}-1=u p g ( K ) − 1 = u , that is K + 1 = ( p g − 1 ) / ( p − 1 ) K+1=(p^g-1)/(p-1) K + 1 = ( p g − 1 ) / ( p − 1 ) with g = g ( K ) g=g(K) g = g ( K ) . Hence K ↦ K + g ( K ) K\mapsto K+g(K) K ↦ K + g ( K ) increases by 1 at each step except from K = ( p g − 1 ) / ( p − 1 ) − 1 K=(p^g-1)/(p-1)-1 K = ( p g − 1 ) / ( p − 1 ) − 1 , where g ( K ) = g g(K)=g g ( K ) = g , to K + 1 K+1 K + 1 , where it increases by 2 and skips b = K + g + 1 = ( p g − 1 ) / ( p − 1 ) + g b=K+g+1=(p^g-1)/(p-1)+g b = K + g + 1 = ( p g − 1 ) / ( p − 1 ) + g ; every g ≥ 1 g\ge1 g ≥ 1 occurs, and 0 + g ( 0 ) = 1 0+g(0)=1 0 + g ( 0 ) = 1 . The last statement follows from (1) with b = a + 1 b=a+1 b = a + 1 .
For p = 2 p=2 p = 2 , the change of index j = i + 2 j=i+2 j = i + 2 turns t i t_i t i into j 2 j / 4 j2^j/4 j 2 j /4 ; the candidate of Theorem 9.3 is the candidate of Theorem 3.3 minus 2, and the excluded exponents are 2 g + g − 2 2^g+g-2 2 g + g − 2 . The recursion of Theorem 4.1 extends to every prime as follows. A p p p -state is a pair ( K , w ) (K,w) ( K , w ) of integers with K ≥ 0 K\ge0 K ≥ 0 and 0 ≤ w ≤ ( p − 1 ) K 0\le w\le(p-1)K 0 ≤ w ≤ ( p − 1 ) K ; it is successful if p K w ∈ E K ( p ) p^Kw\in\mathcal{E}^{(p)}_K p K w ∈ E K ( p ) .
Theorem 9.4. 1. Let a ≥ 0 a\ge0 a ≥ 0 have the candidate K K K , put g = a + 1 − K g=a+1-K g = a + 1 − K , u = ( p − 1 ) K + p u=(p-1)K+p u = ( p − 1 ) K + p , d = ⌊ p g / u ⌋ d=\lfloor p^g/u\rfloor d = ⌊ p g / u ⌋ and w 0 = p g − d u w_0=p^g-du w 0 = p g − d u . Then a ∈ A p a\in\mathcal{A}_p a ∈ A p if and only if w 0 ≤ ( p − 1 ) K w_0\le(p-1)K w 0 ≤ ( p − 1 ) K and the p p p -state ( K , w 0 ) (K,w_0) ( K , w 0 ) is successful.
A p p p -state ( K , 0 ) (K,0) ( K , 0 ) is successful. Let ( K , w ) (K,w) ( K , w ) be a p p p -state with w ≥ 1 w\ge1 w ≥ 1 , so K ≥ 1 K\ge1 K ≥ 1 ; let s s s be the least integer σ ≥ 1 \sigma\ge1 σ ≥ 1 with p σ w ≥ ( p − 1 ) ( K − σ ) + p p^\sigma w\ge(p-1)(K-\sigma)+p p σ w ≥ ( p − 1 ) ( K − σ ) + p , put i = K − s i=K-s i = K − s , u i = ( p − 1 ) i + p u_i=(p-1)i+p u i = ( p − 1 ) i + p , d = ⌊ p s w / u i ⌋ d=\lfloor p^s w/u_i\rfloor d = ⌊ p s w / u i ⌋ and w ′ = p s w − d u i w'=p^s w-du_i w ′ = p s w − d u i . Then 1 ≤ s ≤ K 1\le s\le K 1 ≤ s ≤ K , and ( K , w ) (K,w) ( K , w ) is successful if and only if d ≤ p − 1 d\le p-1 d ≤ p − 1 , w ′ ≤ ( p − 1 ) i w'\le(p-1)i w ′ ≤ ( p − 1 ) i , and the p p p -state ( i , w ′ ) (i,w') ( i , w ′ ) is successful.
Proof. (1) By Theorem 9.3 , a ∈ A p a\in\mathcal{A}_p a ∈ A p if and only if p a + 1 = d t K + R p^{a+1}=d t_K+R p a + 1 = d t K + R with R ∈ E K ( p ) R\in\mathcal{E}^{(p)}_K R ∈ E K ( p ) , where d = ⌊ p a + 1 / t K ⌋ d=\lfloor p^{a+1}/t_K\rfloor d = ⌊ p a + 1 / t K ⌋ ; here R = p K ( p g − d u ) = p K w 0 R=p^K(p^g-du)=p^K w_0 R = p K ( p g − d u ) = p K w 0 , and R ≤ max E K ( p ) = ( p − 1 ) K p K R\le\max\mathcal{E}^{(p)}_K=(p-1)Kp^K R ≤ max E K ( p ) = ( p − 1 ) K p K means w 0 ≤ ( p − 1 ) K w_0\le(p-1)K w 0 ≤ ( p − 1 ) K .
(2) Let V = p K w ≥ 1 V=p^K w\ge1 V = p K w ≥ 1 . For $0\le i'<K$, t i ′ ≤ V t_{i'}\le V t i ′ ≤ V is equivalent to ( p − 1 ) i ′ + p ≤ p K − i ′ w (p-1)i'+p\le p^{K-i'}w ( p − 1 ) i ′ + p ≤ p K − i ′ w , so i = K − s i=K-s i = K − s is the largest index below $K with t i ≤ V t_i\le V t i ≤ V ; s ≤ K s\le K s ≤ K because p K w ≥ p p^Kw\ge p p K w ≥ p . By Theorem 9.3 (2), a representation of V V V in E K ( p ) \mathcal{E}^{(p)}_K E K ( p ) has largest index i i i and digit ⌊ V / t i ⌋ = d \lfloor V/t_i\rfloor=d ⌊ V / t i ⌋ = d ; indeed its largest index m m m satisfies t m ≤ V t_m\le V t m ≤ V , so m ≤ i m\le i m ≤ i , and m < i m<i m < i is impossible because V ≤ ∑ i ′ < m ( p − 1 ) t i ′ < t m ≤ V V\le\sum_{i'<m}(p-1)t_{i'}<t_m\le V V ≤ ∑ i ′ < m ( p − 1 ) t i ′ < t m ≤ V . Hence V ∈ E K ( p ) V\in\mathcal{E}^{(p)}_K V ∈ E K ( p ) if and only if d ≤ p − 1 d\le p-1 d ≤ p − 1 and V − d t i = p i w ′ ∈ E i ( p ) V-dt_i=p^i w'\in\mathcal{E}^{(p)}_i V − d t i = p i w ′ ∈ E i ( p ) ; the latter requires p i w ′ ≤ ( p − 1 ) i p i p^i w'\le(p-1)ip^i p i w ′ ≤ ( p − 1 ) i p i , that is w ′ ≤ ( p − 1 ) i w'\le(p-1)i w ′ ≤ ( p − 1 ) i .
Since s ≥ 1 s\ge1 s ≥ 1 , the index decreases at each step, so the recursion ends after at most K K K steps; by the minimality of s s s , p s − 1 w < ( p − 1 ) ( i + 1 ) + p p^{s-1}w<(p-1)(i+1)+p p s − 1 w < ( p − 1 ) ( i + 1 ) + p , so all the integers involved are O ( p K ) O(pK) O ( p K ) . For an odd prime, the condition w 0 ≤ ( p − 1 ) K w_0\le(p-1)K w 0 ≤ ( p − 1 ) K in part (1) can fail, which never happens for p = 2 p=2 p = 2 ; this gives a family of non-members with no analogue for p = 2 p=2 p = 2 .
Theorem 9.5. Let p p p be a prime.
For every g ≥ 1 g\ge1 g ≥ 1 , K = ( p g − p ) / ( p − 1 ) K=(p^g-p)/(p-1) K = ( p g − p ) / ( p − 1 ) satisfies c p ( p K ) = p K + g − 1 c_p(p^K)=p^{K+g-1} c p ( p K ) = p K + g − 1 ; thus K + g − 1 ∈ A p K+g-1\in\mathcal{A}_p K + g − 1 ∈ A p .
If p p p is odd, then c p ( p m − 1 ) c_p(p^m-1) c p ( p m − 1 ) is not a power of p p p for any m ≥ 1 m\ge1 m ≥ 1 .
If p p p is odd and g ≥ 2 g\ge2 g ≥ 2 is even, then K = ( p g − 2 p + 1 ) / ( 2 ( p − 1 ) ) K=(p^g-2p+1)/(2(p-1)) K = ( p g − 2 p + 1 ) / ( 2 ( p − 1 )) is a nonnegative integer with candidate exponent K + g − 1 K+g-1 K + g − 1 , and K + g − 1 ∉ A p K+g-1\notin\mathcal{A}_p K + g − 1 ∈ / A p .
Consequently, for every odd prime p p p , A p ( x ) ≥ log p x − O ( 1 ) A_p(x)\ge\log_p x-O(1) A p ( x ) ≥ log p x − O ( 1 ) and B p ( x ) ≥ 3 2 log p x − O ( 1 ) B_p(x)\ge\frac{3}{2}\log_p x-O(1) B p ( x ) ≥ 2 3 log p x − O ( 1 ) .
Proof. (1) ( p − 1 ) K + p = p g (p-1)K+p=p^g ( p − 1 ) K + p = p g , so c p ( p K ) = p K − 1 p g c_p(p^K)=p^{K-1}p^g c p ( p K ) = p K − 1 p g by Lemma 9.2 (2). (2) c p ( p m − 1 ) = m ( p − 1 ) p m − 1 c_p(p^m-1)=m(p-1)p^{m-1} c p ( p m − 1 ) = m ( p − 1 ) p m − 1 , and m ( p − 1 ) m(p-1) m ( p − 1 ) is not a power of p p p because p − 1 ≥ 2 p-1\ge2 p − 1 ≥ 2 divides it and is prime to p p p . (3) Since p 2 − 1 = ( p − 1 ) ( p + 1 ) p^2-1=(p-1)(p+1) p 2 − 1 = ( p − 1 ) ( p + 1 ) and p + 1 p+1 p + 1 is even, p 2 ≡ 1 ( m o d 2 ( p − 1 ) ) p^2\equiv1\pmod{2(p-1)} p 2 ≡ 1 ( mod 2 ( p − 1 )) , so p g ≡ 1 p^g\equiv1 p g ≡ 1 and p g − 2 p + 1 ≡ 2 − 2 p ≡ 0 ( m o d 2 ( p − 1 ) ) p^g-2p+1\equiv2-2p\equiv0\pmod{2(p-1)} p g − 2 p + 1 ≡ 2 − 2 p ≡ 0 ( mod 2 ( p − 1 )) ; and p g ≥ p 2 > 2 p − 1 p^g\ge p^2>2p-1 p g ≥ p 2 > 2 p − 1 , so K ≥ 0 K\ge0 K ≥ 0 . Put u = ( p − 1 ) K + p = ( p g + 1 ) / 2 u=(p-1)K+p=(p^g+1)/2 u = ( p − 1 ) K + p = ( p g + 1 ) /2 . Then u = ( p − 1 ) ( K + 1 ) + 1 ≤ p g u=(p-1)(K+1)+1\le p^g u = ( p − 1 ) ( K + 1 ) + 1 ≤ p g and p g ≤ p ( u − 1 ) = p ( p g − 1 ) / 2 p^g\le p(u-1)=p(p^g-1)/2 p g ≤ p ( u − 1 ) = p ( p g − 1 ) /2 because p ≥ 3 p\ge3 p ≥ 3 , so g ( K ) = g g(K)=g g ( K ) = g by the proof of Theorem 9.3 (3), and K + g − 1 K+g-1 K + g − 1 has candidate K K K . Moreover d = ⌊ p g / u ⌋ = ⌊ 2 p g / ( p g + 1 ) ⌋ = 1 d=\lfloor p^g/u\rfloor=\lfloor2p^g/(p^g+1)\rfloor=1 d = ⌊ p g / u ⌋ = ⌊ 2 p g / ( p g + 1 )⌋ = 1 and w 0 = p g − u = u − 1 = ( p − 1 ) K + p − 1 > ( p − 1 ) K w_0=p^g-u=u-1=(p-1)K+p-1>(p-1)K w 0 = p g − u = u − 1 = ( p − 1 ) K + p − 1 > ( p − 1 ) K , so K + g − 1 ∉ A p K+g-1\notin\mathcal{A}_p K + g − 1 ∈ / A p by Theorem 9.4 (1).
For the counting statement, the exponents of (1), of (3) and of Theorem 9.3 (3) are at most p g / ( p − 1 ) + g p^g/(p-1)+g p g / ( p − 1 ) + g for the corresponding g g g , so those with g ≤ log p x − 1 g\le\log_p x-1 g ≤ log p x − 1 are at most x x x for large x x x ; there are log p x − O ( 1 ) \log_p x-O(1) log p x − O ( 1 ) values of g g g in (1) and in Theorem 9.3 (3), and 1 2 log p x − O ( 1 ) \frac{1}{2}\log_p x-O(1) 2 1 log p x − O ( 1 ) even values in (3). Members and non-members are distinct, the exponents of Theorem 9.3 (3) have no candidate, and distinct g g g give distinct K K K and hence, by Theorem 9.3 (3), distinct exponents.
For p = 3 p=3 p = 3 , Theorem 9.5 gives c 3 ( 27 ) = 81 c_3(27)=81 c 3 ( 27 ) = 81 , so 4 ∈ A 3 4\in\mathcal{A}_3 4 ∈ A 3 , and 2 ∉ A 3 2\notin\mathcal{A}_3 2 ∈ / A 3 ; Theorem 9.3 (3) gives 1 ∉ A 3 1\notin\mathcal{A}_3 1 ∈ / A 3 ; and c 3 ( 13 ) = c 3 ( 1 ) + c 3 ( 3 ) + c 3 ( 9 ) = 1 + 5 + 21 = 27 c_3(13)=c_3(1)+c_3(3)+c_3(9)=1+5+21=27 c 3 ( 13 ) = c 3 ( 1 ) + c 3 ( 3 ) + c 3 ( 9 ) = 1 + 5 + 21 = 27 , so 3 ∈ A 3 3\in\mathcal{A}_3 3 ∈ A 3 .
The exponents rejected by the condition w 0 ≤ ( p − 1 ) K w_0\le(p-1)K w 0 ≤ ( p − 1 ) K of Theorem 9.4 (1), which we call immediate failures , admit a complete description.
Theorem 9.6. Let a ≥ 0 a\ge0 a ≥ 0 have the candidate K K K , and put g = a + 1 − K g=a+1-K g = a + 1 − K and u = ( p − 1 ) K + p u=(p-1)K+p u = ( p − 1 ) K + p . Then a a a is an immediate failure if and only if u ∣ p g + j u\mid p^g+j u ∣ p g + j for some j ∈ { 1 , … , p − 1 } j\in\{1,\ldots,p-1\} j ∈ { 1 , … , p − 1 } ; in that case e = ( p g + j ) / u e=(p^g+j)/u e = ( p g + j ) / u satisfies 2 ≤ e ≤ p − 1 2\le e\le p-1 2 ≤ e ≤ p − 1 .
Consequently, there are no immediate failures for p = 2 p=2 p = 2 ; for p = 3 p=3 p = 3 the immediate failures are exactly the exponents of Theorem 9.5 (3); and for every prime p p p the immediate failures are the exponents K + g − 1 K+g-1 K + g − 1 obtained from the triples ( g , e , j ) (g,e,j) ( g , e , j ) with 2 ≤ e ≤ p − 1 2\le e\le p-1 2 ≤ e ≤ p − 1 , 1 ≤ j ≤ p − 1 1\le j\le p-1 1 ≤ j ≤ p − 1 , e ∣ p g + j e\mid p^g+j e ∣ p g + j , u = ( p g + j ) / e ≡ 1 ( m o d p − 1 ) u=(p^g+j)/e\equiv1\pmod{p-1} u = ( p g + j ) / e ≡ 1 ( mod p − 1 ) , u ≥ p u\ge p u ≥ p and u ≤ p g ≤ p ( u − 1 ) u\le p^g\le p(u-1) u ≤ p g ≤ p ( u − 1 ) , through K = ( u − p ) / ( p − 1 ) K=(u-p)/(p-1) K = ( u − p ) / ( p − 1 ) . In particular, there are at most ( p − 1 ) ( p − 2 ) (p-1)(p-2) ( p − 1 ) ( p − 2 ) immediate failures with a given g g g .
Proof. By the proof of Theorem 9.3 (3), u ≤ p g ≤ p ( u − 1 ) u\le p^g\le p(u-1) u ≤ p g ≤ p ( u − 1 ) , d = ⌊ p g / u ⌋ ∈ [ 1 , p − 1 ] d=\lfloor p^g/u\rfloor\in[1,p-1] d = ⌊ p g / u ⌋ ∈ [ 1 , p − 1 ] and 0 ≤ w 0 = p g − d u < u 0\le w_0=p^g-du<u 0 ≤ w 0 = p g − d u < u . Hence w 0 > ( p − 1 ) K = u − p w_0>(p-1)K=u-p w 0 > ( p − 1 ) K = u − p if and only if w 0 = u − j w_0=u-j w 0 = u − j with 1 ≤ j ≤ p − 1 1\le j\le p-1 1 ≤ j ≤ p − 1 , that is p g + j = ( d + 1 ) u p^g+j=(d+1)u p g + j = ( d + 1 ) u , which is u ∣ p g + j u\mid p^g+j u ∣ p g + j because 0 ≤ w 0 < u 0\le w_0<u 0 ≤ w 0 < u determines d d d . Then e = d + 1 ≥ 2 e=d+1\ge2 e = d + 1 ≥ 2 , and e ≤ p − 1 e\le p-1 e ≤ p − 1 because p g + j ≤ p ( u − 1 ) + p − 1 < p u p^g+j\le p(u-1)+p-1<pu p g + j ≤ p ( u − 1 ) + p − 1 < p u . For p = 2 p=2 p = 2 the range 2 ≤ e ≤ p − 1 2\le e\le p-1 2 ≤ e ≤ p − 1 is empty. Conversely, given a triple as in the statement, K = ( u − p ) / ( p − 1 ) K=(u-p)/(p-1) K = ( u − p ) / ( p − 1 ) is a nonnegative integer with ( p − 1 ) K + p = u (p-1)K+p=u ( p − 1 ) K + p = u , the inequalities u ≤ p g ≤ p ( u − 1 ) u\le p^g\le p(u-1) u ≤ p g ≤ p ( u − 1 ) say that g = g ( K ) g=g(K) g = g ( K ) , so K + g − 1 K+g-1 K + g − 1 has candidate K K K , and p g = e u − j p^g=eu-j p g = e u − j with 1 ≤ j ≤ p − 1 1\le j\le p-1 1 ≤ j ≤ p − 1 gives d = e − 1 d=e-1 d = e − 1 and w 0 = u − j > u − p w_0=u-j>u-p w 0 = u − j > u − p . For p = 3 p=3 p = 3 , e = 2 e=2 e = 2 and j ∈ { 1 , 2 } j\in\{1,2\} j ∈ { 1 , 2 } ; 3 g + j 3^g+j 3 g + j forces j = 1 j=1 j = 1 , and ( 3 g + 1 ) / 2 (3^g+1)/2 ( 3 g + 1 ) /2 is odd, that is u ≡ 1 ( m o d 2 ) u\equiv1\pmod2 u ≡ 1 ( mod 2 ) , exactly when 3 g ≡ 1 ( m o d 4 ) 3^g\equiv1\pmod4 3 g ≡ 1 ( mod 4 ) , that is g g g is even; this is Theorem 9.5 (3). For given g g g , each pair ( e , j ) (e,j) ( e , j ) gives at most one u u u , hence at most one exponent.
The sets of successful p p p -states satisfy the analogues of Proposition 8.2 and Theorem 8.6 . For K ≥ 0 K\ge0 K ≥ 0 let S K ( p ) S_K^{(p)} S K ( p ) be the set of w w w such that ( K , w ) (K,w) ( K , w ) is a successful p p p -state, and N p ( K ) = ∣ S K ( p ) ∣ N_p(K)=|S_K^{(p)}| N p ( K ) = ∣ S K ( p ) ∣ ; let u K = ( p − 1 ) K + p u_K=(p-1)K+p u K = ( p − 1 ) K + p .
Theorem 9.7. 1. S 0 ( p ) = { 0 } S_0^{(p)}=\{0\} S 0 ( p ) = { 0 } , and for every K ≥ 0 K\ge0 K ≥ 0 , S K + 1 ( p ) = { ( w + d u K ) / p : w ∈ S K ( p ) , 0 ≤ d ≤ p − 1 , p ∣ w + d u K } S_{K+1}^{(p)}=\{(w+du_K)/p:w\in S_K^{(p)},\ 0\le d\le p-1,\ p\mid w+du_K\} S K + 1 ( p ) = {( w + d u K ) / p : w ∈ S K ( p ) , 0 ≤ d ≤ p − 1 , p ∣ w + d u K } , the elements obtained from distinct pairs ( w , d ) (w,d) ( w , d ) being distinct.
If p ∤ K p\nmid K p ∤ K , then for each w ∈ S K ( p ) w\in S_K^{(p)} w ∈ S K ( p ) exactly one d ∈ { 0 , … , p − 1 } d\in\{0,\ldots,p-1\} d ∈ { 0 , … , p − 1 } satisfies p ∣ w + d u K p\mid w+du_K p ∣ w + d u K , and N p ( K + 1 ) = N p ( K ) N_p(K+1)=N_p(K) N p ( K + 1 ) = N p ( K ) .
If p ∣ K p\mid K p ∣ K , then S K + 1 ( p ) = ⋃ d = 0 p − 1 ( B + d u K / p ) S_{K+1}^{(p)}=\bigcup_{d=0}^{p-1}(B+du_K/p) S K + 1 ( p ) = ⋃ d = 0 p − 1 ( B + d u K / p ) with B = { w / p : w ∈ S K ( p ) , p ∣ w } B=\{w/p:w\in S_K^{(p)},\ p\mid w\} B = { w / p : w ∈ S K ( p ) , p ∣ w } , the p p p sets being disjoint; thus N p ( K + 1 ) = p # { w ∈ S K ( p ) : p ∣ w } N_p(K+1)=p\#\{w\in S_K^{(p)}:p\mid w\} N p ( K + 1 ) = p # { w ∈ S K ( p ) : p ∣ w } .
For every K ≥ 0 K\ge0 K ≥ 0 , w ∈ S K ( p ) w\in S_K^{(p)} w ∈ S K ( p ) if and only if ( p − 1 ) K − w ∈ S K ( p ) (p-1)K-w\in S_K^{(p)} ( p − 1 ) K − w ∈ S K ( p ) .
An exponent a a a with candidate K K K belongs to A p \mathcal{A}_p A p if and only if w 0 ≤ ( p − 1 ) K w_0\le(p-1)K w 0 ≤ ( p − 1 ) K and w 0 ∈ S K ( p ) w_0\in S_K^{(p)} w 0 ∈ S K ( p ) , with w 0 w_0 w 0 as in Theorem 9.4 (1).
Proof. (1) E 0 ( p ) = { 0 } \mathcal{E}_0^{(p)}=\{0\} E 0 ( p ) = { 0 } gives S 0 ( p ) = { 0 } S_0^{(p)}=\{0\} S 0 ( p ) = { 0 } . By Theorem 9.3 (2), p K + 1 w ′ ∈ E K + 1 ( p ) p^{K+1}w'\in\mathcal{E}_{K+1}^{(p)} p K + 1 w ′ ∈ E K + 1 ( p ) if and only if p K + 1 w ′ = d t K + p K w p^{K+1}w'=d t_K+p^K w p K + 1 w ′ = d t K + p K w with 0 ≤ d ≤ p − 1 0\le d\le p-1 0 ≤ d ≤ p − 1 and p K w ∈ E K ( p ) p^K w\in\mathcal{E}_K^{(p)} p K w ∈ E K ( p ) ; since t K = p K u K t_K=p^K u_K t K = p K u K , this is p w ′ = w + d u K pw'=w+du_K p w ′ = w + d u K , and 0 ≤ w ≤ ( p − 1 ) K 0\le w\le(p-1)K 0 ≤ w ≤ ( p − 1 ) K holds for every element p K w p^K w p K w of E K ( p ) \mathcal{E}_K^{(p)} E K ( p ) . Distinct pairs ( w , d ) (w,d) ( w , d ) give distinct representations, hence distinct w ′ w' w ′ by Theorem 9.3 (2). (2) u K ≡ ( p − 1 ) K ≡ − K ( m o d p ) u_K\equiv(p-1)K\equiv-K\pmod p u K ≡ ( p − 1 ) K ≡ − K ( mod p ) is invertible modulo p p p when p ∤ K p\nmid K p ∤ K . (3) If p ∣ K p\mid K p ∣ K , then p ∣ u K p\mid u_K p ∣ u K , and p ∣ w + d u K p\mid w+du_K p ∣ w + d u K is p ∣ w p\mid w p ∣ w for all d d d ; the sets are disjoint because B ⊆ [ 0 , ( p − 1 ) K / p ] B\subseteq[0,(p-1)K/p] B ⊆ [ 0 , ( p − 1 ) K / p ] and u K / p = ( p − 1 ) K / p + 1 u_K/p=(p-1)K/p+1 u K / p = ( p − 1 ) K / p + 1 . (4) By Lemma 9.2 (2), ∑ i < K ( p − 1 ) t i = ( p − 1 ) K p K \sum_{i<K}(p-1)t_i=(p-1)Kp^K ∑ i < K ( p − 1 ) t i = ( p − 1 ) K p K ; replacing every digit d i d_i d i by p − 1 − d i p-1-d_i p − 1 − d i maps a representation of p K w p^K w p K w to one of p K ( ( p − 1 ) K − w ) p^K((p-1)K-w) p K (( p − 1 ) K − w ) . The last statement is Theorem 9.4 (1).
For p = 2 p = 2 p = 2 , Theorem 9.7 is Theorem 8.6 and Proposition 8.2 after the change of index of § 9 .
Experiments
All computations of this section were made by the script powers_of_two_c.py, which was written with Claude Opus 5.5 and run by the author with Python 3.12.3, with the parameters 2 20 2^{20} 2 20 for the range of the check of Lemma 2.1, 2 24 2^{24} 2 24 for the brute-force search, 4000 for the big-integer check, x ≤ 20000 x \le20000 x ≤ 20000 for the counting functions, h ≤ 300 h \le300 h ≤ 300 for the closed-form checks of the families, h ≤ 18 h \le18 h ≤ 18 for the runs of Algorithm 1 on the families, J ≤ 65536 J \le65536 J ≤ 65536 for the sets S J S_J S J computed with the recursion of Theorem 4.1 , and J ≤ 131072 J \le131072 J ≤ 131072 for the sets S J S_J S J computed with the recursion of Theorem 8.6 , with NumPy 2.4.6, a ≤ 3000 a \le3000 a ≤ 3000 for the recursion of Theorem 9.4 with the primes p = 3 , 5 , 7 , 11 p = 3, 5, 7, 11 p = 3 , 5 , 7 , 11 , a ≤ 100000 a \le100000 a ≤ 100000 for the immediate failures and K ≤ 10000 K \le10000 K ≤ 10000 for the recursion of Theorem 9.7 ; the whole run took 222.5 seconds. The script requires Python 3.12 and the Python package NumPy; the run reported here used Python 3.12.3 and NumPy 2.4.6. NumPy is used only for the sets S J S_J S J (§ 10.4 –§ 10.6 ); without it the script runs in pure Python with J ≤ 8192 J \le8192 J ≤ 8192 and J ≤ 16384 J \le16384 J ≤ 16384 for the two recursions. The script uses exact integer arithmetic only. It decides the membership of an exponent a a a in A \mathcal{A} A by three independent methods: a brute-force search computing c ( n ) c(n) c ( n ) from the definition (1) ; the greedy algorithm applied to the integers 2 a + 3 2^{a+3} 2 a + 3 and j 2 j j2^j j 2 j themselves; and Algorithm 1. The script performs 121 checks, and all of them passed.
Verification of the proved statements
The identity (4) holds for 1 ≤ n ≤ 2 20 1 \le n \le2^{20} 1 ≤ n ≤ 2 20 , the formula c ( 2 r ) = 2 r − 1 ( r + 2 ) c(2^r) = 2^{r-1}(r + 2) c ( 2 r ) = 2 r − 1 ( r + 2 ) holds for 0 ≤ r < 200 0 \le r < 200 0 ≤ r < 200 , and c ( 1 ) , … , c ( 16 ) c(1), \ldots, c(16) c ( 1 ) , … , c ( 16 ) agree with the table of § 7 of [1 ] . The brute-force search over 1 ≤ n ≤ 2 24 1 \le n \le2^{24} 1 ≤ n ≤ 2 24 reaches c ( 2 24 ) = 218103808 c(2^{24}) = 218103808 c ( 2 24 ) = 218103808 , so it decides the membership of every exponent 0 ≤ a ≤ 27 0 \le a \le27 0 ≤ a ≤ 27 . Table 1 lists the exponents found, with the integer n n n such that c ( n ) = 2 a c(n) = 2^a c ( n ) = 2 a . For all 0 ≤ a ≤ 27 0 \le a \le27 0 ≤ a ≤ 27 , the brute-force search, the big-integer greedy algorithm and Algorithm 1 return the same answer, and for the exponents in A \mathcal{A} A the integer n = ∑ j ∈ T 2 j − 2 n = \sum_{j \in T} 2^{j-2} n = ∑ j ∈ T 2 j − 2 of Corollary 4.2 equals the integer found by the search.
Table 1. The exponents 0 ≤ a ≤ 27 0 \le a \le27 0 ≤ a ≤ 27 with 2 a ∈ c ( N ) 2^a \in c(\mathbb{N}) 2 a ∈ c ( N ) , and the integer n n n with c ( n ) = 2 a c(n) = 2^a c ( n ) = 2 a , found by the brute-force search over n ≤ 2 24 n \le2^{24} n ≤ 2 24 . The other exponents a ≤ 27 a \le27 a ≤ 27 are 1, 4, 6, 7, 9, 18, 21, 23, 24, 26, 27.
For 0 ≤ a ≤ 4000 0 \le a \le4000 0 ≤ a ≤ 4000 , Algorithm 1 and the big-integer greedy algorithm return the same answer, the set T T T produced by Algorithm 1 is the set produced by the greedy algorithm, and for the exponents a ≤ 1500 a \le1500 a ≤ 1500 in A \mathcal{A} A , the integer n = ∑ j ∈ T 2 j − 2 n = \sum_{j \in T} 2^{j-2} n = ∑ j ∈ T 2 j − 2 of Corollary 4.2 satisfies c ( n ) = 2 a c(n) = 2^a c ( n ) = 2 a . The values 3 ≤ b ≤ 5000 3 \le b \le5000 3 ≤ b ≤ 5000 not taken by β \beta β are 4, 7, 12, 21, 38, 71, 136, 265, 522, 1035, 2060, 4109, that is 2 r + r + 1 2^r + r + 1 2 r + r + 1 for 1 ≤ r ≤ 12 1 \le r \le12 1 ≤ r ≤ 12 , as stated in Theorem 3.3 , and 0 ≤ 2 h − K ≤ K − 2 0 \le2^h - K \le K - 2 0 ≤ 2 h − K ≤ K − 2 holds for 2 ≤ K < 2 16 2 \le K < 2^{16} 2 ≤ K < 2 16 . For 0 ≤ a ≤ 20000 0 \le a \le20000 0 ≤ a ≤ 20000 , Algorithm 1 performs at most K − 2 K - 2 K − 2 iterations and handles integers at most 2 K 2K 2 K in its loop, as stated in Corollary 4.2; the largest number of iterations is 19781.
For Theorem 5.1 (2), the 295 pairs ( k , h ) (k,h) ( k , h ) with h ≤ 300 h \le300 h ≤ 300 give integers K K K with 2 h − 1 < K < 2 h 2^{h-1} < K < 2^h 2 h − 1 < K < 2 h , K − s ≥ 2 K - s \ge2 K − s ≥ 2 and K ( 2 s + 1 ) − s = 2 h + s K(2^s + 1) - s = 2^{h+s} K ( 2 s + 1 ) − s = 2 h + s , which is the identity used in the proof of (7) ; the equality (7) itself was evaluated with Lemma 2.1 for h ≤ 16 h \le16 h ≤ 16 . For Theorem 6.1 , the 310 pairs ( s , h ) (s,h) ( s , h ) with h ≤ 300 h \le300 h ≤ 300 give integers K K K with 2 h − 1 < K < 2 h 2^{h-1} < K < 2^h 2 h − 1 < K < 2 h , the least σ \sigma σ of Theorem 4.1 equals s s s , and 2 s − 1 w + s = J + 1 2^{s-1}w + s = J + 1 2 s − 1 w + s = J + 1 . Table 2 lists the pairs with h ≤ 18 h \le18 h ≤ 18 ; on each of them Algorithm 1 returns the answer of the theorem, a member for Theorem 5.1 and a failure at the first iteration of Theorem 6.1 , and the big-integer greedy algorithm agrees for a ≤ 4000 a \le4000 a ≤ 4000 . The exponents a + ( 2 a − 11 ) / 3 a + (2^a - 11)/3 a + ( 2 a − 11 ) /3 for odd 3 ≤ a ≤ 15 3 \le a \le15 3 ≤ a ≤ 15 are in A \mathcal{A} A , the exponents a + ( 2 a − 10 ) / 3 a + (2^a - 10)/3 a + ( 2 a − 10 ) /3 for even 4 ≤ a ≤ 14 4 \le a \le14 4 ≤ a ≤ 14 are not, and the exponents 2 r + r − 2 2^r + r - 2 2 r + r − 2 , 1 ≤ r < 40 1 \le r < 40 1 ≤ r < 40 , have no candidate K K K .
Table 2. The families of Theorems 5.1 (2) and 6.1 with h ≤ 18 h \le18 h ≤ 18 : the parameter s s s , the integer K K K and the exponent a = K + h − 3 a = K + h - 3 a = K + h − 3 .
The counting functions
Table 3 gives A ( x ) A(x) A ( x ) and B ( x ) B(x) B ( x ) for x = 1000 , 2000 , … , 20000 x = 1000, 2000, \ldots, 20000 x = 1000 , 2000 , … , 20000 , computed with Algorithm 1. The exponent a = 0 a = 0 a = 0 belongs to A \mathcal{A} A because c ( 1 ) = 1 = 2 0 c(1) = 1 = 2^0 c ( 1 ) = 1 = 2 0 , and the number A ( x ) − 1 A(x) - 1 A ( x ) − 1 of exponents 1 ≤ a ≤ x 1 \le a \le x 1 ≤ a ≤ x in A \mathcal{A} A coincides with the table of Nicolas [1 ] at the ten values x = 1000 , … , 10000 x = 1000, \ldots, 10000 x = 1000 , … , 10000 . In the range x ≤ 20000 x \le20000 x ≤ 20000 the ratio A ( x ) / x A(x)/x A ( x ) / x takes values between 0.5132, at x = 6000 x = 6000 x = 6000 , and 0.7418, at x = 20000 x = 20000 x = 20000 , and B ( x ) B(x) B ( x ) increases by 42 between x = 15000 x = 15000 x = 15000 and x = 20000 x = 20000 x = 20000 .
Table 3. The counting functions A ( x ) A(x) A ( x ) and B ( x ) B(x) B ( x ) of (2) , and the values of the table of Nicolas [1 ] , which count the exponents 1 ≤ a ≤ x 1 \le a \le x 1 ≤ a ≤ x .
Among the 5165 exponents 0 ≤ a ≤ 20000 0 \le a \le20000 0 ≤ a ≤ 20000 outside A \mathcal{A} A , 14 have no candidate K K K (the exponents 2 r + r − 2 2^r + r - 2 2 r + r − 2 , 1 ≤ r ≤ 14 1 \le r \le14 1 ≤ r ≤ 14 ), 11 are rejected by Algorithm 1 at its first iteration, and 5140 at a later iteration. The script checks that the 11 exponents rejected at the first iteration are exactly the 11 exponents a ≤ 20000 a \le20000 a ≤ 20000 given by Theorem 6.1, all listed in Table 2 : 6, 24, 90, 348, 1374, 5472 (s = 2 s = 2 s = 2 ), 233, 14575 (s = 4 s = 4 s = 4 ) and 7, 107, 1647 (s = 3 s = 3 s = 3 ). It also checks that the 14 exponents a ≤ 20000 a \le20000 a ≤ 20000 in A \mathcal{A} A decided without any iteration, 0, 3, 8, 17, 34, 67, 132, 261, 518, 1031, 2056, 4105, 8202, 16395, are exactly those of Theorem 5.1[1 ] , and that the 11 exponents a ≤ 20000 a \le20000 a ≤ 20000 in A \mathcal{A} A decided after exactly one iteration, 2, 12, 28, 46, 176, 416, 690, 971, 2740, 6564, 10934, are exactly those of Theorem 5.1[2 ] . These three checks confirm Theorem 6.2 for a ≤ 20000 a \le20000 a ≤ 20000 .
Table 4 gives the number of iterations of Algorithm 1 for the 19987 exponents 0 ≤ a ≤ 20000 0 \le a \le20000 0 ≤ a ≤ 20000 that have a candidate K K K . Among them, 14751 members and 5072 non-members require at least 10 iterations, that is 99.2% of them, and the largest number of iterations is 19781.
Table 4. Number of iterations of Algorithm 1 for the exponents 0 ≤ a ≤ 20000 0 \le a \le20000 0 ≤ a ≤ 20000 with a candidate K K K ; the last row counts the exponents with at least 10 iterations.
Table 5 gives, for each h ≤ 14 h \le14 h ≤ 14 , the number of candidates K ∈ ( 2 h − 1 , 2 h ] K \in(2^{h-1}, 2^h] K ∈ ( 2 h − 1 , 2 h ] , which is 2 h − 1 2^{h-1} 2 h − 1 , and the number of them for which β ( K ) − 3 ∈ A \beta(K) - 3 \in\mathcal{A} β ( K ) − 3 ∈ A . For 5 ≤ h ≤ 14 5 \le h \le14 5 ≤ h ≤ 14 the proportion takes values between 0.5000, at h = 6 h = 6 h = 6 , and 0.8198, at h = 14 h = 14 h = 14 .
Table 5. Candidates K ∈ ( 2 h − 1 , 2 h ] K \in(2^{h-1}, 2^h] K ∈ ( 2 h − 1 , 2 h ] and the number of them with β ( K ) − 3 ∈ A \beta(K) - 3 \in\mathcal{A} β ( K ) − 3 ∈ A .
The bounds of Theorem 7.1
Table 6 compares, for H = ⌊ log 2 x ⌋ − 1 H = \lfloor\log_2 x \rfloor- 1 H = ⌊ log 2 x ⌋ − 1 , the number of exponents produced by the families in the proof of Theorem 7.1 with the explicit lower bound 2 H − log 2 H − 3 2H - \log_2 H - 3 2 H − log 2 H − 3 for the members, and with A ( x ) A(x) A ( x ) and B ( x ) B(x) B ( x ) when x ≤ 20000 x \le20000 x ≤ 20000 . For every x x x of the table the family exponents are at most x x x , the member and non-member families are disjoint, the number of member exponents is at least 2 H − log 2 H − 3 2H - \log_2 H - 3 2 H − log 2 H − 3 , and for x ≤ 20000 x \le20000 x ≤ 20000 every member exponent is in A \mathcal{A} A and every non-member exponent is not. For x ≤ 10000 x \le10000 x ≤ 10000 the families account for at most 21 of the A ( x ) A(x) A ( x ) members and 21 of the B ( x ) B(x) B ( x ) non-members.
Table 6. Number of family exponents up to x x x (members of Theorem 5.1 , non-members of Theorems 3.3 and 6.1 ), the bound 2 H − log 2 H − 3 2H - \log_2 H - 3 2 H − log 2 H − 3 of the proof of Theorem 7.1 , and the exact A ( x ) A(x) A ( x ) and B ( x ) B(x) B ( x ) for x ≤ 10000 x \le10000 x ≤ 10000 .
The successful states
The script computes the sets S J S_J S J for all J ≤ 65536 J \le65536 J ≤ 65536 , row by row, from Theorem 4.1 : w ∈ S J w \in S_J w ∈ S J if and only if w = 0 w = 0 w = 0 , or the iteration from ( J , w ) (J,w) ( J , w ) does not fail and its result ( J − s , w ′ ) (J-s,w') ( J − s , w ′ ) satisfies w ′ ∈ S J − s w' \in S_{J-s} w ′ ∈ S J − s . The values of N ( J ) N(J) N ( J ) obtained in this way agree with Algorithm 1 for J < 200 J < 200 J < 200 and for ten random J J J in [ 200 , 1500 ] [200,1500] [ 200 , 1500 ] , and Algorithm 1 agrees with the big-integer greedy algorithm on all states with J < 120 J < 120 J < 120 . The symmetry of Proposition 8.2 holds for every J ≤ 65536 J \le65536 J ≤ 65536 . The values of N ( J ) N(J) N ( J ) printed by the script, for J ≤ 64 J \le64 J ≤ 64 and near each power of 2 up to 2 16 2^{16} 2 16 , satisfy Proposition 8.3 . Table 7 gives the extreme and mean values of N ( J ) / J N(J)/J N ( J ) / J on the dyadic ranges. The integers J ≤ 65536 J \le65536 J ≤ 65536 with N ( J ) = J N(J) = J N ( J ) = J , that is with every state successful, are 1, 2, 4, 12, 16, 17356, 17360, 17376, 17632.
Table 7. The minimum, maximum and mean of N ( J ) / J N(J)/J N ( J ) / J for 2 m ≤ J < 2 m + 1 2^m \le J < 2^{m+1} 2 m ≤ J < 2 m + 1 , 0 ≤ m ≤ 15 0 \le m \le15 0 ≤ m ≤ 15 , with the integers J J J where the minimum and maximum are attained.
By Proposition 8.1 (2), the sets S J S_J S J give the members of A \mathcal{A} A with candidate K ≤ 65537 K \le65537 K ≤ 65537 , hence A ( x ) A(x) A ( x ) for x ≤ 65551 = β ( 65537 ) − 3 x \le65551 = \beta(65537) - 3 x ≤ 65551 = β ( 65537 ) − 3 . The value A ( 20000 ) = 14836 A(20000) = 14836 A ( 20000 ) = 14836 obtained in this way agrees with § 10.2 . Table 8 gives, for h ≤ 16 h \le16 h ≤ 16 , the proportion of members among the candidates K ∈ ( 2 h − 1 , 2 h ] K \in(2^{h-1},2^h] K ∈ ( 2 h − 1 , 2 h ] and the mean of N ( K − 1 ) / ( K − 1 ) N(K-1)/(K-1) N ( K − 1 ) / ( K − 1 ) over the same K K K ; for 7 ≤ h ≤ 16 7 \le h \le16 7 ≤ h ≤ 16 the two numbers differ by at most 0.0171. Table 9 gives A ( x ) A(x) A ( x ) for x = 25000 , 30000 , … , 65000 x = 25000,30000,\ldots,65000 x = 25000 , 30000 , … , 65000 . For x = 1000 , 2000 , … , 65000 x = 1000,2000,\ldots,65000 x = 1000 , 2000 , … , 65000 , the ratio A ( x ) / x A(x)/x A ( x ) / x takes values between 0.5132, at x = 6000 x = 6000 x = 6000 , and 0.8654, at x = 62000 x = 62000 x = 62000 .
Table 8. Members among the candidates K ∈ ( 2 h − 1 , 2 h ] K \in(2^{h-1},2^h] K ∈ ( 2 h − 1 , 2 h ] , and the mean of N ( J ) / J N(J)/J N ( J ) / J over J = K − 1 J = K - 1 J = K − 1 for the same K K K .
Table 9. The counting function A ( x ) A(x) A ( x ) for 25000 ≤ x ≤ 65000 25000 \le x \le65000 25000 ≤ x ≤ 65000 , obtained from the sets S J S_J S J .
The forest of states
The script checks Theorem 8.4 as follows. The number F ( J ) F(J) F ( J ) of failing states obtained from the rows equals the number given by part (1) for every J ≤ 65536 J \le65536 J ≤ 65536 , and the largest value of F ( J ) F(J) F ( J ) in this range is 3. The sum ∑ J ≤ L F ( J ) \sum_{J \le L} F(J) ∑ J ≤ L F ( J ) equals ∑ σ = 2 L ⌊ ( L + 1 − σ ) / 2 σ − 1 ⌋ \sum_{\sigma=2}^{L} \lfloor(L+1-\sigma)/2^{\sigma-1} \rfloor ∑ σ = 2 L ⌊( L + 1 − σ ) / 2 σ − 1 ⌋ for L = 10 , 100 , 1000 , 10000 , 65536 L = 10, 100, 1000, 10000, 65536 L = 10 , 100 , 1000 , 10000 , 65536 , with the values 6, 94, 991, 9991, 65519. Every state ( J ′ , w ′ ) (J',w') ( J ′ , w ′ ) with J ′ ≤ 600 J' \le600 J ′ ≤ 600 has exactly v 2 ( J ′ + 1 + w ′ ) v_2(J' + 1 + w') v 2 ( J ′ + 1 + w ′ ) preimages under Φ \Phi Φ , counted by applying Φ \Phi Φ to all states of levels up to 613, and the recursion of part (3) for N ( J ) N(J) N ( J ) holds for J ≤ 1200 J \le1200 J ≤ 1200 .
The script labels every state by the root of its tree and counts, at the levels J = 2 m J = 2^m J = 2 m , 5 ≤ m ≤ 16 5 \le m \le16 5 ≤ m ≤ 16 , the number of distinct trees among the J J J states of the level and the shares of the largest trees (Table 10 ). At each of these levels the largest tree is the tree of the root ( 1 , 0 ) (1,0) ( 1 , 0 ) , and its share equals N ( J ) / ( 2 J ) N(J)/(2J) N ( J ) / ( 2 J ) , as stated by Proposition 8.5. At the level J = 65536 J = 65536 J = 65536 , the ten largest trees are those of the roots ( 1 , 0 ) (1,0) ( 1 , 0 ) , ( 47321 , 0 ) (47321,0) ( 47321 , 0 ) , ( 51081 , 0 ) (51081,0) ( 51081 , 0 ) , ( 47257 , 0 ) (47257,0) ( 47257 , 0 ) and ( 9631 , 0 ) (9631,0) ( 9631 , 0 ) , with 29090, 16376, 6838, 2810 and 1962 states, and those of the failing states of the levels 61364 (s = 5 s = 5 s = 5 ), 61361 (s = 2 s = 2 s = 2 ), 52582 (s = 3 s = 3 s = 3 ), 52581 (s = 2 s = 2 s = 2 ) and 56327 (s = 8 s = 8 s = 8 ), with 1614, 1614, 1578, 1578 and 386 states.
Table 10. The trees of the forest at the levels J = 2 m J = 2^m J = 2 m : the number of distinct trees among the J J J states of the level, the proportion N ( J ) / J N(J)/J N ( J ) / J of successful states, and the shares of the largest tree, which is the tree of ( 1 , 0 ) (1,0) ( 1 , 0 ) at every level, and of the 5 and 10 largest trees.
The bottom-up recursion
The script computes S J S_J S J for J ≤ 131072 J \le131072 J ≤ 131072 with Theorem 8.6 , in 27.5 seconds. The sets obtained coincide with those of § 10.4 for every J ≤ 3000 J \le3000 J ≤ 3000 ; the values of N ( J ) N(J) N ( J ) coincide for J ≤ 65536 J \le65536 J ≤ 65536 , and so does the membership of every initial state with K ≤ 65537 K \le65537 K ≤ 65537 . For every J ≤ 131072 J \le131072 J ≤ 131072 , S J S_J S J is symmetric, S J S_J S J has period J / 2 J/2 J /2 when J J J is even, N ( 2 k + 1 ) = N ( 2 k ) N(2k+1) = N(2k) N ( 2 k + 1 ) = N ( 2 k ) , and N ( J ) = N ( J − 1 ) N(J) = N(J-1) N ( J ) = N ( J − 1 ) when J J J is odd. For the block h = 17 h = 17 h = 17 , the proportion of members among the 65536 candidates is 56692/65536 = 0.8651, and the mean of N ( K − 1 ) / ( K − 1 ) N(K-1)/(K-1) N ( K − 1 ) / ( K − 1 ) over the block is 0.8652. On the range 2 16 ≤ J < 2 17 2^{16} \le J < 2^{17} 2 16 ≤ J < 2 17 , N ( J ) / J N(J)/J N ( J ) / J takes values between 0.6683, at J = 70695 J = 70695 J = 70695 , and 0.9996, at J = 95306 J = 95306 J = 95306 , with mean 0.8652. Table 11 gives A ( x ) A(x) A ( x ) for 70000 ≤ x ≤ 130000 70000 \le x \le130000 70000 ≤ x ≤ 130000 ; the value A ( 65000 ) = 56153 A(65000) = 56153 A ( 65000 ) = 56153 coincides with Table 9 . For x = 1000 , 2000 , … , 131000 x = 1000, 2000, \ldots, 131000 x = 1000 , 2000 , … , 131000 , the ratio A ( x ) / x A(x)/x A ( x ) / x takes values between 0.5132, at x = 6000 x = 6000 x = 6000 , and 0.8750, at x = 109000 x = 109000 x = 109000 .
Table 11. The counting function A ( x ) A(x) A ( x ) for 70000 ≤ x ≤ 130000 70000 \le x \le130000 70000 ≤ x ≤ 130000 , obtained from the recursion of Theorem 8.6 .
The families of Theorem 8.7
The formula c ( 2 2 r − 1 ) = 2 2 r + r − 1 c(2^{2^r}-1)=2^{2^r+r-1} c ( 2 2 r − 1 ) = 2 2 r + r − 1 holds for 0 ≤ r ≤ 12 0 \le r \le12 0 ≤ r ≤ 12 . For h ≤ 300 h \le300 h ≤ 300 , Theorem 8.7 (2) gives 282 pairs ( i , h ) (i,h) ( i , h ) and Theorem 8.7 (3) gives 222 pairs ( i , h ) (i,h) ( i , h ) ; for all of them w w w is an even positive integer and 2 h − 1 + 1 < K < 2 h 2^{h-1}+1<K<2^h 2 h − 1 + 1 < K < 2 h . Every exponent of parts (1) and (2) at most 131088 = β ( 131073 ) − 3 =\beta(131073)-3 = β ( 131073 ) − 3 is in A \mathcal{A} A , every exponent of part (3) in this range is not, according to the sets S J S_J S J of § 10.6 , and the big-integer greedy algorithm agrees for a ≤ 4000 a \le4000 a ≤ 4000 . Table 12 lists the exponents of parts (2) and (3) with h ≤ 17 h \le17 h ≤ 17 .
Table 12. The exponents a = K + h − 3 a=K+h-3 a = K + h − 3 of Theorem 8.7 (2) (members) and (3) (non-members) with h ≤ 17 h \le17 h ≤ 17 , with σ = 2 i − 1 + 1 \sigma=2^{i-1}+1 σ = 2 i − 1 + 1 .
Table 13 gives the number of exponents up to x x x produced by all the families of Theorems 3.3 , 5.1 , 6.1 and 8.7 , with H = ⌊ log 2 x ⌋ − 1 H=\lfloor\log_2 x\rfloor-1 H = ⌊ log 2 x ⌋ − 1 , together with ( 3 + C 1 ) H (3+C_1)H ( 3 + C 1 ) H , ( 5 4 + E 2 + C 2 ) H (\frac{5}{4}+\frac{E}{2}+C_2)H ( 4 5 + 2 E + C 2 ) H and, for x ≤ 100000 x\le100000 x ≤ 100000 , the exact values of A ( x ) A(x) A ( x ) and B ( x ) B(x) B ( x ) . For every x x x of the table, the member and non-member exponents are at most x x x and disjoint, and for x ≤ 100000 x\le100000 x ≤ 100000 every member exponent is in A \mathcal{A} A and every non-member exponent is not.
Table 13. Exponents up to x x x produced by all the explicit families, compared with ( 3 + C 1 ) H (3+C_1)H ( 3 + C 1 ) H and ( 5 4 + E 2 + C 2 ) H (\frac{5}{4}+\frac{E}{2}+C_2)H ( 4 5 + 2 E + C 2 ) H of Theorem 8.8 , and with A ( x ) A(x) A ( x ) and B ( x ) B(x) B ( x ) .
Odd primes
For p = 3 , 5 , 7 , 11 p = 3, 5, 7, 11 p = 3 , 5 , 7 , 11 the script checks Lemma 9.2 (3) for n ≤ 50000 n \le50000 n ≤ 50000 and Lemma 9.2 (1) for p n ≤ 200000 pn \le200000 p n ≤ 200000 against the definition of c p c_p c p , and Proposition 9.1 for n ≤ 30 n \le30 n ≤ 30 by computing the product ( 1 − X ) ⋯ ( 1 − X n ) (1-X)\cdots(1-X^n) ( 1 − X ) ⋯ ( 1 − X n ) in F p [ X ] \mathbb{F}_p[X] F p [ X ] and dividing it by 1 − X 1-X 1 − X as long as possible. A brute-force search over n ≤ 200000 n \le200000 n ≤ 200000 decides the membership of the exponents a ≤ 13 , 8 , 7 , 5 a \le13, 8, 7, 5 a ≤ 13 , 8 , 7 , 5 for p = 3 , 5 , 7 , 11 p = 3, 5, 7, 11 p = 3 , 5 , 7 , 11 ; the members found are 0 , 3 , 4 , 6 , 7 , 8 , 9 , 10 , 13 0, 3, 4, 6, 7, 8, 9, 10, 13 0 , 3 , 4 , 6 , 7 , 8 , 9 , 10 , 13 for p = 3 p = 3 p = 3 (with c 3 ( n ) = 3 a c_3(n)=3^a c 3 ( n ) = 3 a for n = 1 , 13 , 27 , 215 , 513 , 1457 , 3645 , 9841 , 196829 n = 1, 13, 27, 215, 513, 1457, 3645, 9841, 196829 n = 1 , 13 , 27 , 215 , 513 , 1457 , 3645 , 9841 , 196829 ), 0 , 5 , 6 , 8 0, 5, 6, 8 0 , 5 , 6 , 8 for p = 5 p = 5 p = 5 , 0 , 7 0, 7 0 , 7 for p = 7 p = 7 p = 7 and 0 0 0 for p = 11 p = 11 p = 11 . In these ranges the recursion of Theorem 9.4 and the greedy algorithm applied to the big integers p a + 1 p^{a+1} p a + 1 and t i t_i t i agree with the search, and they agree with each other for a ≤ 1200 a \le1200 a ≤ 1200 . The exponents a ≤ 20000 a \le20000 a ≤ 20000 without candidate are exactly those of Theorem 9.3 (3): 1 , 5 , 15 , 43 , 125 , 369 , 1099 , 3287 , 9849 1, 5, 15, 43, 125, 369, 1099, 3287, 9849 1 , 5 , 15 , 43 , 125 , 369 , 1099 , 3287 , 9849 for p = 3 p = 3 p = 3 , 1 , 7 , 33 , 159 , 785 , 3911 , 19537 1, 7, 33, 159, 785, 3911, 19537 1 , 7 , 33 , 159 , 785 , 3911 , 19537 for p = 5 p = 5 p = 5 , 1 , 9 , 59 , 403 , 2805 , 19613 1, 9, 59, 403, 2805, 19613 1 , 9 , 59 , 403 , 2805 , 19613 for p = 7 p = 7 p = 7 and 1 , 13 , 135 , 1467 , 16109 1, 13, 135, 1467, 16109 1 , 13 , 135 , 1467 , 16109 for p = 11 p = 11 p = 11 . The three parts of Theorem 9.5 are confirmed; part (3) gives the exponents 2 , 22 , 186 , 1646 , 14770 , 132870 2, 22, 186, 1646, 14770, 132870 2 , 22 , 186 , 1646 , 14770 , 132870 for p = 3 p = 3 p = 3 , 3 , 80 , 1957 3, 80, 1957 3 , 80 , 1957 for p = 5 p = 5 p = 5 , 4 , 202 , 9808 4, 202, 9808 4 , 202 , 9808 for p = 7 p = 7 p = 7 and 6 , 734 , 88582 6, 734, 88582 6 , 734 , 88582 for p = 11 p = 11 p = 11 . Table 14 gives A p ( x ) A_p(x) A p ( x ) for x ≤ 3000 x \le3000 x ≤ 3000 and the outcomes of the recursion for a ≤ 3000 a \le3000 a ≤ 3000 .
Table 14. The counting functions A p ( x ) A_p(x) A p ( x ) for p = 3 , 5 , 7 , 11 p = 3, 5, 7, 11 p = 3 , 5 , 7 , 11 , and the outcomes of the recursion of Theorem 9.4 for 0 ≤ a ≤ 3000 0 \le a \le3000 0 ≤ a ≤ 3000 : no candidate, immediate failure, a digit d > p − 1 d > p - 1 d > p − 1 , a remainder w ′ > ( p − 1 ) i w' > (p - 1)i w ′ > ( p − 1 ) i , and success.
For p = 3 p = 3 p = 3 the 4 immediate failures up to 3000 are the exponents 2, 22, 186, 1646 of Theorem 9.5 (3), as Theorem 9.6 states. Grouping the candidates by g g g , the proportion of members is 0.6667, 0.7778, 0.7037, 0.8395, 0.6626, 0.7586 for g = 2 , … , 7 g = 2, \ldots, 7 g = 2 , … , 7 when p = 3 p = 3 p = 3 ; 0.4000, 0.6400, 0.5200, 0.3952 for g = 2 , … , 5 g = 2, \ldots, 5 g = 2 , … , 5 when p = 5 p = 5 p = 5 ; 0.2857, 0.6735, 0.4052, 0.6318 for g = 2 , … , 5 g = 2, \ldots, 5 g = 2 , … , 5 when p = 7 p = 7 p = 7 ; and 0.1818, 0.6198, 0.3681 for g = 2 , 3 , 4 g = 2, 3, 4 g = 2 , 3 , 4 when p = 11 p = 11 p = 11 .
Immediate failures and the bottom-up recursion for odd primes
For a ≤ 100000 a \le100000 a ≤ 100000 , the script determines the immediate failures from the first step of Theorem 9.4 and compares them with the exponents given by the triples ( g , e , j ) (g, e, j) ( g , e , j ) of Theorem 9.6 . For p = 2 p = 2 p = 2 there is none. For p = 3 , 5 , 7 , 11 p = 3, 5, 7, 11 p = 3 , 5 , 7 , 11 the two sets coincide; they are listed in Table 15 . For p = 3 p = 3 p = 3 they are the exponents of Theorem 9.5 (3), and for every p p p and g g g their number is at most ( p − 1 ) ( p − 2 ) (p - 1)(p - 2) ( p − 1 ) ( p − 2 ) ; the largest number for a single g g g is 1, 3, 4, 6 for p = 3 , 5 , 7 , 11 p = 3, 5, 7, 11 p = 3 , 5 , 7 , 11 .
Table 15. The immediate failures a ≤ 100000 a \le100000 a ≤ 100000 (Theorem 9.6 ).
The script computes the sets S K ( p ) S_K^{(p)} S K ( p ) for K ≤ 10000 K \le10000 K ≤ 10000 with Theorem 9.7 , in less than 3 seconds for each prime. For every K ≤ 10000 K \le10000 K ≤ 10000 and p = 3 , 5 , 7 , 11 p = 3, 5, 7, 11 p = 3 , 5 , 7 , 11 , S K ( p ) S_K^{(p)} S K ( p ) is symmetric under w ↦ ( p − 1 ) K − w w \mapsto(p-1)K-w w ↦ ( p − 1 ) K − w , N p ( K + 1 ) = N p ( K ) N_p(K+1)=N_p(K) N p ( K + 1 ) = N p ( K ) when p ∤ K p \nmid K p ∤ K , and N p ( K + 1 ) = p # { w ∈ S K ( p ) : p ∣ w } N_p(K+1)=p\#\{w\in S_K^{(p)}:p\mid w\} N p ( K + 1 ) = p # { w ∈ S K ( p ) : p ∣ w } when p ∣ K p\mid K p ∣ K ; the members obtained from these sets coincide with those of Theorem 9.4 for a ≤ 1500 a \le1500 a ≤ 1500 . Table 16 gives A p ( x ) A_p(x) A p ( x ) for x ≤ 10000 x \le10000 x ≤ 10000 . Table 17 groups the candidates K K K by g = g ( K ) g=g(K) g = g ( K ) and compares the proportion of members with the mean of N p ( K ) / ( ( p − 1 ) K + 1 ) N_p(K)/((p-1)K+1) N p ( K ) / (( p − 1 ) K + 1 ) , the proportion of successful states, over the same K K K . For every complete group with at least 2000 candidates, namely g = 8 , 9 g=8,9 g = 8 , 9 for p = 3 p=3 p = 3 , g = 6 g=6 g = 6 for p = 5 p=5 p = 5 and g = 5 g=5 g = 5 for p = 7 p=7 p = 7 , the two numbers differ by at most 0.0110.
Table 16. The counting functions A p ( x ) A_p(x) A p ( x ) for x ≤ 10000 x \le10000 x ≤ 10000 , obtained from Theorem 9.7 .
Table 17. Candidates K K K grouped by g = g ( K ) g=g(K) g = g ( K ) : number of candidates, proportion of members, and mean of N p ( K ) / ( ( p − 1 ) K + 1 ) N_p(K)/((p-1)K+1) N p ( K ) / (( p − 1 ) K + 1 ) over the group (complete groups only).
For x = 1000 , 2000 , … , 10000 x=1000,2000,\ldots,10000 x = 1000 , 2000 , … , 10000 , the ratio A p ( x ) / x A_p(x)/x A p ( x ) / x takes values between 0.6518 and 0.7773 for p = 3 p=3 p = 3 , between 0.3970 and 0.6132 for p = 5 p=5 p = 5 , between 0.5560 and 0.6244 for p = 7 p=7 p = 7 , and between 0.3970 and 0.4486 for p = 11 p=11 p = 11 .
Conclusion
The identity c ( n ) = n + 1 2 ∑ i ∈ B ( n ) 2 i c(n)=n+\frac{1}{2}\sum_{i\in B(n)}2^i c ( n ) = n + 2 1 ∑ i ∈ B ( n ) 2 i turns the question of Nicolas into the question of which powers of 2 are sums of distinct terms of the superincreasing sequence ( j 2 j ) j ≥ 1 (j2^j)_{j\ge1} ( j 2 j ) j ≥ 1 (Theorem 2.2 ). For every exponent there is at most one possible leading term, and the exponents without one are exactly $2^r+r-2$ (Theorem 3.3 ); the remaining exponents are decided by a recursion on pairs of integers bounded by a + 3 a+3 a + 3 (Theorem 4.1 , Corollary 4.2). The closed formula c ( 2 K − 2 + 2 K − s − 2 ) = 2 K + h − 3 c(2^{K-2}+2^{K-s-2})=2^{K+h-3} c ( 2 K − 2 + 2 K − s − 2 ) = 2 K + h − 3 and the failure criterion of Theorem 4.1 give infinite explicit families of members and of non-members, which contain the families of Nicolas as the cases s = 1 s=1 s = 1 and s = 2 s=2 s = 2 (Theorems 5.1 and 6.1 ) and are exactly the exponents decided by at most one iteration of the recursion (Theorem 6.2 ), and they give the bounds A ( x ) ≥ ( 2 + o ( 1 ) ) log 2 x A(x)\ge(2+o(1))\log_2x A ( x ) ≥ ( 2 + o ( 1 )) log 2 x and B ( x ) ≥ ( 2.0533 … + o ( 1 ) ) log 2 x B(x)\ge(2.0533\ldots+o(1))\log_2x B ( x ) ≥ ( 2.0533 … + o ( 1 )) log 2 x (Theorem 7.1 ). The experiments of § 10 confirm these statements by three independent methods, reproduce the table of Nicolas, whose values are the numbers A ( x ) − 1 A(x)-1 A ( x ) − 1 of exponents 1 ≤ a ≤ x 1\le a\le x 1 ≤ a ≤ x in A \mathcal{A} A , and give A ( x ) A(x) A ( x ) for x ≤ 65000 x\le65000 x ≤ 65000 , with A ( x ) / x A(x)/x A ( x ) / x between 0.5132 and 0.8654 for x = 1000 , 2000 , … , 65000 x=1000,2000,\ldots,65000 x = 1000 , 2000 , … , 65000 . The successful states satisfy the symmetry w ↦ J − 1 − w w\mapsto J-1-w w ↦ J − 1 − w , N ( 2 k + 1 ) = N ( 2 k ) N(2k+1)=N(2k) N ( 2 k + 1 ) = N ( 2 k ) and 4 ∣ N ( J ) 4\mid N(J) 4 ∣ N ( J ) (Propositions 8.2 and 8.3 ), and for 7 ≤ h ≤ 16 7\le h\le16 7 ≤ h ≤ 16 the proportion of members among the candidates K ∈ ( 2 h − 1 , 2 h ] K\in(2^{h-1},2^h] K ∈ ( 2 h − 1 , 2 h ] differs from the mean of N ( K − 1 ) / ( K − 1 ) N(K-1)/(K-1) N ( K − 1 ) / ( K − 1 ) by at most 0.0171. The states form a forest whose roots are the states ( J , 0 ) (J,0) ( J , 0 ) and the failing states, with ν 2 ( J ′ + 1 + w ′ ) \nu_2(J'+1+w') ν 2 ( J ′ + 1 + w ′ ) children at each state ( J ′ , w ′ ) (J',w') ( J ′ , w ′ ) (Theorem 8.4 ); exactly half of the successful states of each level lie in the tree of ( 1 , 0 ) (1,0) ( 1 , 0 ) (Proposition 8.5), and at the levels 2 m ≤ 65536 2^m\le65536 2 m ≤ 65536 the ten largest trees contain between 89.31% and 100% of the states of the level. The sets S J S_J S J also satisfy a recursion from the smallest elements of $T upwards, with period J / 2 J/2 J /2 for even J J J (Theorem 8.6 ); with this recursion A ( x ) A(x) A ( x ) is computed for x ≤ 131000 x \le131000 x ≤ 131000 , and A ( x ) / x A(x)/x A ( x ) / x lies between 0.5132 and 0.8750 for $x = 1000, 2000, \ldots, 131000. The symmetry gives further explicit families and the bounds A ( x ) ≥ ( 3.9655 … + o ( 1 ) ) log 2 x A(x) \ge(3.9655 \ldots+ o(1))\log_2 x A ( x ) ≥ ( 3.9655 … + o ( 1 )) log 2 x and B ( x ) ≥ ( 2.8178 … + o ( 1 ) ) log 2 x B(x) \ge(2.8178 \ldots+ o(1))\log_2 x B ( x ) ≥ ( 2.8178 … + o ( 1 )) log 2 x (Theorems 8.7 and 8.8 ). For every prime p p p , the function c p ( n ) = ∑ k ≤ n p v p ( k ) c_p(n) = \sum_{k \le n} p^{v_p(k)} c p ( n ) = ∑ k ≤ n p v p ( k ) , which counts the factor $1-X$ in ( 1 − X ) ⋯ ( 1 − X n ) (1-X)\cdots(1-X^n) ( 1 − X ) ⋯ ( 1 − X n ) over F p [ X ] \mathbb{F}_p[X] F p [ X ] , admits the same reduction, a unique candidate and a recursion, and for odd p p p there are infinitely many members and non-members (Theorems 9.3 , 9.4 and 9.5 ); the immediate failures, which do not occur for p = 2 p=2 p = 2 , are described completely, and the bottom-up recursion and the symmetry extend to every prime (Theorems 9.6 and 9.7 ). The asymptotic behaviour of A ( x ) A(x) A ( x ) asked for in [1 ] is not determined by these results.
Declaration of interests
The author declares no competing interests.
Funding sources
This research did not receive any specific grant from funding agencies in the public, commercial, or not-for-profit sectors.
Declaration of generative AI in scientific writing
The author used Claude Opus 5.5 to assist in deriving the proofs, to write the experiment script powers_of_two_c.py, and in preparing this manuscript; the author ran the experiments. After using this tool, the author reviewed and edited the content as needed and takes full responsibility for the content of the publication.
Data availability
The experiments of § 10 are reproduced by running the script powers_of_two_c.py with the options -xmax 20000 -jmax2 131072 -pxmax 3000 -primes 3,5,7,11 -kmax 10000, using Python 3.12.3 and NumPy 2.4.6.