login
Numbers of the form 4^i*(8*j+5).
5

%I #47 Feb 14 2025 17:57:01

%S 5,13,20,21,29,37,45,52,53,61,69,77,80,84,85,93,101,109,116,117,125,

%T 133,141,148,149,157,165,173,180,181,189,197,205,208,212,213,221,229,

%U 237,244,245,253,261,269,276,277,285,293,301,308,309,317

%N Numbers of the form 4^i*(8*j+5).

%C Numbers not of the form x^2+2y^2+6z^2.

%H Reinhard Zumkeller, <a href="/A055045/b055045.txt">Table of n, a(n) for n = 1..10000</a>

%H L. E. Dickson, <a href="http://dx.doi.org/10.1090/S0002-9904-1927-04312-9">Integers represented by positive ternary quadratic forms</a>, Bull. Amer. Math. Soc. 33 (1927), 63-70. See Theorem XI.

%H L. J. Mordell, <a href="http://dx.doi.org/10.1093/qmath/os-1.1.276">A new Waring's problem with squares of linear forms</a>, Quart. J. Math., 1 (1930), 276-288 (see p. 283).

%F a(n) = 6n + O(log n). - _Charles R Greathouse IV_, Dec 19 2013

%o (PARI) is(n)=n/=4^valuation(n,4); n%8==5 \\ _Charles R Greathouse IV_ and _V. Raman_, Dec 19 2013

%o (Haskell)

%o a055045 n = a055045_list !! (n-1)

%o a055045_list = filter ((== 5) . (flip mod 8) . f) [1..] where

%o f x = if r == 0 then f x' else x where (x', r) = divMod x 4

%o -- _Reinhard Zumkeller_, Jan 02 2014

%o (Python)

%o from itertools import count, islice

%o def A055045_gen(startvalue=1): # generator of terms >= startvalue

%o return filter(lambda n:not (m:=(~n&n-1).bit_length())&1 and (n>>m)&7==5, count(max(startvalue, 1)))

%o A055045_list = list(islice(A055045_gen(), 30)) # _Chai Wah Wu_, Jul 09 2022

%o (Python)

%o def A055045(n):

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

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

%o kmin = 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): return n+x-sum(((x>>(i<<1))-5>>3)+1 for i in range(x.bit_length()>>1))

%o return bisection(f,n,n) # _Chai Wah Wu_, Feb 14 2025

%Y Cf. A004215, A055046, A234000.

%K nonn,easy,changed

%O 1,1

%A _N. J. A. Sloane_, Jun 01 2000