login
Complement of A269020: numbers not of the form ceiling(n^(1+1/n)).
3

%I #22 Sep 10 2024 20:20:43

%S 2,4,8,19,51,141,392,1079,2957,8072,21987,59825,162695,442342,1202521,

%T 3268920,8885999,24154826,65659826,178482140

%N Complement of A269020: numbers not of the form ceiling(n^(1+1/n)).

%C The limiting ratio is e (see comment in A059921).

%e The term 8 appears because A269020(5)=7 and A269020(6)=9.

%t Complement[Range[1, 100000], Table[Ceiling[n^(1 + 1/n)], {n, 100000}]] (* _Vaclav Kotesovec_, Mar 12 2016 *)

%o (PARI) a269020(n) = ceil(n^(1+1/n))

%o for(n=1, 1e20, if(a269020(n+1)-a269020(n) > 1, print1(a269020(n)+1, ", "))) \\ _Felix Fröhlich_, Mar 12 2016

%o (Python)

%o from itertools import count

%o def A269023(n):

%o def bisection(f,kmin=0,kmax=1):

%o while f(kmax) > kmax: kmax <<= 1

%o while kmax-kmin > 1:

%o kmid = kmax+kmin>>1

%o if f(kmid) <= kmid:

%o kmax = kmid

%o else:

%o kmin = kmid

%o return kmax

%o def f(x):

%o if x==1: return n+1

%o z = x**x

%o for y in count(x,-1):

%o if y**(y+1) <= z:

%o return n+y

%o z //= x

%o return bisection(f,n,n) # _Chai Wah Wu_, Sep 10 2024

%Y Cf. A059921, A269020.

%K nonn,more

%O 1,1

%A _Bob Selcoe_, Feb 18 2016

%E a(18)-a(20) from _Felix Fröhlich_, Mar 12 2016