cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A055040 Numbers of the form 3^(2i+1)*(3*j+2).

This page as a plain text file.
%I A055040 #29 Feb 14 2025 17:30:01
%S A055040 6,15,24,33,42,51,54,60,69,78,87,96,105,114,123,132,135,141,150,159,
%T A055040 168,177,186,195,204,213,216,222,231,240,249,258,267,276,285,294,297,
%U A055040 303,312,321,330,339,348,357,366,375,378,384,393,402,411
%N A055040 Numbers of the form 3^(2i+1)*(3*j+2).
%C A055040 Numbers not of the form x^2+y^2+3z^2.
%C A055040 Numbers whose squarefree part is congruent to 6 modulo 9. - _Peter Munn_, May 17 2020
%C A055040 The asymptotic density of this sequence is 1/8. - _Amiram Eldar_, Mar 08 2021
%H A055040 Reinhard Zumkeller, <a href="/A055040/b055040.txt">Table of n, a(n) for n = 1..10000</a>
%H A055040 L. J. Mordell, <a href="https://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 A055040 G.f.: [x(x+2)(x^2+x+1)(x^7+x^3+1)]/(x^11-x^10-x+1) (conjectured).
%t A055040 max = 500; Select[ Union[ Flatten[ Table[3^(2*i + 1)*(3*j + 2), {i, 0, Ceiling[ Log[max/6]/Log[9]]}, {j, 0, Ceiling[(max/9^i - 6)/9]}]]], # <= max &] (* _Jean-François Alcover_, Oct 13 2011 *)
%o A055040 (Haskell)
%o A055040 a055040 n = a055040_list !! (n-1)
%o A055040 a055040_list = map (* 3) a055048_list
%o A055040 -- _Reinhard Zumkeller_, Apr 07 2012
%o A055040 (Python)
%o A055040 from sympy import integer_log
%o A055040 def A055040(n):
%o A055040     def bisection(f,kmin=0,kmax=1):
%o A055040         while f(kmax) > kmax: kmax <<= 1
%o A055040         kmin = kmax >> 1
%o A055040         while kmax-kmin > 1:
%o A055040             kmid = kmax+kmin>>1
%o A055040             if f(kmid) <= kmid:
%o A055040                 kmax = kmid
%o A055040             else:
%o A055040                 kmin = kmid
%o A055040         return kmax
%o A055040     def f(x): return n+x-sum((x//9**i-2)//3+1 for i in range(integer_log(x,9)[0]+1))
%o A055040     return bisection(f,n,n)*3 # _Chai Wah Wu_, Feb 14 2025
%Y A055040 Equals 3*A055048(n).
%Y A055040 Intersection of A145204 and A189715.
%Y A055040 Complement of A055041 with respect to A145204\{0}.
%Y A055040 Complement of A055047 with respect to A189715.
%Y A055040 Cf. A007913.
%K A055040 nonn,nice
%O A055040 1,1
%A A055040 _N. J. A. Sloane_, Jun 01 2000