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-10 of 4809 results. Next

A008302 Triangle of Mahonian numbers T(n,k): coefficients in expansion of Product_{i=0..n-1} (1 + x + ... + x^i), where k ranges from 0 to A000217(n-1). Also enumerates permutations by their major index.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 1, 3, 5, 6, 5, 3, 1, 1, 4, 9, 15, 20, 22, 20, 15, 9, 4, 1, 1, 5, 14, 29, 49, 71, 90, 101, 101, 90, 71, 49, 29, 14, 5, 1, 1, 6, 20, 49, 98, 169, 259, 359, 455, 531, 573, 573, 531, 455, 359, 259, 169, 98, 49, 20, 6, 1, 1, 7, 27, 76, 174, 343, 602, 961, 1415, 1940, 2493, 3017, 3450, 3736, 3836, 3736, 3450, 3017, 2493, 1940, 1415, 961, 602, 343, 174, 76, 27, 7, 1, 1, 8, 35, 111, 285, 628, 1230, 2191, 3606, 5545, 8031, 11021, 14395, 17957, 21450, 24584, 27073, 28675, 29228, 28675, 27073, 24584, 21450, 17957, 14395, 11021, 8031, 5545, 3606, 2191, 1230, 628, 285, 111, 35, 8, 1
Offset: 1

Views

Author

Keywords

Comments

T(n,k) is the number of permutations of {1..n} with k inversions.
n-th row gives growth series for symmetric group S_n with respect to transpositions (1,2), (2,3), ..., (n-1,n).
T(n,k) is the number of permutations of (1,2,...,n) having disorder equal to k. The disorder of a permutation p of (1,2,...,n) is defined in the following manner. We scan p from left to right as often as necessary until all its elements are removed in increasing order, scoring one point for each occasion on which an element is passed over and not removed. The disorder of p is the number of points scored by the end of the scanning and removal process. For example, the disorder of (3,5,2,1,4) is 8, since on the first scan, 3,5,2 and 4 are passed over, on the second, 3,5 and 4 and on the third scan, 5 is once again not removed. - Emeric Deutsch, Jun 09 2004
T(n,k) is the number of permutations p=(p(1),...,p(n)) of {1..n} such that Sum_{i: p(i)>p(i+1)} = k (k is called the Major index of p). Example: T(3,0)=1, T(3,1)=2, T(3,2)=2, T(3,3)=1 because the major indices of the permutations (1,2,3), (2,1,3), (3,1,2), (1,3,2), (2,3,1) and (3,2,1) are 0,1,1,2,2 and 3, respectively. - Emeric Deutsch, Aug 17 2004
T(n,k) is the number of 2 X c matrices with column totals 1,2,3,...,n and row totals k and binomial(n+1,2) - k. - Mitch Harris, Jan 13 2006
T(n,k) is the number of permutations p of {1,2,...,n} for which den(p)=k. Here den is the Denert statistic, defined in the following way: let p=p(1)p(2)...p(n) be a permutation of {1,2,...,n}; if p(i)>i, then we say that i is an excedance of p; let i_1 < i_2 < ... < i_k be the excedances of p and let j_1 < j_2 < ... < j_{n-k} be the non-excedances of p; let Exc(p) = p(i_1)p(i_2)...p(i_k), Nexc(p)=p(j_1)p(j_2)...p(j_{n-k}); then, by definition den(p) = i_1 + i_2 + ... + i_k + inv(Exc(p)) + inv(Nexc(p)), where inv denotes "number of inversions". Example: T(4,5)=3 because we have 1342, 3241 and 4321. We show that den(4321)=5: the excedances are 1 and 2; Exc(4321)=43, Nexc(4321)=21; now den(4321) = 1 + 2 + inv(43) + inv(21) = 3+1+1 = 5. - Emeric Deutsch, Oct 29 2008
T(n,k) is the number of size k submultisets of the multiset {1,2,2,3,3,3,...,n-1} (which contains i copies of i for 0 < i < n).
The limit of products of the numbers of fixed necklaces of length n composed of beads of types N(n,b), n --> infinity, is the generating function for inversions (we must exclude one unimportant factor b^n/n!). The error is < (b^n/n!)*O(1/n^(1/2-epsilon)). See Gaichenkov link. - Mikhail Gaichenkov, Aug 27 2012
The number of ways to distribute k-1 indistinguishable balls into n-1 boxes of capacity 1,2,3,...,n-1. - Andrew Woods, Sep 26 2012
Partial sums of rows give triangle A161169. - András Salamon, Feb 16 2013
The number of permutations of n that require k pair swaps in the bubble sort to sort them into the natural 1,2,...,n order. - R. J. Mathar, May 04 2013
Also series coefficients of q-factorial [n]q ! -- see Mathematica line. - _Wouter Meeussen, Jul 12 2014
From Mikhail Gaichenkov, Aug 16 2016: (Start)
Following asymptotic expansions in the Central Limit Theorem developed by Valentin V. Petrov, the cumulative distribution function of these numbers, CDF_N(x), is equal to the CDF of the normal distribution - (0.06/sqrt(2*Pi))*exp(-x^2/2)(x^3-3x)*(6N^3+21N^2+31N+31)/(N(2N+5)^2(N-1)+O(1/N^2).
This can be written as: CDF of the normal distribution -(0.09/(N*sqrt(2*Pi)))*exp(-x^2/2)*He_3(x) + O(1/N^2), N > 1, natural numbers (Gaichenkov, private research).
According to B. H. Margolius, Permutations with inversions, J. Integ. Seqs. Vol. 4 (2001), #01.2.4, "the unimodal behavior of the inversion numbers suggests that the number of inversions in a random permutation may be asymptotically normal". See links.
Moreover, E. Ben-Naim (Theoretical Division and Center for Nonlinear Studies, Los Alamos National Laboratory), "On the Mixing of Diffusing Particles" (13 Oct 2010), states that the Mahonian Distribution becomes a function of a single variable for large numbers of element, i.e., the probability distribution function is normal. See links.
To be more precise the expansion of the distribution is presented for a finite number of elements (or particles in terms of E. Ben-Naim's article). The distribution tends to the normal distribution for an infinite numbers of elements.
(End)
T(n,k) statistic counts (labeled) permutation graphs with n vertices and k edges. - Mikhail Gaichenkov, Aug 20 2019
From Gus Wiseman, Aug 12 2020: (Start)
Number of divisors of A006939(n - 1) or A076954(n - 1) with k prime factors, counted with multiplicity, where A006939(n) = Product_{i = 1..n} prime(i)^(n - i + 1). For example, row n = 4 counts the following divisors:
1 2 4 8 24 72 360
3 6 12 36 120
5 9 18 40 180
10 20 60
15 30 90
45
Crossrefs:
A336420 is the case with distinct prime multiplicities.
A006939 lists superprimorials or Chernoff numbers.
A022915 counts permutations of prime indices of superprimorials.
A317829 counts factorizations of superprimorials.
A336941 counts divisor chains under superprimorials.
(End)
Named after the British mathematician Percy Alexander MacMahon (1854-1929). - Amiram Eldar, Jun 13 2021
Row maxima ~ n!/(sigma * sqrt(2*Pi)), sigma^2 = (2*n^3 + 9*n^2 + 7*n)/72 = variance of group type A_n (see also A161435). - Mikhail Gaichenkov, Feb 08 2023
Sum_{i>=0} T(n,i)*k^i = A069777(n,k). - Geoffrey Critzer, Feb 26 2025

Examples

			1; 1+x; (1+x)*(1+x+x^2) = 1+2*x+2*x^2+x^3; etc.
Triangle begins:
  n\k| 0  1   2    3    4     5     6     7     8      9     10
  ---+--------------------------------------------------------------
   1 | 1;
   2 | 1, 1;
   3 | 1, 2,  2,   1;
   4 | 1, 3,  5,   6,   5,    3,    1;
   5 | 1, 4,  9,  15,  20,   22,   20,   15,    9,     4,     1;
   6 | 1, 5, 14,  29,  49,   71,   90,  101,  101,    90,    71, ...
   7 | 1, 6, 20,  49,  98,  169,  259,  359,  455,   531,   573, ...
   8 | 1, 7, 27,  76, 174,  343,  602,  961, 1415,  1940,  2493, ...
   9 | 1, 8, 35, 111, 285,  628, 1230, 2191, 3606,  5545,  8031, ...
  10 | 1, 9, 44, 155, 440, 1068, 2298, 4489, 8095, 13640, 21670, ...
From _Gus Wiseman_, Aug 12 2020: (Start)
Row n = 4 counts the following submultisets of {1,1,1,2,2,3}:
  {}  {1}  {11}  {111}  {1112}  {11122}  {111223}
      {2}  {12}  {112}  {1122}  {11123}
      {3}  {22}  {122}  {1113}  {11223}
           {13}  {113}  {1123}
           {23}  {123}  {1223}
                 {223}
(End)
		

References

  • Miklós Bóna, Combinatorics of permutations, Chapman & Hall/CRC, Boca Raton, Florida, 2004 (p. 52).
  • Louis Comtet, Advanced Combinatorics, Reidel, 1974, p. 240.
  • Florence Nightingale David, Maurice George Kendall, and David Elliot Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 241.
  • Pierre de la Harpe, Topics in Geometric Group Theory, Univ. Chicago Press, 2000, p. 163, top display.
  • Eugen Netto, Lehrbuch der Combinatorik. 2nd ed., Teubner, Leipzig, 1927, p. 96.
  • Valentin V. Petrov, Sums of Independent Random Variables, Springer Berlin Heidelberg, 1975, p. 134.
  • Richard P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 1, 1999; see Corollary 1.3.10, p. 21.

Crossrefs

Diagonals: A000707 (k=n-1), A001892 (k=n-2), A001893 (k=n-3), A001894 (k=n-4), A005283 (k=n-5), A005284 (k=n-6), A005285 (k=n-7).
Columns: A005286 (k=3), A005287 (k=4), A005288 (k=5), A242656 (k=6), A242657 (k=7).
Rows: A161435 (n=4), A161436 (n=5), A161437 (n=6), A161438 (n=7), A161439 (n=8), A161456 (n=9), A161457 (n=10).
Row-maxima: A000140, truncated table: A060701, row sums: A000142, row lengths: A000124.
A001809 gives total Denert index of all permutations.
A357611 gives a refinement.

Programs

  • Maple
    g := proc(n,k) option remember; if k=0 then return(1) else if (n=1 and k=1) then return(0) else if (k<0 or k>binomial(n,2)) then return(0) else g(n-1,k)+g(n,k-1)-g(n-1,k-n) end if end if end if end proc; # Barbara Haas Margolius (margolius(AT)math.csuohio.edu), May 31 2001
    BB:=j->1+sum(t^i, i=1..j): for n from 1 to 8 do Z[n]:=sort(expand(simplify(product(BB(j), j=0..n-2)))) od: for n from 1 to 8 do seq(coeff(Z[n], t, j), j=0..(n-1)*(n-2)/2) od; # Zerinvary Lajos, Apr 13 2007
    # alternative Maple program:
    b:= proc(u, o) option remember; expand(`if`(u+o=0, 1,
           add(b(u+j-1, o-j)*x^(u+j-1), j=1..o)+
           add(b(u-j, o+j-1)*x^(u-j), j=1..u)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0)):
    seq(T(n), n=1..10);  # Alois P. Heinz, May 02 2017
  • Mathematica
    f[n_] := CoefficientList[ Expand@ Product[ Sum[x^i, {i, 0, j}], {j, n}], x]; Flatten[Array[f, 8, 0]]
    (* Second program: *)
    T[0, 0] := 1; T[-1, k_] := 0;
    T[n_, k_] := T[n, k] = If[0 <= k <= n*(n - 1)/2, T[n, k - 1] + T[n - 1, k] - T[n - 1, k - n], 0]; (* Peter Kagey, Mar 18 2021; corrected the program by Mats Granvik and Roger L. Bagula, Jun 19 2011 *)
    alternatively (versions 7 and up):
    Table[CoefficientList[Series[QFactorial[n,q],{q,0,n(n-1)/2}],q],{n,9}] (* Wouter Meeussen, Jul 12 2014 *)
    b[u_, o_] := b[u, o] = Expand[If[u + o == 0, 1,
       Sum[b[u + j - 1, o - j]*x^(u + j - 1), {j, 1, o}] +
       Sum[b[u - j, o + j - 1]*x^(u - j), {j, 1, u}]]];
    T[n_] := With[{p = b[n, 0]}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]];
    Table[T[n], {n, 1, 10}] // Flatten (* Jean-François Alcover, Apr 21 2025, after Alois P. Heinz *)
  • PARI
    {T(n,k) = my(A=1+x); for(i=1,n, A = 1 + intformal(A - q*subst(A,x,q*x +x^2*O(x^n)))/(1-q)); polcoeff(n!*polcoeff(A,n,x),k,q)}
    for(n=1,10, for(k=0,n*(n-1)/2, print1(T(n,k),", ")); print("")) \\ Paul D. Hanna, Dec 31 2016
    
  • PARI
    row(n)=Vec(prod(k=1,n,(1-'q^k)/(1-'q))); \\ Joerg Arndt, Apr 13 2019
  • Sage
    from sage.combinat.q_analogues import q_factorial
    for n in (1..6): print(q_factorial(n).list()) # Peter Luschny, Jul 18 2016
    

Formula

Bourget, Comtet and Moritz-Williams give recurrences.
Mendes and Stanley give g.f.'s.
G.f.: Product_{j=1..n} (1-x^j)/(1-x) = Sum_{k=0..M} T{n, k} x^k, where M = n*(n-1)/2.
From Andrew Woods, Sep 26 2012, corrected by Peter Kagey, Mar 18 2021: (Start)
T(1, 0) = 1,
T(n, k) = 0 for n < 0, k < 0 or k > n*(n-1)/2.
T(n, k) = Sum_{j=0..n-1} T(n-1, k-j),
T(n, k) = T(n, k-1) + T(n-1, k) - T(n-1, k-n). (End)
E.g.f. satisfies: A(x,q) = 1 + Integral (A(x,q) - q*A(q*x,q))/(1-q) dx, where A(x,q) = Sum_{n>=0} x^n/n! * Sum_{k=0..n*(n-1)/2} T(n,k)*q^k, when T(0,0) = 1 is included. - Paul D. Hanna, Dec 31 2016

Extensions

There were some mistaken edits to this entry (inclusion of an initial 1, etc.) which I undid. - N. J. A. Sloane, Nov 30 2009
Added mention of "major index" to definition. - N. J. A. Sloane, Feb 10 2019

A034953 Triangular numbers (A000217) with prime indices.

Original entry on oeis.org

3, 6, 15, 28, 66, 91, 153, 190, 276, 435, 496, 703, 861, 946, 1128, 1431, 1770, 1891, 2278, 2556, 2701, 3160, 3486, 4005, 4753, 5151, 5356, 5778, 5995, 6441, 8128, 8646, 9453, 9730, 11175, 11476, 12403, 13366, 14028, 15051, 16110, 16471, 18336, 18721, 19503
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Comments

The following sequences (allowing offset of first term) all appear to have the same parity: A034953, triangular numbers with prime indices; A054269, length of period of continued fraction for sqrt(p), p prime; A082749, difference between the sum of next prime(n) natural numbers and the sum of next n primes; A006254, numbers n such that 2n-1 is prime; A067076, 2n+3 is a prime. - Jeremy Gardiner, Sep 10 2004
Given a rectangular prism with sides 1, p, p^2 for p = n-th prime (n > 1), the area of the six sides divided by the volume gives a remainder which is 4*a(n). - J. M. Bergot, Sep 12 2011
The infinite sum over the reciprocals is given by 2*A179119. - Wolfdieter Lang, Jul 10 2019

Crossrefs

Programs

  • Haskell
    a034953 n = a034953_list !! (n-1)
    a034953_list = map a000217 a000040_list
    -- Reinhard Zumkeller, Sep 23 2011
  • Maple
    a:= n-> (p-> p*(p+1)/2)(ithprime(n)):
    seq(a(n), n=1..65);  # Alois P. Heinz, Apr 20 2022
  • Mathematica
    t[n_] := n(n + 1)/2; Table[t[Prime[n]], {n, 44}] (* Robert G. Wilson v, Aug 12 2004 *)
    (#(# + 1))/2&/@Prime[Range[50]] (* Harvey P. Dale, Feb 27 2012 *)
    With[{nn=200},Pick[Accumulate[Range[nn]],Table[If[PrimeQ[n],1,0],{n,nn}],1]] (* Harvey P. Dale, Mar 05 2023 *)
  • PARI
    forprime(p=2,1e3,print1(binomial(p+1,2)", ")) \\ Charles R Greathouse IV, Jul 19 2011
    
  • PARI
    apply(n->binomial(n+1,2),primes(100)) \\ Charles R Greathouse IV, Jun 04 2013
    

Formula

a(n) = A000217(A000040(n)). - Omar E. Pol, Jul 27 2009
a(n) = Sum_{k=1..prime(n)} k. - Wesley Ivan Hurt, Apr 27 2021
Product_{n>=1} (1 - 1/a(n)) = A307868. - Amiram Eldar, Nov 07 2022

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

A006578 Triangular numbers plus quarter squares: n*(n+1)/2 + floor(n^2/4) (i.e., A000217(n) + A002620(n)).

Original entry on oeis.org

0, 1, 4, 8, 14, 21, 30, 40, 52, 65, 80, 96, 114, 133, 154, 176, 200, 225, 252, 280, 310, 341, 374, 408, 444, 481, 520, 560, 602, 645, 690, 736, 784, 833, 884, 936, 990, 1045, 1102, 1160, 1220, 1281, 1344, 1408, 1474, 1541, 1610, 1680, 1752, 1825, 1900, 1976, 2054
Offset: 0

Views

Author

Keywords

Comments

Equals (1, 2, 3, 4, ...) convolved with (1, 2, 1, 2, ...). a(4) = 14 = (1, 2, 3, 4) dot (2, 1, 2, 1) = (2 + 2 + 6 + 4). - Gary W. Adamson, May 01 2009
We observe that is the transform of A032766 by the following transform T: T(u_0,u_1,u_2,u_3,...) = (u_0, u_0+u_1, u_0+u_1+u_2, u_0+u_1+u_2+u_3+u_4,...). In other words, v_p = Sum_{k=0..p} u_k and the g.f. phi_v of is given by phi_v = phi_u/(1-z). - Richard Choulet, Jan 28 2010
Equals row sums of a triangle with (1, 4, 7, 10, ...) in every column, shifted down twice for columns > 1. - Gary W. Adamson, Mar 03 2010
Number of pairs (x,y) with x in {0,...,n}, y odd in {0,...,2n}, and x < y. - Clark Kimberling, Jul 02 2012
Also A049451 and positives A000567 interleaved. - Omar E. Pol, Aug 03 2012
Similar to A001082. Members of this family are A093005, A210977, this sequence, A210978, A181995, A210981, A210982. - Omar E. Pol, Aug 09 2012

Examples

			G.f. = x + 4*x^2 + 8*x^3 + 14*x^4 + 21*x^5 + 30*x^6 + 40*x^7 + 52*x^8 + 65*x^9 + ...
		

References

  • Marc LeBrun, personal communication.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Row sums of A104567.
Cf. A051125.

Programs

  • Magma
    [(6*n^2+4*n-1+(-1)^n)/8: n in [0..50] ]; // Vincenzo Librandi, Aug 20 2011
  • Maple
    with (combinat): seq(count(Partition((3*n+1)), size=3), n=0..52); # Zerinvary Lajos, Mar 28 2008
    # 2nd program
    A006578 := proc(n)
        (6*n^2 + 4*n - 1 + (-1)^n)/8 ;
    end proc: # R. J. Mathar, Apr 28 2017
  • Mathematica
    Accumulate[LinearRecurrence[{1,1,-1}, {0,1,3}, 100]] (* Harvey P. Dale, Sep 29 2013 *)
    a[ n_] := Quotient[n + 1, 2] (Quotient[n, 2] 3 + 1); (* Michael Somos, Jun 09 2014 *)
    a[ n_] := Quotient[3 (n + 1)^2 + 1, 4] - (n + 1); (* Michael Somos, Jun 10 2015 *)
    LinearRecurrence[{2, 0, -2, 1},{0, 1, 4, 8},53] (* Ray Chandler, Aug 03 2015 *)
  • PARI
    {a(n) = (3*(n+1)^2 + 1)\4 - n - 1}; /* Michael Somos, Mar 10 2006 */
    

Formula

Expansion of x*(1+2*x) / ((1-x)^2*(1-x^2)). - Simon Plouffe in his 1992 dissertation
a(n) + A002620(n) = A002378(n) = n*(n+1).
Partial sums of A032766. - Paul Barry, May 30 2003
a(n) = a(n-1) + a(n-2) - a(n-3) + 3 = A002620(n) + A004526(n) = A001859(n) - A004526(n+1). - Henry Bottomley, Mar 08 2000
a(n) = (6*n^2 + 4*n - 1 + (-1)^n)/8. - Paul Barry, May 30 2003
a(n) = A001859(-1-n) for all n in Z. - Michael Somos, May 10 2006
a(n) = (A002378(n)/2 + A035608(n))/2. - Reinhard Zumkeller, Feb 07 2010
a(n) = (3*n^2 + 2*n - (n mod 2))/4. - Ctibor O. Zizka, Mar 11 2012
a(n) = Sum_{i=1..n} floor(3*i/2) = Sum_{i=0..n} (i + floor(i/2)). - Enrique Pérez Herrero, Apr 21 2012
a(n) = 3*n*(n+1)/2 - A001859(n). - Clark Kimberling, Jul 02 2012
a(n) = Sum_{i=1..n} (n - i + 1) * 2^( (i+1) mod 2 ). - Wesley Ivan Hurt, Mar 30 2014
a(n) = A002717(n) - A002717(n-1). - Michael Somos, Jun 09 2014
a(n) = Sum_{k=1..n} floor((n+k+1)/2). - Wesley Ivan Hurt, Mar 31 2017
a(n) = A002620(n+1)+2*A002620(n). - R. J. Mathar, Apr 28 2017
Sum_{n>=1} 1/a(n) = 3 - Pi/(4*sqrt(3)) - 3*log(3)/4. - Amiram Eldar, May 28 2022
E.g.f.: (x*(5 + 3*x)*cosh(x) - (1 - 5*x - 3*x^2)*sinh(x))/4. - Stefano Spezia, Aug 22 2023

Extensions

Offset and description changed by N. J. A. Sloane, Nov 30 2006

A027468 9 times the triangular numbers A000217.

Original entry on oeis.org

0, 9, 27, 54, 90, 135, 189, 252, 324, 405, 495, 594, 702, 819, 945, 1080, 1224, 1377, 1539, 1710, 1890, 2079, 2277, 2484, 2700, 2925, 3159, 3402, 3654, 3915, 4185, 4464, 4752, 5049, 5355, 5670, 5994, 6327, 6669, 7020, 7380, 7749, 8127, 8514, 8910, 9315
Offset: 0

Views

Author

Keywords

Comments

Staggered diagonal of triangular spiral in A051682, between (0,1,11) spoke and (0,8,25) spoke. - Paul Barry, Mar 15 2003
Number of permutations of n distinct letters (ABCD...) each of which appears thrice with n-2 fixed points. - Zerinvary Lajos, Oct 15 2006
Number of n permutations (n>=2) of 4 objects u, v, z, x with repetition allowed, containing n-2=0 u's. Example: if n=2 then n-2 =zero (0) u, a(1)=9 because we have vv, zz, xx, vx, xv, zx, xz, vz, zv. A027465 formatted as a triangular array: diagonal: 9, 27, 54, 90, 135, 189, 252, 324, ... . - Zerinvary Lajos, Aug 06 2008
a(n) is also the least weight of self-conjugate partitions having n different parts such that each part is a multiple of 3. - Augustine O. Munagi, Dec 18 2008
Also sequence found by reading the line from 0, in the direction 0, 9, ..., and the same line from 0, in the direction 0, 27, ..., in the square spiral whose vertices are the generalized hendecagonal numbers A195160. Axis perpendicular to A195147 in the same spiral. - Omar E. Pol, Sep 18 2011
Sum of the numbers from 4*n to 5*n. - Wesley Ivan Hurt, Nov 01 2014

Examples

			The first such self-conjugate partitions, corresponding to a(n)=1,2,3,4 are 3+3+3, 6+6+6+3+3+3, 9+9+9+6+6+6+3+3+3, 12+12+12+9+9+9+6+6+6+3+3+3. - _Augustine O. Munagi_, Dec 18 2008
		

Crossrefs

Programs

  • Magma
    [9*n*(n+1)/2: n in [0..50]]; // Vincenzo Librandi, Dec 29 2012
    
  • Maple
    [seq(9*binomial(n+1,2), n=0..50)]; # Zerinvary Lajos, Nov 24 2006
  • Mathematica
    Table[(9/2)*n*(n+1), {n,0,50}] (* G. C. Greubel, Aug 22 2017 *)
  • PARI
    a(n)=9*n*(n+1)/2
    
  • Sage
    [9*binomial(n+1, 2) for n in (0..50)] # G. C. Greubel, May 20 2021

Formula

Numerators of sequence a[n, n-2] in (a[i, j])^2 where a[i, j] = binomial(i-1, j-1)/2^(i-1) if j<=i, 0 if j>i.
a(n) = (9/2)*n*(n+1).
a(n) = 9*C(n, 1) + 9*C(n, 2) (binomial transform of (0, 9, 9, 0, 0, ...)). - Paul Barry, Mar 15 2003
G.f.: 9*x/(1-x)^3.
a(-1-n) = a(n).
a(n) = 9*C(n+1,2), n>=0. - Zerinvary Lajos, Aug 06 2008
a(n) = a(n-1) + 9*n (with a(0)=0). - Vincenzo Librandi, Nov 19 2010
a(n) = A060544(n+1) - 1. - Omar E. Pol, Oct 03 2011
a(n) = A218470(9*n+8). - Philippe Deléham, Mar 27 2013
E.g.f.: (9/2)*x*(x+2)*exp(x). - G. C. Greubel, Aug 22 2017
a(n) = A060544(n+1) - 1. See Centroid Triangles illustration. - Leo Tavares, Dec 27 2021
From Amiram Eldar, Feb 15 2022: (Start)
Sum_{n>=1} 1/a(n) = 2/9.
Sum_{n>=1} (-1)^(n+1)/a(n) = 4*log(2)/9 - 2/9. (End)
From Amiram Eldar, Feb 21 2023: (Start)
Product_{n>=1} (1 - 1/a(n)) = -(9/(2*Pi))*cos(sqrt(17)*Pi/6).
Product_{n>=1} (1 + 1/a(n)) = 9*sqrt(3)/(4*Pi). (End)

Extensions

More terms from Patrick De Geest, Oct 15 1999

A001859 Triangular numbers plus quarter-squares: n*(n+1)/2 + floor((n+1)^2/4) (i.e., A000217(n) + A002620(n+1)).

Original entry on oeis.org

0, 2, 5, 10, 16, 24, 33, 44, 56, 70, 85, 102, 120, 140, 161, 184, 208, 234, 261, 290, 320, 352, 385, 420, 456, 494, 533, 574, 616, 660, 705, 752, 800, 850, 901, 954, 1008, 1064, 1121, 1180, 1240, 1302, 1365, 1430, 1496, 1564, 1633, 1704, 1776, 1850, 1925
Offset: 0

Views

Author

Keywords

Comments

Number of series-reduced planted trees with n+7 nodes and 3 internal nodes.
The trees enumerated with 3 internal nodes are of two types. Those with all internal nodes at different heights are enumerated by the triangular numbers. Those with two internal nodes at the same height are enumerated by the quarter squares. - Michael Somos, May 19 2000
Number of pairs (x,y) with x in {0,...,n}, y even in {0,...,2n}, and x < y. - Clark Kimberling, Jul 02 2012

Examples

			For n=1 we find 2 planted trees with 8 nodes, 3 of which are internal (i) and 5 are endpoints (e):
.e...e...e...e....e...e....
...i.......i........i...e..
.......i..............i...e
.......e................i..
........................e..
G.f. = 2*x + 5*x^2 + 10*x^3 + 16*x^4 + 24*x^5 + 33*x^6 + 44*x^7 + 56*x^8 + ...
		

References

  • John Riordan, personal communication.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

First differences of A045947.
Antidiagonal sums of array A003984.
Cf. A185212 (odd terms).

Programs

  • Haskell
    a001859 n = a000217 n + a002620 (n + 1)  -- Reinhard Zumkeller, Dec 20 2012
  • Maple
    A001859:=(-1-z^2-2*z^3+z^4)/(z+1)/(z-1)^3; # conjectured by Simon Plouffe in his 1992 dissertation; gives sequence with an additional leading 1
    with (combinat):seq(count(Partition((3*n+2)), size=3), n=0..50); # Zerinvary Lajos, Mar 28 2008
  • Mathematica
    With[{nn=60},Total/@Thread[{Accumulate[Range[0,nn]],Floor[Range[ nn+1]^2/4]}]] (* or *) LinearRecurrence[{2,0,-2,1},{0,2,5,10},60] (* Harvey P. Dale, Apr 01 2012 *)
  • PARI
    {a(n) = n + (3*n^2 + 1) \ 4};
    

Formula

a(n) = A000217(n)+A002620(n+1).
a(n) = n + floor( (3n^2+1)/4 ).
G.f.: (2*x+x^2)/((1-x)^2*(1-x^2)).
a(n) = a(n-1) + a(n-2) - a(n-3) + 3 = A002378(n) - A002620(n) = A006578(n-1) + A004526(n+1) - Henry Bottomley, Mar 08 2000
a(n) = A006578(-1-n) for all n in Z. - Michael Somos, May 10 2006
From Mitch Harris, Aug 22 2006: (Start)
a(n) = (6n^2 + 8n + 1 - (-1)^n)/8;
a(n) = Sum_{k=0..n} max(k, n-k). (End)
Starting (2, 5, 10, 16, 24, ...), = binomial transform of [2, 3, 2, -1, 2, -4, 8, -16, 32, ...]. - Gary W. Adamson, Nov 30 2007
a(0)=0, a(1)=2, a(2)=5, a(3)=10, a(n) = 2*a(n-1) + 0*a(n-2) - 2*a(n-3) + a(n-4). - Harvey P. Dale, Apr 01 2012
a(n) = 3*n*(n+1)/2 - A006578(n). - Clark Kimberling, Jul 02 2012
a(2*n) = A045944(n), a(2*n - 1) = A049450(n) for all n in Z. - Michael Somos, Nov 03 2014
0 = -6 + a(n) - 2*a(n+2) + a(n+4) for all n in Z. - Michael Somos, Nov 03 2014
0 = a(n)*(+a(n+1) - a(n+2)) + a(n+1)*(-3 - a(n+1) + a(n+2)) for all n in Z. - Michael Somos, Nov 03 2014
a(n) = Sum_{k=1..n} floor((n+k+2)/2). - Wesley Ivan Hurt, Mar 31 2017
Sum_{n>=1} 1/a(n) = 3/4 - Pi/(4*sqrt(3)) + 3*log(3)/4. - Amiram Eldar, May 28 2022
E.g.f.: (x*(7 + 3*x)*cosh(x) + (1 + 7*x + 3*x^2)*sinh(x))/4. - Stefano Spezia, Aug 22 2023

Extensions

Entry improved by Michael Somos

A154293 Integers of the form t/6, where t is a triangular number (A000217).

Original entry on oeis.org

0, 1, 6, 11, 13, 20, 35, 46, 50, 63, 88, 105, 111, 130, 165, 188, 196, 221, 266, 295, 305, 336, 391, 426, 438, 475, 540, 581, 595, 638, 713, 760, 776, 825, 910, 963, 981, 1036, 1131, 1190, 1210, 1271, 1376, 1441, 1463, 1530, 1645, 1716, 1740, 1813, 1938, 2015
Offset: 1

Views

Author

Keywords

Comments

Old definition was "Integers of the form: 1/6+2/6+3/6+4/6+5/6+...".
1/6 + 2/6 + 3/6 = 1, 1/6 + 2/6 + 3/6 + 4/6 + 5/6 + 6/6 + 7/6 + 8/6 = 6, ...
a(n) is the set of all integers k such that 48k+1 is a perfect square. The square roots of 48*a(n) + 1 = 1, 7, 17, 23, 25, ... = 8*(n-floor(n/4)) + (-1)^n. - Gary Detlefs, Mar 01 2010
Conjecture: A193828 divided by 2. - Omar E. Pol, Aug 19 2011
The above conjecture is correct. - Charles R Greathouse IV, Jan 02 2012
Quasipolynomial of order 4. - Charles R Greathouse IV, Jan 02 2012
It appears that the sequence terms occur as exponents in the expansion Sum_{n >= 0} x^n/Product_{k = 1..2*n} (1 + x^k) = 1 + x - x^6 - x^11 + x^13 + x^20 - x^35 - x^46 + + - - .... Cf. A218171. [added Jan 21 2025: this is correct - see Berndt et al., Theorem 3.2.] - Peter Bala, Feb 04 2021
From Peter Bala, Dec 12 2024 (Start)
The sequence terms occur as exponents in the expansion of F(x)*Product_{n >= 1} (1 - x^n) = Product_{n >= 1} (1 - x^n)*(1 + x^(4*n))^2*(1 + x^(4*n-2))*(1 + x^(8*n-3))*(1 + x^(8*n-5)) = 1 - x - x^6 + x^11 + x^13 - x^20 - x^35 + x^46 + x^50 - - + + ..., where F(x) is the g.f. of A069910.
It appears that the sequence terms occur as exponents in the expansion 1/(1 - x) * ( - x^2 + Sum_{n >= 1} x^floor((3*n+1)/2) * 1/Product_{k = 1..n} (1 + x^k) ) = x^6 + x^11 - x^13 - x^20 + x^35 + x^46 - - + + .... (End)
It appears that the sequence terms occur as exponents in the expansion Sum_{n >= 0} x^(n+1)/Product_{k = 1..2*n+2} (1 + x^k) = x - x^6 - x^11 + x^13 + x^20 - x^35 - x^46 + + - - .... - Peter Bala, Jan 21 2025

Examples

			G.f. = x^2 + 6*x^3 + 11*x^4 + 13*x^5 + 20*x^6 + 35*x^7 + 46*x^8 + ...
		

Crossrefs

Programs

  • Magma
    /* By definition: */ [t/6: n in [0..160] | IsIntegral(t/6) where t is n*(n+1)/2]; // Bruno Berselli, Mar 07 2016
  • Maple
    f:=n-> 8*(n-floor(n/4))+(-1)^n:seq((f(n)^2-1)/48,n=0..51); # Gary Detlefs, Mar 01 2010
  • Mathematica
    lst={}; s=0; Do[s+=n/6; If[Floor[s]==s, AppendTo[lst, s]], {n, 0, 7!}]; lst (* Orlovsky *)
    Join[{0}, Select[Table[Plus@@Range[n]/6, {n, 200}], IntegerQ]] (* Alonso del Arte, Jan 20 2012 *)
    LinearRecurrence[{3,-5,7,-7,5,-3,1},{0,1,6,11,13,20,35},60] (* Charles R Greathouse IV, Jan 20 2012 *)
    a[ n_] := (3 n^2 + If[ OddQ[ Quotient[ n + 1, 2]], -5 n + 2, -n]) / 4; (* Michael Somos, Feb 10 2015 *)
    a[ n_] := Module[{m = n}, If[ n < 1, m = 1 - n]; SeriesCoefficient[ x^2 (1 + 4 x + x^2) (1 - x^2) (1 - x^6) / ((1 - x)^2 (1 - x^3) (1 - x^4)^2), {x, 0, m}]]; (* Michael Somos, Feb 10 2015 *)
  • PARI
    a(n)=n--;(8*(n-n\4)+(-1)^n)^2\48 \\ Charles R Greathouse IV, Jan 02 2012
    
  • PARI
    {a(n) = (3*n^2 + if( (n+1)\2%2, -5*n+2,-n)) / 4}; /* Michael Somos, Feb 10 2015 */
    
  • PARI
    {a(n) = if( n<1, n = 1-n); polcoeff( x^2 * (1 + 4*x + x^2) * (1 - x^2) * (1 - x^6) / ((1 - x)^2 * (1 - x^3) * (1 - x^4)^2) + x * O(x^n), n)}; /* Michael Somos, Feb 10 2015 */
    

Formula

From R. J. Mathar, Jan 07 2009: (Start)
a(n) = A000217(A108752(n))/6.
G.f.: x^2*(x^2-x+1)*(x^2+4*x+1)/((1+x^2)^2*(1-x)^3) (conjectured). (End)
The conjectured g.f. is correct. - Charles R Greathouse IV, Jan 02 2012
a(n) = (f(n)^2-1)/48 where f(n) = 8*(n-floor(n/4))+(-1)^n, with offset 0, a(0)=0. - Gary Detlefs, Mar 01 2010
a(n) = a(1-n) for all n in Z. - Michael Somos, Oct 27 2012
G.f.: x^2 * (1 + 4*x + x^2) * (1 - x^2) * (1 - x^6) / ((1 - x)^2 * (1 - x^3) * (1 - x^4)^2). - Michael Somos, Feb 10 2015
Sum_{n>=2} 1/a(n) = 12 - (1+4/sqrt(3))*Pi. - Amiram Eldar, Mar 18 2022
a(n) = A069497(n)/6. - Hugo Pfoertner, Nov 19 2024
From Peter Bala, Jan 21 2025: (Start)
a(4*n) = 12*n^2 - n; a(4*n+1) = 12*n^2 + n;
a(4*n+2) = (3*n + 1)*(4*n + 1) = A033577(n); a(4*n+3) = (3*n + 2)*(4*n + 3) = A033578(n+1).
Let T(n) = n*(n + 1)/2 denote the n-th triangular number. Then
a(4*n) = (1/6) * T(12*n-1); a(4*n+1) = (1/6) * T(12*n);
a(4*n+2) = (1/6) * T(12*n+3); a(4*n+3) = (1/6) * T(12*n+8). (End)

Extensions

Definition rewritten by M. F. Hasler, Dec 31 2012

A246534 a(n) = Sum_{k=1..n} 2^(T(k)-1), where T(k)=k(k+1)/2 = A000217(k).

Original entry on oeis.org

0, 1, 5, 37, 549, 16933, 1065509, 135283237, 34495021605, 17626681066021, 18032025190548005, 36911520172609651237, 151152638972001256489509, 1238091191924352276155613733, 20283647694843594776223406899749, 664634281540152780046679753547072037
Offset: 0

Views

Author

M. F. Hasler, Aug 28 2014

Keywords

Comments

Similar to A181388, this occurs as binary encoding of a straight n-omino lying on the y-axis, when the grid points of the first quadrant (N x N, N={0,1,2,...}) are given the weight 2^k, with k=0, 1,2, 3,4,5, ... filled in by antidiagonals.
Numbers k such that the k-th composition in standard order (row k of A066099) is a reversed initial interval. - Gus Wiseman, Apr 02 2020

Examples

			Label the cells of an infinite square matrix with 0,1,2,3,... along antidiagonals:
  0 1 3 6 10 ...
  2 4 7 ...
  5 8 ...
  9 ...
  ....
Now any subset of these cells can be represented by the sum of 2 raised to the power written in the given cells. In particular, the subset consisting of the first cell in the first 1, 2, 3, ... rows is represented by 2^0, 2^0+2^2, 2^0+2^2+2^5, ...
		

Crossrefs

The version for prime (rather than binary) indices is A002110.
The non-strict generalization is A114994.
The non-reversed version is A164894.
Intersection of A333256 and A333217.
Partial sums of A036442.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    normQ[m_]:=Or[m=={},Union[m]==Range[Max[m]]];
    Select[Range[0,1000],normQ[stc[#]]&&Greater@@stc[#]&] (* Gus Wiseman, Apr 02 2020 *)
  • PARI
    t=0;vector(20,n,t+=2^(n*(n+1)/2-1)) \\ yields the vector starting with a[1]=1
    
  • PARI
    t=0;vector(20,n,if(n>1,t+=2^(n*(n-1)/2-1))) \\ yields the vector starting with 0
    
  • Python
    a = 0
    for n in range(1,17): print(a, end =', '); a += 1<<(n-1)*(n+2)//2 # Ya-Ping Lu, Jan 23 2024

A208244 Number of ways to write n as the sum of a practical number (A005153) and a triangular number (A000217).

Original entry on oeis.org

1, 2, 1, 2, 2, 1, 3, 2, 2, 1, 2, 3, 1, 2, 1, 3, 2, 3, 3, 1, 3, 3, 3, 2, 2, 2, 3, 2, 3, 4, 3, 2, 4, 3, 2, 3, 3, 3, 3, 4, 2, 4, 3, 2, 3, 4, 2, 4, 3, 1, 4, 3, 2, 3, 2, 4, 6, 2, 2, 4, 4, 1, 5, 4, 2, 4, 4, 3, 4, 4, 2, 4, 3, 2, 5, 3, 2, 4, 4, 2, 5, 4, 2, 6, 4, 3, 5, 3, 1, 6, 3, 3, 5, 5, 3, 5, 3, 3, 5, 4
Offset: 1

Views

Author

Zhi-Wei Sun, Jan 11 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>0.
The author has verified this for n up to 10^8, and also guessed the following refinement: If n>6 is not among 20, 104, 272, 464, 1664, then n can be written as p+q with p an even practical number and q a positive triangular number.
Somu and Tran (2024) proved the conjecture that a(n)>0 for n>0. - Duc Van Khanh Tran, Apr 24 2024

Examples

			a(15)=1 since 15=12+3 with 12 a practical number and 3 a triangular number.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=f[n]=FactorInteger[n]
    Pow[n_,i_]:=Pow[n,i]=Part[Part[f[n],i],1]^(Part[Part[f[n],i],2])
    Con[n_]:=Con[n]=Sum[If[Part[Part[f[n],s+1],1]<=DivisorSigma[1,Product[Pow[n,i],{i,1,s}]]+1,0,1],{s,1,Length[f[n]]-1}]
    pr[n_]:=pr[n]=n>0&&(n<3||Mod[n,2]+Con[n]==0)
    a[n_]:=a[n]=Sum[If[pr[n-k(k+1)/2]==True,1,0],{k,0,(Sqrt[8n+1]-1)/2}]
    Do[Print[n," ",a[n]],{n,1,100}]

A132399 Number of ordered ways of writing n = i + j, where i is 0 or a prime and j is a triangular number (A000217) >= 0.

Original entry on oeis.org

1, 1, 1, 3, 1, 2, 3, 1, 3, 1, 2, 2, 2, 3, 2, 2, 1, 4, 2, 2, 3, 2, 2, 4, 2, 1, 3, 1, 3, 3, 2, 2, 4, 2, 3, 2, 1, 2, 4, 3, 2, 4, 1, 3, 4, 2, 2, 6, 2, 2, 3, 2, 3, 4, 1, 2, 3, 3, 4, 4, 2, 1, 6, 1, 3, 3, 2, 3, 6, 3, 1, 4, 2, 4, 6, 1, 3, 4, 2, 4, 3, 3, 4, 5, 2, 3, 4, 1, 3, 7, 1, 2, 4, 2, 3, 5, 2, 4, 5, 2, 2, 3, 3, 4, 6
Offset: 0

Views

Author

N. J. A. Sloane, Mar 23 2008

Keywords

Comments

Based on a posting by Zhi-Wei Sun to the Number Theory Mailing List, Mar 23 2008, where he conjectures that a(n) > 0 except for n = 216.
Zhi-Wei Sun has offered a monetary reward for settling this conjecture.
No counterexample below 10^10. - D. S. McNeil
Note that A076768 contains 216 and the numbers n whose only representation has 0 instead of a prime; all other integers appear to be the sum of a prime and a triangular number. Except for n=216, there is no other n < 2*10^9 for which a(n)=0.
It is clear that a(t) > 0 for any triangular number t because we always have the representation t = t+0. Triangular numbers tend to have only a few representations. Hence by not plotting a(n) for triangular n, the plot (see link) more clearly shows how a(n) slowly increases as n increases. This is more evidence that 216 is the only exception.
216 is the only exception less than 10^12. Let p(n) be the least prime (or 0 if n is triangular) such that n = p(n) + t(n), where t(n) is a triangular number. For n < 10^12, the largest value of p(n) is only 2297990273, which occurs at n=882560134401. - T. D. Noe, Jan 23 2009

Examples

			0 = 0+0, so a(0) = 1,
3 = 3+0 = 2+1 = 0+3, so a(3) = 3.
8 = 7+1 = 5+3 = 2+6, so a(8) = 3.
		

Crossrefs

Cf. A065397 (primes p whose only representation as the sum of a prime and a triangular number is p+0), A090302 (largest prime p for each n).
Cf. A154752 (smallest prime p for each n). - T. D. Noe, Jan 19 2009

Extensions

Corrected, edited and extended by T. D. Noe, Mar 26 2008
Edited by N. J. A. Sloane, Jan 15 2009
Showing 1-10 of 4809 results. Next