Skip to main content
12 of 13
text again brushed and bugs corrected
Gottfried Helms
  • 5.3k
  • 1
  • 22
  • 38

This is a comment at the comments of Gerhard "Still Computing Oh So Slowly" Paseman's answer, giving just indexes n for more record-holders.

Let $\small h_n$ denote the n'th harmonic number, $\small A_n=\{h_n\}$ its fractional part. The sequence of $A_n$ has a remarkable shape like a sawtooth-curve with increasing wavelength when n is increased and with sharp local minima - a shape which can be exploited when we seek for possible n to be included in M.
I use $\small f(n) = w_n = \{h_n\} \cdot n$ and $\small f(n,\varepsilon)=w_n \cdot n^\varepsilon $ with the OP's condition rewritten as $\small f(n,\varepsilon)<1 $ as criterion for the inclusion of n into the set M . Of course the cardinality of M is limited by an upper bound $ \small n \le N$ with some N that can numerically be handled, so actually we should write explicitely $\small |M(\varepsilon,N)| $ instead of M only. I could manage to use $\small N \approx e^{2000}$ with the help of Pari/GP.

The local minima of $\small A_n$ occur near $\small x_k=e^{k-\gamma}, k \in \mathbb N^+$ and the n to be tested is one of the next integers enclosing the $\small x_k$ - so this exact n must be empirically be determined. (Note that my n are the n+1 used in the comments at the OP denoting the previous high value of A )

The harmonic numbers $\small h_n$ can be computed in Pari/GP using h(n) = psi(1+n) + Euler ; however, this seems to be limited to something like $ \small n \lt e^{600}$ and so I had to introduce the Euler-McLaurin-formula for the larger n and implemented the switch from one method to the other at n = 1e50


The following table shows the first *40* entries of my *2000*-row table containing $\small n \approx 10^{840}$ which was possible to compute using Pari/GP in just a couple of seconds.

The basic option according to the focus in the OP's question is to test $\small f(n,\varepsilon) = w_n \cdot n^\varepsilon \lt 1$. For an example with $\small \varepsilon=0.1$ see the 6'th column and the 7'th column allowing to sum to the cardinality of M where we find $\small | M(0.1,2000) | = 7$ with $\small n \le N \approx e^{2000}$

A second, much nicer, option is to define the function $\small e(n) = -\log_n(w_n) $ and test $\small e(n) \gt \varepsilon$ whether to include this n or not. This is simply possible when looking into the 5'th column and simply compare.
This latter method allows to compute the cardinalities of $\small M(\varepsilon)$ for arbitrary $\varepsilon$ really fast, for instance to create informative scatter- or lineplots, when first a list for $e(n)$ of length $\small N$ is created and then the successful comparisions with the intended $\varepsilon$ are summed to determine the cardinality.

                n | h_n    | A=frac(h_n) |   w=A*n  |    e(n)   | w*n^0.1|in M?
 -----------------+--------+-------------+----------+-----------+--------+---
                 1  1.00000   0.00000       0.00000     1.000000   0.00000  1
                 4  2.08333   0.0833333     0.333333    0.792481  0.382899  1
                11  3.01988   0.0198773     0.218651    0.634006  0.277901  1
                31  4.02725   0.0272452     0.844601   0.0491822   1.19066  .
                83  5.00207   0.00206827    0.171667    0.398793  0.267051  1
               227  6.00437   0.00436671    0.991243  0.00162136   1.70523  .
               616  7.00127   0.00127410    0.784844   0.0377178   1.49191  .
              1674  8.00049   0.000485572   0.812848   0.0279149   1.70759  .
              4550  9.00021   0.000208063   0.946686  0.00650460   2.19790  .
             12367  10.0000   0.0000430083  0.531883   0.0670005   1.36472  .
             33617  11.0000   0.0000177086  0.595311   0.0497632   1.68811  .
             91380  12.0000   0.00000305167 0.278861    0.111798  0.873923  1
            248397  13.0000   0.00000122948 0.305399   0.0954806   1.05775  .
            675214  14.0000   1.36205E-7    0.919678  0.00623806   3.52030  .
           1835421  15.0000   3.78268E-7    0.694281   0.0252988   2.93703  .
           4989191  16.0000   9.54538E-7    0.476237   0.0481002   2.22652  .
          13562027  17.0000   1.48499E-8    0.201395   0.0975770   1.04059  .
          36865412  18.0000   3.71993E-9    0.137137    0.114033  0.783098  1
         100210581  19.0000   9.73330E-9    0.975380  0.00135314   6.15552  .
         272400600  20.0000   1.61744E-9    0.440592   0.0421997   3.07297  .
         740461601  21.0000   4.01333E-9    0.297172   0.0594162   2.29065  .
        2012783315  22.0000   1.38447E-10   0.278664   0.0596444   2.37389  .
        5471312310  23.0000   1.97920E-11   0.108288   0.0991384   1.01951  .
       14872568831  24.0000   2.27220E-11   0.337935   0.0463183   3.51618  .
       40427833596  25.0000   6.07937E-12   0.245776   0.0574601   2.82623  .
      109894245429  26.0000   7.60776E-12   0.836049  0.00704359   10.6250  .
      298723530401  27.0000   1.82203E-12   0.544283   0.0230213   7.64454  .
      812014744422  28.0000   5.52830E-13   0.448906   0.0292071   6.96806  .
     2207284924203  29.0000   1.00870E-13   0.222650   0.0528504   3.81951  .
     6000022499693  30.0000   2.16954E-14   0.130173   0.0692963   2.46795  .
    16309752131262  31.0000   3.65111E-14   0.595487   0.0170391   12.4772  .
    44334502845080  32.0000   1.81005E-15   0.080247   0.0802804   1.85827  .
   120513673457548  33.0000   4.59281E-15   0.553496   0.0182434   14.1651  .
   327590128640500  34.0000   2.31992E-15   0.759983  0.00821173   21.4950  .
   890482293866031  35.0000   2.71425E-17   0.024169    0.108145  0.755506  1
  2420581837980561  36.0000   2.55560E-16   0.618603   0.0135588   21.3700  .
  6579823624480555  37.0000   1.20561E-17   0.079326   0.0695767   3.02860  .
 17885814992891026  38.0000   4.26642E-18   0.076308   0.0687541   3.21976  .
 48618685882356024  39.0000   7.23781E-19   0.035189   0.0871101   1.64093  .
132159290357566703  40.0000   2.02186E-18   0.267208   0.0334763   13.7708  .

The set $\small M(0.1,2000)$ is here the set of all $n$ where $\small f(n,0.1)=w_n \cdot n^{0.1} \lt 1$ . The number of such entries for $\small n=132159290357566703 \approx 10^{17}$ is here 7 .

All numerical tests which I've done indicate that the cardinality of $\small M(\varepsilon \gt 0,\infty)$ is finite and roughly reciprocal to $\small \varepsilon$ and only if $\varepsilon=0$ is surely infinite.


# Pari/GP tools This is the Pari/GP-program which I used.

Using the functions

  h(n) = Euler+if(n<1e50, psi(1+n),log(n)+1/2/n-1/12/n^2+1/120/n^4-1/252/n^6+1/240/n^8)
  A(n) = if(n==1,return(0)); frac(h(n))
  w(n) = A(n)*n 
  e(n) = if(n==1,return(1)); -log(w(n))/log(n)

The following needs only two steps to find the n with the next local minimum when called with index $\small k \in \mathbb N$ :

 {find_n(k)=local(n1,n2,a1,a2);
   n1=floor(exp(k-Euler)); n2=n1+1; a1 = A(n1);a2 = A(n2);
   if(a1<a2,return(n1),return(n2)); 
    }               
         


 \\ create that list one time, then evaluate cardinality for various eps
 \\ using that same list
 {makeList(listlen=40)= local(list,n,w1,logn);
   list=matrix(listlen,4);
   list[1,]=[Euler,0,0,0];
   for(k=2,listlen,
       n=find_n(k); logn=log(n);
       list[k,]=[logn+Euler,n,w1=w(n),-log(w1)/logn];
      );
    return(list); }
    
   \\ compute cardinality with some eps
  cardM(eps,list) = sum(k=1,#list[,1],list[k,4]>eps)     

   \\ apply, note: for long lists we need high internal precision
   list = makeList(40)
   print(cardM(0.1,list) )

[table 2]: This are sample data for the OP's plot of the cardinality of $\small M(\varepsilon)$ by the argument $\varepsilon$ where $\small N \approx \exp(250) \approx 10^{108}$ :

 eps   | c=#M | r=c*eps  | c= card(M) for n<= N approx 10^108
 ------+------------------
  0.01  104     1.040
  0.02   55     1.100
  0.03   36     1.080
  0.04   29     1.160
  0.05   21     1.050
  0.06   16     0.960
  0.07   12     0.840
  0.08   12     0.960
  0.09   10     0.900
  0.10    7     0.700
  0.11    6     0.660
  0.12    4     0.480
  0.13    4     0.520
  0.14    4     0.560
  0.15    4     0.600
  0.16    4     0.640
  0.17    4     0.680
  0.18    4     0.720
  0.19    4     0.760
  0.20    4     0.800

# Pictures ***[Picture 1]*** : I've extended the search-space for $n$ to the range $\small 1 \ldots e^{1000} \approx 10^{434} $ and to check sanity to the range $\small 1 \ldots e^{2000} \approx 10^{868} $. For epsilons $\varepsilon$ from $0.001$ in $200$ steps up to $0.2$ I made the following graph: [![picture][1]][1]

Remarks: for the very small epsilon the increase of the search-space gives slightly higher results, which also illustrates, that for "larger" epsilon the cardinality of $\small M(\varepsilon)$ is finite


***[Picture 2]***: Indicates uniformity of the $\small f(n) =w_n = frac(h_n) \cdot n^1$ at the *n*, where $\small w_n $ has a local minimum (on request of @GerhardPaseman): [![picture 2][2]][2]

[Picture 3]:It is also convenient to show a rescaling of the $\small f(n)$ so that we can immediately determine the cardinalities $\small |M(\varepsilon)|$ just by counting the number of dots $\small e(n)$ above $\small \varepsilon$. The derivation of the formula is

$$ \small{ \begin{array}{lll} A(n) &\lt & {1\over n^1\cdot n^\varepsilon}\\ f(n) \cdot n^\varepsilon &\lt & 1\\ \ln(f(n)) + \varepsilon \cdot \ln(n) &\lt & 0 \\ {\ln(f(n)) \over \ln(n)} + \varepsilon &\lt & 0 \\ \varepsilon & \lt& -\ln_n(f(n)) \end{array} }$$

and we simply count, how many dots in the picture show $\small e(n) = - \ln_n(f(n)) \gt \varepsilon$

picture


# Data for cardinalities-plot
epsilon  |M(eps,n)| |M(eps,n)|       
         n<=e^1000  n<=e^2000
-------------------------------
0.0000     1000     2000
0.0010      633      862
0.0020      430      482
0.0030      315      330
0.0040      258      264
0.0050      204      205
0.0060      171      171
0.0070      151      151
0.0080      135      135
0.0090      120      120
0.0100      109      109
0.0110      100      100
0.0120       98       98
0.0130       89       89
0.0140       84       84
0.0150       79       79
0.0160       73       73
0.0170       69       69
0.0180       62       62
0.0190       57       57
0.0200       55       55
0.0210       50       50
0.0220       47       47
0.0230       44       44
0.0240       42       42
0.0250       41       41
0.0260       39       39
0.0270       39       39
0.0280       37       37
0.0290       37       37
0.0300       36       36
0.0310       36       36
0.0320       36       36
0.0330       36       36
0.0340       34       34
0.0350       34       34
0.0360       34       34
0.0370       33       33
0.0380       32       32
0.0390       31       31
0.0400       29       29
0.0410       29       29
0.0420       29       29
0.0430       26       26
0.0440       26       26
0.0450       25       25
0.0460       25       25
0.0470       24       24
0.0480       24       24
0.0490       23       23
0.0500       21       21
0.0510       21       21
0.0520       21       21
0.0530       20       20
0.0540       20       20
0.0550       20       20
0.0560       20       20
0.0570       19       19
0.0580       18       18
0.0590       18       18
0.0600       16       16
0.0610       16       16
0.0620       16       16
0.0630       16       16
0.0640       16       16
0.0650       16       16
0.0660       16       16
0.0670       16       16
0.0680       15       15
0.0690       14       14
0.0700       12       12
0.0710       12       12
0.0720       12       12
0.0730       12       12
0.0740       12       12
0.0750       12       12
0.0760       12       12
0.0770       12       12
0.0780       12       12
0.0790       12       12
0.0800       12       12
0.0810       11       11
0.0820       11       11
0.0830       11       11
0.0840       11       11
0.0850       11       11
0.0860       11       11
0.0870       11       11
0.0880       10       10
0.0890       10       10
0.0900       10       10
0.0910       10       10
0.0920       10       10
0.0930       10       10
0.0940       10       10
0.0950       10       10
0.0960        9        9
0.0970        9        9
0.0980        8        8
0.0990        8        8
0.1000        7        7
0.1010        7        7
0.1020        7        7
0.1030        7        7
0.1040        7        7
0.1050        7        7
0.1060        7        7
0.1070        7        7
0.1080        7        7
0.1090        6        6
0.1100        6        6
0.1110        6        6
0.1120        5        5
0.1130        5        5
0.1140        5        5
0.1150        4        4
0.1160        4        4
0.1170        4        4
0.1180        4        4
0.1190        4        4
0.1200        4        4
0.1210        4        4
0.1220        4        4
0.1230        4        4
0.1240        4        4
0.1250        4        4
0.1260        4        4
0.1270        4        4
0.1280        4        4
0.1290        4        4
0.1300        4        4
0.1310        4        4
0.1320        4        4
0.1330        4        4
0.1340        4        4
0.1350        4        4
0.1360        4        4
0.1370        4        4
0.1380        4        4
0.1390        4        4
0.1400        4        4
0.1410        4        4
0.1420        4        4
0.1430        4        4
0.1440        4        4
0.1450        4        4
0.1460        4        4
0.1470        4        4
0.1480        4        4
0.1490        4        4
0.1500        4        4
0.1510        4        4
0.1520        4        4
0.1530        4        4
0.1540        4        4
0.1550        4        4
0.1560        4        4
0.1570        4        4
0.1580        4        4
0.1590        4        4
0.1600        4        4
0.1610        4        4
0.1620        4        4
0.1630        4        4
0.1640        4        4
0.1650        4        4
0.1660        4        4
0.1670        4        4
0.1680        4        4
0.1690        4        4
0.1700        4        4
0.1710        4        4
0.1720        4        4
0.1730        4        4
0.1740        4        4
0.1750        4        4
0.1760        4        4
0.1770        4        4
0.1780        4        4
0.1790        4        4
0.1800        4        4
0.1810        4        4
0.1820        4        4
0.1830        4        4
0.1840        4        4
0.1850        4        4
0.1860        4        4
0.1870        4        4
0.1880        4        4
0.1890        4        4
0.1900        4        4
0.1910        4        4
0.1920        4        4
0.1930        4        4
0.1940        4        4
0.1950        4        4
0.1960        4        4
0.1970        4        4
0.1980        4        4
0.1990        4        4
Gottfried Helms
  • 5.3k
  • 1
  • 22
  • 38