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.

Showing 1-4 of 4 results.

A035253 Second differences are 2,2,1,2,1,1,2,1,1,1,2,1,1,1,1,2,1,1,1,1,1,2,.. (A035214).

Original entry on oeis.org

4, 1, 0, 1, 3, 7, 12, 18, 26, 35, 45, 56, 69, 83, 98, 114, 131, 150, 170, 191, 213, 236, 260, 286, 313, 341, 370, 400, 431, 463, 497, 532, 568, 605, 643, 682, 722, 763, 806, 850, 895, 941, 988, 1036, 1085, 1135, 1186, 1239, 1293, 1348, 1404, 1461, 1519, 1578
Offset: 0

Views

Author

Robet Bronson (bob(AT)bronsons.com)

Keywords

Crossrefs

Different from A005228. Cf. A035254, A060432.

Programs

  • Python
    from math import isqrt
    def A035253(n): return (k:=(r:=isqrt(m:=n<<1))+int((m<<2)>(r<<2)*(r+1)+1)-1)*(k*(-k-3)+6*n-8)//6+(n*(n-5)>>1)+3 # Chai Wah Wu, Jun 07 2025

Formula

a(n) = A060432(n-1)+4+n*(n-7)/2. - Chai Wah Wu, Jun 07 2025

Extensions

More terms from Chai Wah Wu, Jun 07 2025

A010054 a(n) = 1 if n is a triangular number, otherwise 0.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This is essentially the q-expansion of the Jacobi theta function theta_2(q). (In theta_2 one has to ignore the initial factor of 2*q^(1/4) and then replace q by q^(1/2). See also A005369.) - N. J. A. Sloane, Aug 03 2014
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Ramanujan's theta function f(a, b) = Sum_{n=-inf..inf} a^(n*(n+1)/2) * b^(n*(n-1)/2).
This sequence is the concatenation of the base-b digits in the sequence b^n, for any base b >= 2. - Davis Herring (herring(AT)lanl.gov), Nov 16 2004
Number of partitions of n into distinct parts such that the greatest part equals the number of all parts, see also A047993; a(n)=A117195(n,0) for n > 0; a(n) = 1-A117195(n,1) for n > 1. - Reinhard Zumkeller, Mar 03 2006
Triangle T(n,k), 0 <= k <= n, read by rows, given by A000007 DELTA A000004 where DELTA is the operator defined in A084938. - Philippe Deléham, Jan 03 2009
Convolved with A000041 = A022567, the convolution square of A000009. - Gary W. Adamson, Jun 11 2009
A008441(n) = Sum_{k=0..n} a(k)*a(n-k). - Reinhard Zumkeller, Nov 03 2009
Polcoeff inverse with alternate signs = A006950: (1, 1, 1, 2, 3, 4, 5, 7, ...). - Gary W. Adamson, Mar 15 2010
This sequence is related to Ramanujan's two-variable theta functions because this sequence is also the characteristic function of generalized hexagonal numbers. - Omar E. Pol, Jun 08 2012
Number 3 of the 14 primitive eta-products which are holomorphic modular forms of weight 1/2 listed by D. Zagier on page 30 of "The 1-2-3 of Modular Forms". - Michael Somos, May 04 2016
Number of partitions of n into consecutive parts that contain 1 as a part, n >= 1. - Omar E. Pol, Nov 27 2020
The constant whose decimal expansion is this sequence is irrational (Mahler, 1981). The constant whose expansion in any base b >= 2 is this sequence is irrational (Bundschuh, 1984). - Amiram Eldar, Mar 23 2025

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.

Crossrefs

Number of ways of writing n as a sum of k triangular numbers, for k=1,...: A010054, A008441, A008443, A008438, A008439, A008440, A226252, A007331, A226253, A226254, A226255, A014787, A014809.
Cf. A106507 (reciprocal series).

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
a(0)=1; for n>0, a(n) = A002024(n+1)-A002024(n). - Benoit Cloitre, Jan 05 2004
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

A014132 Complement of triangular numbers (A000217); also array T(n,k) = ((n+k)^2 + n-k)/2, n, k > 0, read by antidiagonals.

Original entry on oeis.org

2, 4, 5, 7, 8, 9, 11, 12, 13, 14, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79
Offset: 1

Views

Author

Keywords

Comments

Numbers that are not triangular (nontriangular numbers).
Also definable as follows: a(1)=2; for n>1, a(n) is smallest integer greater than a(n-1) such that the condition "n and a(a(n)) have opposite parities" can always be satisfied. - Benoit Cloitre and Matthew Vandermast, Mar 10 2003
Record values in A256188 that are greater than 1. - Reinhard Zumkeller, Mar 26 2015
From Daniel Forgues, Apr 10 2015: (Start)
With n >= 1, k >= 1:
t(n+k) - k, 1 <= k <= n+k-1, n >= 1;
t(n+k-1) + n, 1 <= n <= n+k-1, k >= 1;
where t(n+k) = t(n+k-1) + (n+k) is the (n+k)-th triangular number, while the number of compositions of n+k into 2 parts is C(n+k-1, 2-1) = n+k-1, the number of nontriangular numbers between t(n+k-1) and t(n+k), just right!
Related to Hilbert's Infinite Hotel:
0) All rooms, numbered through the positive integers, are full;
1) An infinite number of trains, each containing an infinite number of passengers, arrives: i.e., a 2-D lattice of pairs of positive integers;
2) Move occupant of room m, m >= 1, to room t(m) = m*(m+1)/2, where t(m) is the m-th triangular number;
3) Assign n-th passenger from k-th train to room t(n+k-1) + n, 1 <= n <= n+k-1, k >= 1;
4) Everybody has his or her own room, no room is empty, for m >= 1.
If situation 1 happens again, repeat steps 2 and 3, you're back to 4.
(End)
1711 + 2*a(n)*(58 + a(n)) is prime for n<=21. The terms that do not have this property start 29,32,34,43,47,58,59,60,62,63,65,68,70,73,... - Benedict W. J. Irwin, Nov 22 2016
Also numbers k with the property that in the symmetric representation of sigma(k) both Dyck paths have a central peak or both Dyck paths have a central valley. (Cf. A237593.) - Omar E. Pol, Aug 28 2018

Examples

			From _Boris Putievskiy_, Jan 14 2013: (Start)
Start of the sequence as a table (read by antidiagonals, right to left), where the k-th row corresponds to the k-th column of the triangle (shown thereafter):
   2,  4,  7, 11, 16, 22, 29, ...
   5,  8, 12, 17, 23, 30, 38, ...
   9, 13, 18, 24, 31, 39, 48, ...
  14, 19, 25, 32, 40, 49, 59, ...
  20, 26, 33, 41, 50, 60, 71, ...
  27, 34, 42, 51, 61, 72, 84, ...
  35, 43, 52, 62, 73, 85, 98, ...
  (...)
Start of the sequence as a triangle (read by rows), where the i elements of the i-th row are t(i) + 1 up to t(i+1) - 1, i >= 1:
   2;
   4,  5;
   7,  8,  9;
  11, 12, 13, 14;
  16, 17, 18, 19, 20;
  22, 23, 24, 25, 26, 27;
  29, 30, 31, 32, 33, 34, 35;
  (...)
Row number i contains i numbers, where t(i) = i*(i+1)/2:
  t(i) + 1, t(i) + 2, ..., t(i) + i = t(i+1) - 1
(End) [Edited by _Daniel Forgues_, Apr 11 2015]
		

Crossrefs

Cf. A000124 (left edge: quasi-triangular numbers), A000096 (right edge: almost-triangular numbers), A006002 (row sums), A001105 (central terms).
Cf. A242401 (subsequence).
Cf. A145397 (the non-tetrahedral numbers).

Programs

  • Haskell
    a014132 n = n + round (sqrt $ 2 * fromInteger n)
    a014132_list = filter ((== 0) . a010054) [0..]
    -- Reinhard Zumkeller, Dec 12 2012
    
  • Magma
    IsTriangular:=func< n | exists{ k: k in [1..Isqrt(2*n)] | n eq (k*(k+1) div 2)} >; [ n: n in [1..90] | not IsTriangular(n) ]; // Klaus Brockhaus, Jan 04 2011
    
  • Mathematica
    f[n_] := n + Round[Sqrt[2n]]; Array[f, 71] (* or *)
    Complement[ Range[83], Array[ #(# + 1)/2 &, 13]] (* Robert G. Wilson v, Oct 21 2005 *)
    DeleteCases[Range[80],?(OddQ[Sqrt[8#+1]]&)] (* _Harvey P. Dale, Jul 24 2021 *)
  • PARI
    a(n)=if(n<1,0,n+(sqrtint(8*n-7)+1)\2)
    
  • PARI
    isok(n) = !ispolygonal(n,3); \\ Michel Marcus, Mar 01 2016
    
  • Python
    from math import isqrt
    def A014132(n): return n+(isqrt((n<<3)-7)+1>>1) # Chai Wah Wu, Jun 17 2024

Formula

a(n) = n + round(sqrt(2*n)).
a(a(n)) = n + 2*floor(1/2 + sqrt(2n)) + 1.
a(n) = a(n-1) + A035214(n), a(1)=2.
a(n) = A080036(n) - 1.
a(n) = n + A002024(n). - Vincenzo Librandi, Jul 08 2010
A010054(a(n)) = 0. - Reinhard Zumkeller, Dec 10 2012
From Boris Putievskiy, Jan 14 2013: (Start)
a(n) = A007401(n)+1.
a(n) = A003057(n)^2 - A114327(n).
a(n) = ((t+2)^2 + i - j)/2, where
i = n-t*(t+1)/2,
j = (t*t+3*t+4)/2-n,
t = floor((-1+sqrt(8*n-7))/2). (End)
A248952(a(n)) < 0. - Reinhard Zumkeller, Oct 20 2014
a(n) = A256188(A004202(n)). - Reinhard Zumkeller, Mar 26 2015
From Robert Israel, Apr 20 2015 (Start):
a(n) = A118011(n) - n.
G.f.: x/(1-x)^2 + x/(1-x) * Sum(j>=0, x^(j*(j+1)/2)) = x/(1-x)^2 + x^(7/8)/(2-2*x) * Theta2(0,sqrt(x)), where Theta2 is a Jacobi theta function. (End)
G.f. as array: x*y*(2 - 2*y + x^2*y + y^2 - x*(1 + y))/((1 - x)^3*(1 - y)^3). - Stefano Spezia, Apr 22 2024

Extensions

Following Alford Arnold's comment: keyword tabl and correspondent crossrefs added by Reinhard Zumkeller, Dec 12 2012
I restored the original definition. - N. J. A. Sloane, Jan 27 2019

A035254 First differences of A035253.

Original entry on oeis.org

-3, -1, 1, 2, 4, 5, 6, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 64
Offset: 0

Views

Author

Robet Bronson (bob(AT)bronsons.com)

Keywords

Crossrefs

Different from A030124. Cf. A002024, A014132, A014133. First differences are in A035214.

Programs

  • Python
    from math import isqrt
    def A035254(n): return n+(isqrt(n<<3)-5>>1) # Chai Wah Wu, Jun 07 2025

Formula

a(n) = A002024(n)+n-3. - Chai Wah Wu, Jun 07 2025
Showing 1-4 of 4 results.