%I #32 Oct 05 2024 10:57:19
%S 1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,
%T 5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,
%U 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
%N n appears 3n times.
%C Ramanujan theta functions: f(q) := Prod_{k>=1} (1-(-q)^k) (see A121373), phi(q) := theta_3(q) := Sum_{k=-oo..oo} q^(k^2) (A000122), psi(q) := Sum_{k=0..oo} q^(k*(k+1)/2) (A010054), chi(q) := Prod_{k>=0} (1+q^(2k+1)) (A000700).
%H Kevin Ryde, <a href="/A111651/b111651.txt">Table of n, a(n) for n = 1..10000</a>
%H Michael Somos, <a href="/A010815/a010815.txt">Introduction to Ramanujan theta functions</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/RamanujanThetaFunctions.html">Ramanujan Theta Functions</a>
%F Expansion of (q/(1-q))psi(q^3) in powers of q where psi() is a Ramanujan theta function. - _Michael Somos_, Aug 31 2006
%F G.f.: x/(1-x)*Product_{k>0} (1-x^(3k))^((-1)^k).
%F a(n) = round(sqrt((2/3)*n)) = A002024(ceiling(n/3)). - _Kevin Ryde_, Aug 31 2024
%t Table[PadRight[{},3n,n],{n,10}]//Flatten (* _Harvey P. Dale_, Sep 15 2021 *)
%o (PARI) {a(n)=if(n<1, 0, polcoeff( x/(1-x)*prod(k=1, n\3, (1-x^(3*k))^(-1)^k, 1+O(x^n)), n))} /* _Michael Somos_, Aug 31 2006 */
%o (PARI) a(n) = sqrtint(24*n) \/ 6; \\ _Kevin Ryde_, Aug 31 2024
%o (Python)
%o from math import isqrt
%o def A111651(n): return isqrt((n<<3)//3)+1>>1 # _Chai Wah Wu_, Oct 05 2024
%Y Cf. A000194, A002024, A008585, A111650, A111652.
%K easy,nonn
%O 1,4
%A _Jonathan Vos Post_, Aug 12 2005