A055040 Numbers of the form 3^(2i+1)*(3*j+2).
6, 15, 24, 33, 42, 51, 54, 60, 69, 78, 87, 96, 105, 114, 123, 132, 135, 141, 150, 159, 168, 177, 186, 195, 204, 213, 216, 222, 231, 240, 249, 258, 267, 276, 285, 294, 297, 303, 312, 321, 330, 339, 348, 357, 366, 375, 378, 384, 393, 402, 411
Offset: 1
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- L. J. Mordell, A new Waring's problem with squares of linear forms, Quart. J. Math., 1 (1930), 276-288 (see p. 283).
Crossrefs
Programs
-
Haskell
a055040 n = a055040_list !! (n-1) a055040_list = map (* 3) a055048_list -- Reinhard Zumkeller, Apr 07 2012
-
Mathematica
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 *)
-
Python
from sympy import integer_log def A055040(n): def bisection(f,kmin=0,kmax=1): while f(kmax) > kmax: kmax <<= 1 kmin = kmax >> 1 while kmax-kmin > 1: kmid = kmax+kmin>>1 if f(kmid) <= kmid: kmax = kmid else: kmin = kmid return kmax def f(x): return n+x-sum((x//9**i-2)//3+1 for i in range(integer_log(x,9)[0]+1)) return bisection(f,n,n)*3 # Chai Wah Wu, Feb 14 2025
Formula
G.f.: [x(x+2)(x^2+x+1)(x^7+x^3+1)]/(x^11-x^10-x+1) (conjectured).
Comments