A010054 a(n) = 1 if n is a triangular number, otherwise 0.
1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0
Examples
G.f. = 1 + x + x^3 + x^6 + x^10 + x^15 + x^21 + x^28 + x^36 + x^45 + x^55 + x^66 + ... G.f. for B(q) = q * A(q^8): q + q^9 + q^25 + q^49 + q^81 + q^121 + q^169 + q^225 + q^289 + q^361 + ... From _Philippe Deléham_, Jan 04 2008: (Start) As a triangle this begins: 1; 1, 0; 1, 0, 0; 1, 0, 0, 0; 1, 0, 0, 0, 0; 1, 0, 0, 0, 0, 0; ... (End)
References
- J. H. Conway and N. J. A. Sloane, Sphere Packings, Lattices and Groups, Springer-Verlag, 1999, p. 103.
- Michael D. Hirschhorn, The Power of q, Springer, 2017. See Psi, page 9.
- Jules Tannery and Jules Molk, Eléments de la Théorie des Fonctions Elliptiques, Vol. 2, Gauthier-Villars, Paris, 1902; Chelsea, NY, 1972, see p. 27.
- Edmund T. Whittaker and George N. Watson, A Course of Modern Analysis, Cambridge Univ. Press, 4th ed., 1963, p. 464.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
- Mohammad K. Azarian, Remarks and Conjectures Regarding Combinatorics of Discrete Partial Functions, Int'l Math. Forum, Vol. 17, No. 3 (2022), 129-141. See Conjecture 4.4, p. 137.
- Peter Bundschuh, Generalization of a recent irrationality result of Mahler, Journal of Number Theory, Vol. 19, No. 2 (1984), pp. 248-253.
- S. Cooper and M. D. Hirschhorn, Results of Hurwitz type for three squares, Discrete Math. 274 (2004), no. 1-3, 9-24. See psi(q).
- Atli Fannar Franklín, Pattern avoidance enumerated by inversions, arXiv:2410.07467 [math.CO], 2024. See p. 2.
- Atli Fannar Franklín, Anders Claesson, Christian Bean, Henning Úlfarsson, and Jay Pantone, Restricted Permutations Enumerated by Inversions, arXiv:2406.16403 [cs.DM], 2024. See p. 2.
- Shishuo Fu and Yaling Wang, Bijective recurrences concerning two Schröder triangles, arXiv:1908.03912 [math.CO], 2019.
- Michael D. Hirschhorn and James A. Sellers, A Congruence Modulo 3 for Partitions into Distinct Non-Multiples of Four, Article 14.9.6, Journal of Integer Sequences, Vol. 17 (2014).
- Kurt Mahler, On some irrational decimal fractions, Journal of Number Theory, Vol. 13, No. 2 (1981), pp. 268-269.
- Ken Ono, Sinai Robins, and Patrick T. Wahl, On the representation of integers as sums of triangular numbers, Aequationes mathematicae, Volume 50, Issue 1-2 (August 1995), pp. 73-94, Proposition 1; ResearchGate link; author's copy.
- Franck Ramaharo, A generating polynomial for the pretzel knot, arXiv:1805.10680 [math.CO], 2018.
- Michael Somos, Introduction to Ramanujan theta functions, 2019.
- Michael Somos, A Multisection of q-Series, 2017.
- Eric Weisstein's World of Mathematics, Ramanujan Theta Functions.
- Wolfram Challenges, Separate Ones by Zeroes.
- Index entries for characteristic functions.
Crossrefs
Programs
-
Clojure
(def A010054 (mapcat #(cons 1 (replicate % 0)) (range))) ; Tony Zorman, Apr 03 2023
-
Haskell
a010054 = a010052 . (+ 1) . (* 8) a010054_list = concatMap (\x -> 1 : replicate x 0) [0..] -- Reinhard Zumkeller, Feb 12 2012, Oct 22 2011, Apr 02 2011
-
Magma
Basis( ModularForms( Gamma0(16), 1/2), 362) [2] ; /* Michael Somos, Jun 10 2014 */
-
Maple
A010054 := proc(n) if issqr(1+8*n) then 1; else 0; end if; end proc: seq(A010054(n),n=0..80) ; # R. J. Mathar, Feb 22 2021
-
Mathematica
a[ n_] := SquaresR[ 1, 8 n + 1] / 2; (* Michael Somos, Nov 15 2011 *) a[ n_] := If[ n < 0, 0, SeriesCoefficient[ (Series[ EllipticTheta[ 3, Log[y] / (2 I), x^2], {x, 0, n + Floor @ Sqrt[n]}] // Normal // TrigToExp) /. {y -> x}, {x, 0, n}]]; (* Michael Somos, Nov 15 2011 *) Table[If[IntegerQ[(Sqrt[8n+1]-1)/2],1,0],{n,0,110}] (* Harvey P. Dale, Oct 29 2012 *) a[ n_] := SeriesCoefficient[ EllipticTheta[ 2, 0, q^(1/2)] / (2 q^(1/8)), {q, 0, n}]; (* Michael Somos, Jul 01 2014 *) Module[{tr=Accumulate[Range[20]]},If[MemberQ[tr,#],1,0]&/@Range[Max[tr]]] (* Harvey P. Dale, Mar 13 2023 *)
-
PARI
{a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x^2 + A)^2 / eta(x + A), n))}; /* Michael Somos, Mar 14 2011 */
-
PARI
{a(n) = issquare( 8*n + 1)}; /* Michael Somos, Apr 27 2000 */
-
PARI
a(n) = ispolygonal(n, 3); \\ Michel Marcus, Jan 22 2015
-
Python
from sympy import integer_nthroot def A010054(n): return int(integer_nthroot((n<<3)+1,2)[1]) # Chai Wah Wu, Nov 15 2022
-
Sage
# uses[EulerTransform from A166861] b = BinaryRecurrenceSequence(-1, 0) a = EulerTransform(b) print([a(n) for n in range(88)]) # Peter Luschny, Nov 17 2022
Formula
Expansion of f(x, x^3) in powers of x where f(, ) is Ramanujan's general theta function.
Expansion of q^(-1) * (phi(q) - phi(q^4)) / 2 in powers of q^8. - Michael Somos, Jul 01 2014
Expansion of q^(-1/8) * eta(q^2)^2 / eta(q) in powers of q. - Michael Somos, Apr 13 2005
Euler transform of period 2 sequence [ 1, -1, ...]. - Michael Somos, Mar 24 2003
Given g.f. A(x), then B(q) = q * A(q^8) satisfies 0 = f(B(q), B(q^2), B(q^3), B(q^6)) where f(u1, u2, u3, u6) = u1*u6^3 + u2*u3^3 - u1*u2^2*u6. - Michael Somos, Apr 13 2005
a(n) = b(8*n + 1) where b()=A098108() is multiplicative with b(2^e) = 0^e, b(p^e) = (1 + (-1)^e) / 2 if p > 2. - Michael Somos, Jun 06 2005
a(n) = A005369(2*n). - Michael Somos, Apr 29 2003
G.f.: theta_2(sqrt(q)) / (2 * q^(1/8)).
G.f.: 1 / (1 - x / (1 + x / (1 + x^1 / (1 - x / (1 + x / (1 + x^2 / (1 - x / (1 + x / (1 + x^3 / ...))))))))). - Michael Somos, May 11 2012
G.f.: Product_{k>0} (1-x^(2*k))/(1-x^(2*k-1)). - Vladeta Jovovic, May 02 2002
G.f.: Sum_{j>=0} Product_{k=0..j} x^j. - Jon Perry, Mar 30 2004
a(n) = floor((1-cos(Pi*sqrt(8*n+1)))/2). - Carl R. White, Mar 18 2006
a(n) = round(sqrt(2n+1)) - round(sqrt(2n)). - Hieronymus Fischer, Aug 06 2007
a(n) = ceiling(2*sqrt(2n+1)) - floor(2*sqrt(2n)) - 1. - Hieronymus Fischer, Aug 06 2007
a(n) = f(n,0) with f(x,y) = if x > 0 then f(x-y,y+1), otherwise 0^(-x). - Reinhard Zumkeller, Sep 27 2008
a(n) = A035214(n) - 1.
From Mikael Aaltonen, Jan 22 2015: (Start)
Since the characteristic function of s-gonal numbers is given by floor(sqrt(2n/(s-2) + ((s-4)/(2s-4))^2) + (s-4)/(2s-4)) - floor(sqrt(2(n-1)/(s-2) + ((s-4)/(2s-4))^2) + (s-4)/(2s-4)), by setting s = 3 we get the following: For n > 0, a(n) = floor(sqrt(2*n+1/4)-1/2) - floor(sqrt(2*(n-1)+1/4)-1/2).
(End)
a(n) = (-1)^n * A106459(n). - Michael Somos, May 04 2016
G.f. is a period 1 Fourier series which satisfies f(-1 / (16 t)) = 2^(-1/2) (t/i)^(1/2) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A002448. - Michael Somos, May 05 2016
G.f.: Sum_{n >= 0} x^(n*(n+1)/2) = Product_{n >= 1} (1 - x^n)*(1 + x^n)^2 = Product_{n >= 1} (1 - x^(2*n))*(1 + x^n) = Product_{n >= 1} (1 - x^(2*n))/(1 - x^(2*n-1)). From the sum and product representations of theta_2(0, sqrt(q))/(2*q^(1/8)) function. The last product, given by Vladeta Jovovic above, is obtained from the second to last one by an Euler identity, proved via f(x) := Product_{n >= 1} (1 - x^(2*n-1))*Product_{n >= 1} (1 + x^n) = f(x^2), by moving the odd-indexed factors of the second product to the first product. This leads to f(x) = f(0) = 1. - Wolfdieter Lang, Jul 05 2016
a(0) = 1, a(n) = (1/n)*Sum_{k=1..n} A002129(k)*a(n-k) for n > 0. - Seiichi Manyama, Apr 08 2017
G.f.: Sum_{n >= 0} x^n * Product_{k >= n+1} (1 - x^(2*k)) = 1/(1 - x) * Sum_{n >= 0} x^(3*n) * Product_{k >= n+1} (1 - x^(2*k)) = 1/((1 - x)*(1 - x^3)) * Sum_{n >= 0} x^(5*n) * Product_{k >= n+1} (1 - x^(2*k)) = .... - Peter Bala, Jun 24 2025
Extensions
Additional comments from Michael Somos, Apr 27 2000
Comments