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 15 results. Next

A368363 Partial sums of A136107.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 8, 9, 12, 13, 15, 17, 19, 21, 24, 25, 27, 30, 32, 34, 37, 39, 41, 43, 46, 48, 52, 53, 55, 59, 61, 62, 66, 68, 72, 74, 76, 78, 82, 84, 86, 90, 92, 94, 99, 101, 103, 105, 108, 111, 115, 117, 119, 123, 126, 128, 132, 134, 136, 140, 142, 144, 150, 151, 155, 158, 160, 162, 166, 170, 172, 175, 177, 179, 185
Offset: 1

Views

Author

N. J. A. Sloane, Jan 08 2024

Keywords

Comments

All three of A038548, A136107, and the present sequence have generating functions which resemble Lambert series.

Crossrefs

Programs

  • PARI
    f(n) = numdiv(n>>valuation(n, 2)) - ispolygonal(n, 3); \\ A136107
    a(n) = sum(k=1, n, f(k)); \\ Michel Marcus, Jan 08 2024

Formula

a(n) ~ n*(log(2*n)/2 + gamma - 1/2), where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Jan 08 2024

A001227 Number of odd divisors of n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Also (1) number of ways to write n as difference of two triangular numbers (A000217), see A136107; (2) number of ways to arrange n identical objects in a trapezoid. - Tom Verhoeff
Also number of partitions of n into consecutive positive integers including the trivial partition of length 1 (e.g., 9 = 2+3+4 or 4+5 or 9 so a(9)=3). (Useful for cribbage players.) See A069283. - Henry Bottomley, Apr 13 2000
This has been described as Sylvester's theorem, but to reduce ambiguity I suggest calling it Sylvester's enumeration. - Gus Wiseman, Oct 04 2022
a(n) is also the number of factors in the factorization of the Chebyshev polynomial of the first kind T_n(x). - Yuval Dekel (dekelyuval(AT)hotmail.com), Aug 28 2003
Number of factors in the factorization of the polynomial x^n+1 over the integers. See also A000005. - T. D. Noe, Apr 16 2003
a(n) = 1 if and only if n is a power of 2 (see A000079). - Lekraj Beedassy, Apr 12 2005
Number of occurrences of n in A049777. - Philippe Deléham, Jun 19 2005
For n odd, n is prime if and only if a(n) = 2. - George J. Schaeffer (gschaeff(AT)andrew.cmu.edu), Sep 10 2005
Also number of partitions of n such that if k is the largest part, then each of the parts 1,2,...,k-1 occurs exactly once. Example: a(9)=3 because we have [3,3,2,1],[2,2,2,2,1] and [1,1,1,1,1,1,1,1,1]. - Emeric Deutsch, Mar 07 2006
Also the number of factors of the n-th Lucas polynomial. - T. D. Noe, Mar 09 2006
Lengths of rows of triangle A182469;
Denoted by Delta_0(n) in Glaisher 1907. - Michael Somos, May 17 2013
Also the number of partitions p of n into distinct parts such that max(p) - min(p) < length(p). - Clark Kimberling, Apr 18 2014
Row sums of triangle A247795. - Reinhard Zumkeller, Sep 28 2014
Row sums of triangle A237048. - Omar E. Pol, Oct 24 2014
A069288(n) <= a(n). - Reinhard Zumkeller, Apr 05 2015
A000203, A000593 and this sequence have the same parity: A053866. - Omar E. Pol, May 14 2016
a(n) is equal to the number of ways to write 2*n-1 as (4*x + 2)*y + 4*x + 1 where x and y are nonnegative integers. Also a(n) is equal to the number of distinct values of k such that k/(2*n-1) + k divides (k/(2*n-1))^(k/(2*n-1)) + k, (k/(2*n-1))^k + k/(2*n-1) and k^(k/(2*n-1)) + k/(2*n-1). - Juri-Stepan Gerasimov, May 23 2016, Jul 15 2016
Also the number of odd divisors of n*2^m for m >= 0. - Juri-Stepan Gerasimov, Jul 15 2016
a(n) is odd if and only if n is a square or twice a square. - Juri-Stepan Gerasimov, Jul 17 2016
a(n) is also the number of subparts in the symmetric representation of sigma(n). For more information see A279387 and A237593. - Omar E. Pol, Nov 05 2016
a(n) is also the number of partitions of n into an odd number of equal parts. - Omar E. Pol, May 14 2017 [This follows from the g.f. Sum_{k >= 1} x^k/(1-x^(2*k)). - N. J. A. Sloane, Dec 03 2020]

Examples

			G.f. = q + q^2 + 2*q^3 + q^4 + 2*q^5 + 2*q^6 + 2*q^7 + q^8 + 3*q^9 + 2*q^10 + ...
From _Omar E. Pol_, Nov 30 2020: (Start)
For n = 9 there are three odd divisors of 9; they are [1, 3, 9]. On the other hand there are three partitions of 9 into consecutive parts: they are [9], [5, 4] and [4, 3, 2], so a(9) = 3.
Illustration of initial terms:
                              Diagram
   n   a(n)                         _
   1     1                        _|1|
   2     1                      _|1 _|
   3     2                    _|1  |1|
   4     1                  _|1   _| |
   5     2                _|1    |1 _|
   6     2              _|1     _| |1|
   7     2            _|1      |1  | |
   8     1          _|1       _|  _| |
   9     3        _|1        |1  |1 _|
  10     2      _|1         _|   | |1|
  11     2    _|1          |1   _| | |
  12     2   |1            |   |1  | |
...
a(n) is the number of horizontal line segments in the n-th level of the diagram. For more information see A286001. (End)
		

References

  • B. C. Berndt, Ramanujan's Notebooks Part V, Springer-Verlag, see p. 487 Entry 47.
  • L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 1, p. 306.
  • J. W. L. Glaisher, On the representations of a number as the sum of two, four, six, eight, ten, and twelve squares, Quart. J. Math. 38 (1907), 1-62 (see p. 4).
  • Ronald. L. Graham, Donald E. Knuth, and Oren Patashnik, Concrete Mathematics, 2nd ed. (Addison-Wesley, 1994), see exercise 2.30 on p. 65.
  • P. A. MacMahon, Combinatory Analysis, Cambridge Univ. Press, London and New York, Vol. 1, 1915 and Vol. 2, 1916; see vol. 2, p 28.

Crossrefs

If this sequence counts gapless sets by sum (by Sylvester's enumeration), these sets are ranked by A073485 and A356956. See also A055932, A066311, A073491, A107428, A137921, A333217, A356224, A356841, A356845.
Dirichlet inverse is A327276.

Programs

  • Haskell
    a001227 = sum . a247795_row
    -- Reinhard Zumkeller, Sep 28 2014, May 01 2012, Jul 25 2011
    
  • Magma
    [NumberOfDivisors(n)/Valuation(2*n, 2): n in [1..100]]; // Vincenzo Librandi, Jun 02 2019
    
  • Maple
    for n from 1 by 1 to 100 do s := 0: for d from 1 by 2 to n do if n mod d = 0 then s := s+1: fi: od: print(s); od:
    A001227 := proc(n) local a,d;
        a := 1 ;
        for d in ifactors(n)[2] do
            if op(1,d) > 2 then
                a := a*(op(2,d)+1) ;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, Jun 18 2015
  • Mathematica
    f[n_] := Block[{d = Divisors[n]}, Count[ OddQ[d], True]]; Table[ f[n], {n, 105}] (* Robert G. Wilson v, Aug 27 2004 *)
    Table[Total[Mod[Divisors[n], 2]],{n,105}] (* Zak Seidov, Apr 16 2010 *)
    f[n_] := Block[{d = DivisorSigma[0, n]}, If[ OddQ@ n, d, d - DivisorSigma[0, n/2]]]; Array[f, 105] (* Robert G. Wilson v *)
    a[ n_] := Sum[  Mod[ d, 2], { d, Divisors[ n]}]; (* Michael Somos, May 17 2013 *)
    a[ n_] := DivisorSum[ n, Mod[ #, 2] &]; (* Michael Somos, May 17 2013 *)
    Count[Divisors[#],?OddQ]&/@Range[110] (* _Harvey P. Dale, Feb 15 2015 *)
    (* using a262045 from A262045 to compute a(n) = number of subparts in the symmetric representation of sigma(n) *)
    (* cl = current level, cs = current subparts count *)
    a001227[n_] := Module[{cs=0, cl=0, i, wL, k}, wL=a262045[n]; k=Length[wL]; For[i=1, i<=k, i++, If[wL[[i]]>cl, cs++; cl++]; If[wL[[i]]Hartmut F. W. Hoft, Dec 16 2016 *)
    a[n_] := DivisorSigma[0, n / 2^IntegerExponent[n, 2]]; Array[a, 100] (* Amiram Eldar, Jun 12 2022 *)
  • PARI
    {a(n) = sumdiv(n, d, d%2)}; /* Michael Somos, Oct 06 2007 */
    
  • PARI
    {a(n) = direuler( p=2, n, 1 / (1 - X) / (1 - kronecker( 4, p) * X))[n]}; /* Michael Somos, Oct 06 2007 */
    
  • PARI
    a(n)=numdiv(n>>valuation(n,2)) \\ Charles R Greathouse IV, Mar 16 2011
    
  • PARI
    a(n)=sum(k=1,round(solve(x=1,n,x*(x+1)/2-n)),(k^2-k+2*n)%(2*k)==0) \\ Charles R Greathouse IV, May 31 2013
    
  • PARI
    a(n)=sumdivmult(n,d,d%2) \\ Charles R Greathouse IV, Aug 29 2013
    
  • Python
    from functools import reduce
    from operator import mul
    from sympy import factorint
    def A001227(n): return reduce(mul,(q+1 for p, q in factorint(n).items() if p > 2),1) # Chai Wah Wu, Mar 08 2021
  • SageMath
    def A001227(n): return len([1 for d in divisors(n) if is_odd(d)])
    [A001227(n) for n in (1..80)]  # Peter Luschny, Feb 01 2012
    

Formula

Dirichlet g.f.: zeta(s)^2*(1-1/2^s).
Comment from N. J. A. Sloane, Dec 02 2020: (Start)
By counting the odd divisors f n in different ways, we get three different ways of writing the ordinary generating function. It is:
A(x) = x + x^2 + 2*x^3 + x^4 + 2*x^5 + 2*x^6 + 2*x^7 + x^8 + 3*x^9 + 2*x^10 + ...
= Sum_{k >= 1} x^(2*k-1)/(1-x^(2*k-1))
= Sum_{k >= 1} x^k/(1-x^(2*k))
= Sum_{k >= 1} x^(k*(k+1)/2)/(1-x^k) [Ramanujan, 2nd notebook, p. 355.].
(This incorporates comments from Vladeta Jovovic, Oct 16 2002 and Michael Somos, Oct 30 2005.) (End)
G.f.: x/(1-x) + Sum_{n>=1} x^(3*n)/(1-x^(2*n)), also L(x)-L(x^2) where L(x) = Sum_{n>=1} x^n/(1-x^n). - Joerg Arndt, Nov 06 2010
a(n) = A000005(n)/(A007814(n)+1) = A000005(n)/A001511(n).
Multiplicative with a(p^e) = 1 if p = 2; e+1 if p > 2. - David W. Wilson, Aug 01 2001
a(n) = A000005(A000265(n)). - Lekraj Beedassy, Jan 07 2005
Moebius transform is period 2 sequence [1, 0, ...] = A000035, which means a(n) is the Dirichlet convolution of A000035 and A057427.
a(n) = A113414(2*n). - N. J. A. Sloane, Jan 24 2006 (corrected Nov 10 2007)
a(n) = A001826(n) + A001842(n). - Reinhard Zumkeller, Apr 18 2006
Sequence = M*V = A115369 * A000005, where M = an infinite lower triangular matrix and V = A000005, d(n); as a vector: [1, 2, 2, 3, 2, 4, ...]. - Gary W. Adamson, Apr 15 2007
Equals A051731 * [1,0,1,0,1,...]; where A051731 is the inverse Mobius transform. - Gary W. Adamson, Nov 06 2007
a(n) = A000005(n) - A183063(n).
a(n) = d(n) if n is odd, or d(n) - d(n/2) if n is even, where d(n) is the number of divisors of n (A000005). (See the Weisstein page.) - Gary W. Adamson, Mar 15 2011
Dirichlet convolution of A000005 and A154955 (interpreted as a flat sequence). - R. J. Mathar, Jun 28 2011
a(A000079(n)) = 1; a(A057716(n)) > 1; a(A093641(n)) <= 2; a(A038550(n)) = 2; a(A105441(n)) > 2; a(A072502(n)) = 3. - Reinhard Zumkeller, May 01 2012
a(n) = 1 + A069283(n). - R. J. Mathar, Jun 18 2015
a(A002110(n)/2) = n, n >= 1. - Altug Alkan, Sep 29 2015
a(n*2^m) = a(n*2^i), a((2*j+1)^n) = n+1 for m >= 0, i >= 0 and j >= 0. a((2*x+1)^n) = a((2*y+1)^n) for positive x and y. - Juri-Stepan Gerasimov, Jul 17 2016
Conjectures: a(n) = A067742(n) + 2*A131576(n) = A082647(n) + A131576(n). - Omar E. Pol, Feb 15 2017
a(n) = A000005(2n) - A000005(n) = A099777(n)-A000005(n). - Danny Rorabaugh, Oct 03 2017
L.g.f.: -log(Product_{k>=1} (1 - x^(2*k-1))^(1/(2*k-1))) = Sum_{n>=1} a(n)*x^n/n. - Ilya Gutkovskiy, Jul 30 2018
G.f.: (psi_{q^2}(1/2) + log(1-q^2))/log(q), where psi_q(z) is the q-digamma function. - Michael Somos, Jun 01 2019
a(n) = A003056(n) - A238005(n). - Omar E. Pol, Sep 12 2021
Sum_{k=1..n} a(k) ~ n*log(n)/2 + (gamma + log(2)/2 - 1/2)*n, where gamma is Euler's constant (A001620). - Amiram Eldar, Nov 27 2022
Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k)/A000005(k) = log(2) (A002162). - Amiram Eldar, Mar 01 2023
a(n) = Sum_{i=1..n} (-1)^(i+1)*A135539(n,i). - Ridouane Oudra, Apr 13 2023

A335616 a(n) is twice the number of partitions of n into consecutive parts, minus the number of partitions of n into consecutive parts that contain 1 as a part.

Original entry on oeis.org

1, 2, 3, 2, 4, 3, 4, 2, 6, 3, 4, 4, 4, 4, 7, 2, 4, 6, 4, 4, 7, 4, 4, 4, 6, 4, 8, 3, 4, 8, 4, 2, 8, 4, 8, 5, 4, 4, 8, 4, 4, 8, 4, 4, 11, 4, 4, 4, 6, 6, 8, 4, 4, 8, 7, 4, 8, 4, 4, 8, 4, 4, 12, 2, 8, 7, 4, 4, 8, 8, 4, 6, 4, 4, 12, 4, 8, 7, 4, 4, 10, 4, 4, 8, 8, 4, 8, 4, 4, 12, 7, 4, 8, 4, 8, 4, 4, 6, 12, 6
Offset: 1

Views

Author

Omar E. Pol, Oct 02 2020

Keywords

Comments

a(n) is twice the number of partitions of n into consecutive parts, minus the number of partitions of n into distinct parts such that the greatest part equals the number of all parts.
For a visualization of the sequence, consider a diagram formed for infinitely many double staircases as shown in the Example section.
a(n) is the number of horizontal line segments (or steps) that are only in the n-th level of the structure, starting from the top.
The total length of all vertical line segments that are adjacent and below the steps of the n-th level of the structure equals twice the total number of parts in all partitions of n into consecutive parts.
Note that in the n-th double staircase the top step is located in the level A000217(n), n >= 1, every horizontal line segment has length 1, and every vertical line segment has length n.
a(n) is also the number of horizontal line segments of length 1 or 2 in the n-th level of the similar diagram used to represent the sequence A237593 and other isosceles triangles related to A237593.
a(n) is odd if and only if n is a nonzero triangular number (A000217).
Double-staircases theorem of the sum of divisors: the total number of steps from level n to the top of all the odd-indexed double staircases that have at least one step in the level n, minus the total number of steps from the level n to the top of all the even-indexed double staircases that have at least one step in the level n equals sigma(n) = A000203(n).
The above theorem shows a symmetry of sigma in accordance with the symmetric Dyck Paths described in A237593 and with the pyramid described in A245092.
For the connection with the partitions into consecutive integers see also A196020, since we can see here that A196020(n,k) is also the number of steps in the first n levels of the k-th double staircase that has at least one step in the n-th level of the diagram, otherwise A196020(n,k) = 0. Also, it is the width of the mentioned staircase in n-th level of the diagram.
It appears that odd primes (A065091) are also the levels where there are steps in the staircases 1 and 2, but no step from other staircases.
It appears that powers of 2 (A000079) are also the levels where there are only one or two steps in total.
This sequence could be related to several other sequences (see the Crossrefs section of A262626).

Examples

			Illustration of initial terms:
n   a(n)                               Diagram
                                          _
1     1                                 _|1|_
2     2                               _|1 _ 1|_
3     3                             _|1  |1|  1|_
4     2                           _|1   _| |_   1|_
5     4                         _|1    |1 _ 1|    1|_
6     3                       _|1     _| |1| |_     1|_
7     4                     _|1      |1  | |  1|      1|_
8     2                   _|1       _|  _| |_  |_       1|_
9     6                 _|1        |1  |1 _ 1|  1|        1|_
10    3               _|1         _|   | |1| |   |_         1|_
11    4             _|1          |1   _| | | |_   1|          1|_
12    4           _|1           _|   |1  | |  1|   |_           1|_
13    4         _|1            |1    |  _| |_  |    1|            1|_
14    4       _|1             _|    _| |1 _ 1| |_    |_             1|_
15    7     _|1              |1    |1  | |1| |  1|    1|              1|_
16    2    |1                |     |   | | | |   |     |                1|
...
For n = 6 (above), the total number of steps in all double staircases that have at least one step in the 6th level of the structure is equal to 3, since there are two steps in the first double staircase, there are no steps in the second double staircase, and there is only one step in the third double staircase, so a(3) = 2 + 0 + 1 = 3.
From the theorem (see comments) for n = 6, let s(k) = A196020(6,k) be the total number of steps from level n to the top, in the k-th double staircase that has at least a step in the 6th level of the structure, otherwise s(k) = 0. We have that s(1) = 11, s(2) = 0 and s(3) = 1. So the alternating sum is 11 - 0 + 1 = 12, which equals sigma(6) = 1 + 2 + 3 + 6 = 12.
Note that to evaluate sigma(n), it is sufficient to have only the n-th level of the diagram, since the width of the base level of a double staircase equals the number of its steps. See below:
For n = 6 the 6th level of the above diagram looks like this:
                                _         _         _
                               |1      | |1| |      1|
.
Width of the 1st staircase:    |<-------- 11 ------->|
.
Width of the 3rd staircase:          --->|1|<---
.
The width of the first double staircase is 11, the width of the second double staircase does not count, and the width of the third double staircase is 1, so the alternating sum is 11 - 0 + 1 = 12 = sigma(6).
For n = 15 the alternating sum is 29 - 13 + 7 - 0 + 1 = 24 = sigma(15).
For n = 16 the alternating sum is 31 -  0 + 0 - 0 + 0 = 31 = sigma(16).
For more information about these alternating sums see A196020.
		

Crossrefs

Programs

  • Maple
    N:= 100:
    S := convert(series( add( x^(n*(n+1)/2)*(1 + x^n)/(1 - x^n), n = 1..floor(sqrt(2*N)) ), x, N+1 ), polynom):
    seq(coeff(S, x, n), n = 1..N); # Peter Bala, Jan 20 2021
  • Mathematica
    A335616[n_]:=2DivisorSigma[0,n/2^IntegerExponent[n,2]]-Boole[IntegerQ[(Sqrt[8n+1]-1)/2]];Array[A335616,100] (* Paolo Xausa, Sep 03 2023 *)

Formula

a(n) = 2*A001227(n) - A010054(n).
a(n) = A054844(n) - A010054(n).
a(n) = 2*A136107(n) + A010054(n). - Omar E. Pol, Nov 27 2020
G.f.: Sum_{n >= 1} x^(n*(n+1)/2)*(1 + x^n)/(1 - x^n). Cf. A000005 with g.f. Sum_{n >= 1} x^(n^2)*(1 + x^n)/(1 - x^n). - Peter Bala, Jan 20 2021

Extensions

Simpler definition from Omar E. Pol, Nov 27 2020

A356845 Odd numbers with gapless prime indices.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 23, 25, 27, 29, 31, 35, 37, 41, 43, 45, 47, 49, 53, 59, 61, 67, 71, 73, 75, 77, 79, 81, 83, 89, 97, 101, 103, 105, 107, 109, 113, 121, 125, 127, 131, 135, 137, 139, 143, 149, 151, 157, 163, 167, 169, 173, 175, 179, 181, 191
Offset: 1

Views

Author

Gus Wiseman, Sep 03 2022

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
A sequence is gapless if it covers an interval of positive integers.

Examples

			The terms together with their prime indices begin:
    1: {}
    3: {2}
    5: {3}
    7: {4}
    9: {2,2}
   11: {5}
   13: {6}
   15: {2,3}
   17: {7}
   19: {8}
   23: {9}
   25: {3,3}
   27: {2,2,2}
   29: {10}
   31: {11}
   35: {3,4}
   37: {12}
   41: {13}
   43: {14}
		

Crossrefs

Consists of the odd terms of A073491.
These partitions are counted by A264396.
The strict case is A294674, counted by A136107.
The version for compositions is A356843, counted by A251729.
A001221 counts distinct prime factors, sum A001414.
A056239 adds up prime indices, row sums of A112798, lengths A001222.
A356069 counts gapless divisors, initial A356224 (complement A356225).
A356230 ranks gapless factorization lengths, firsts A356603.
A356233 counts factorizations into gapless numbers.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    nogapQ[m_]:=Or[m=={},Union[m]==Range[Min[m],Max[m]]];
    Select[Range[1,100,2],nogapQ[primeMS[#]]&]

A138796 Least possible k > 0 with T(k) - T(j) = n, j > 0, where T(i) > 0 are the triangular numbers A000217.

Original entry on oeis.org

2, 3, 4, 3, 6, 4, 8, 4, 10, 6, 5, 7, 5, 6, 16, 9, 6, 10, 6, 8, 7, 12, 9, 7, 8, 7, 28, 15, 8, 16, 32, 8, 10, 8, 13, 19, 11, 9, 10, 21, 9, 22, 9, 10, 13, 24, 17, 10, 12, 11, 10, 27, 10, 13, 11, 12, 16, 30, 11, 31, 17, 11, 64, 11, 18, 34, 12, 14, 13, 36, 12, 37, 20, 12, 13, 12, 21, 40, 18
Offset: 2

Views

Author

Peter Pein (petsie(AT)dordos.net), Mar 30 2008

Keywords

Comments

For T(k) see A138797, for j see A138798 and for T(j) see A138799.
The number of ways n can be written as difference of two triangular numbers is sequence A136107
Note that n = t(k)-t(j) implies 2n = (k-j)(k+j+1), where (k-j) and (k+j+1) are of opposite parity. Let d be the odd element of { k-j, k+j+1 }. Then d is an odd divisor of n and k = ( d + 2n/d - 1 ) / 2. Therefore a(n) = ( min{ d + 2n/d } - 1 ) / 2 where d runs through all odd divisors of n, except perhaps (sqrt(8*n+1) +- 1)/2 which correspond to j=0. See PARI program. The restriction that j > 0 seems artificial. If it is removed we get A212652. - Max Alekseyev, Mar 31 2008

Examples

			a(30)=8, because 30 = T(30) - T(29) = T(11) - T(8) = T(9) - T(5) = T(8) - T(3) and 8 is the least index of the minuends.
		

Crossrefs

Programs

  • Mathematica
    T=#(#+1)/2&;Min[k/.{ToRules[Reduce[{T[k]-T[j]\[Equal]#,0
    				
  • PARI
    { a(n) = local(m); m=2*n+1; fordiv(n/2^valuation(n,2),d,if((2*d+1)^2!=8*n+1&&(2*d-1)^2!=8*n+1,m=min(m,d+(2*n)\d))); (m-1)\2 }
    vector(100,n,a(n)) \\ Max Alekseyev, Mar 31 2008

A136108 The least number k such that there are n different representations of k as the difference of two positive triangular numbers.

Original entry on oeis.org

1, 2, 5, 9, 27, 45, 63, 105, 135, 225, 405, 630, 315, 531441, 3645, 1485, 945, 4851, 1575, 13041, 2835, 18225, 295245, 4095, 3465, 50625, 2657205, 11025, 25515, 52650, 14175, 17955, 10395, 1476225, 215233605, 97020, 17325, 150094635296999121
Offset: 0

Views

Author

Keywords

Comments

The first occurrence of n in A136107

Examples

			a(0)=1 because there are no two positive triangular numbers whose difference is 1,
a(1)=2 because 3-1 = 2,
a(2)=5 because 6-1 = 15-10 = 5,
a(3)=9 because 10-1 = 15-6 = 45-36 = 9, etc.
		

Crossrefs

Cf. A136107.

Programs

  • Mathematica
    f[n_] := f[n] = Block[{c = 0, k = 1}, While[k < n, If[IntegerQ[Sqrt[8 n + 4 k (k + 1) + 1]], c++ ]; k++ ]; c]; Table[ Position[ Table[ f@i, {i, 54000}], n, 1, 1], {n, 0, 30}] // Flatten

Extensions

6 new terms from Donovan Johnson, Jan 21 2009
a(37) from Max Alekseyev, May 13 2009

A138797 Least possible T(k) with T(k)-T(j)=n, where T(i)>0 are the triangular numbers A000217.

Original entry on oeis.org

3, 6, 10, 6, 21, 10, 36, 10, 55, 21, 15, 28, 15, 21, 136, 45, 21, 55, 21, 36, 28, 78, 45, 28, 36, 28, 406, 120, 36, 136, 528, 36, 55, 36, 91, 190, 66, 45, 55, 231, 45, 253, 45, 55, 91, 300, 153, 55, 78, 66, 55, 378, 55, 91, 66, 78, 136, 465, 66, 496, 153, 66, 2080, 66, 171
Offset: 2

Views

Author

Peter Pein (petsie(AT)dordos.net), Mar 30 2008

Keywords

Comments

For k see A138796, for j see A138798 and for T(j) see A138799.
The number of ways n can be written as difference of two triangular numbers is sequence A136107

Examples

			a(4)=10 because T(A138796(4))=10.
		

Crossrefs

Programs

  • Mathematica
    T=#(#+1)/2&;T[Min[k/.{ToRules[Reduce[{T[k]-T[j]\[Equal]#,0
    				

A138798 Values of j corresponding to least possible k>0 with T(k)-T(j)=n, where T(i)>0 are the triangular numbers A000217.

Original entry on oeis.org

1, 2, 3, 1, 5, 2, 7, 1, 9, 4, 2, 5, 1, 3, 15, 7, 2, 8, 1, 5, 3, 10, 6, 2, 4, 1, 27, 13, 3, 14, 31, 2, 6, 1, 10, 17, 7, 3, 5, 19, 2, 20, 1, 4, 9, 22, 14, 3, 7, 5, 2, 25, 1, 8, 4, 6, 12, 28, 3, 29, 13, 2, 63, 1, 14, 32, 4, 8, 6, 34, 3, 35, 16, 2, 5, 1, 17, 38, 13, 4, 18, 40, 6, 3, 19, 11, 2, 43, 1
Offset: 2

Views

Author

Peter Pein (petsie(AT)dordos.net), Mar 30 2008

Keywords

Comments

For k see A138796, for T(k) see A138797 and for T(j) see A138799.
The number of ways n can be written as difference of two triangular numbers is sequence A136107

Examples

			a(30)=3 because 30 = T(30)-T(29)=T(11)-T(8)=T(9)-T(5)=T(8)-T(3) and 3 is the least index of the subtrahends.
		

Crossrefs

Programs

  • Mathematica
    T=#(#+1)/2&;Sort[{k,j}/.{ToRules[Reduce[{T[k]-T[j]\[Equal]#,0
    				

A138799 Values of T(j) corresponding to least possible T(k) with T(k)-T(j)=n, where T(i)>0 are the triangular numbers A000217.

Original entry on oeis.org

1, 3, 6, 1, 15, 3, 28, 1, 45, 10, 3, 15, 1, 6, 120, 28, 3, 36, 1, 15, 6, 55, 21, 3, 10, 1, 378, 91, 6, 105, 496, 3, 21, 1, 55, 153, 28, 6, 15, 190, 3, 210, 1, 10, 45, 253, 105, 6, 28, 15, 3, 325, 1, 36, 10, 21, 78, 406, 6, 435, 91, 3, 2016, 1, 105, 528, 10, 36, 21, 595, 6, 630
Offset: 2

Views

Author

Peter Pein (petsie(AT)dordos.net), Mar 30 2008

Keywords

Comments

For k see A138796, for T(k) see A138797 and for j see A138798.
The number of ways n can be written as difference of two triangular numbers is sequence A136107

Examples

			a(30)=6 because 30 = T(30)-T(29)=T(11)-T(8)=T(9)-T(5)=T(8)-T(3) and T(3)=6 is the least minuend.
		

Crossrefs

Programs

  • Mathematica
    T=#(#+1)/2&;T[Sort[{k,j}/.{ToRules[Reduce[{T[k]-T[j]\[Equal]#,0
    				

A351284 Irregular triangle read by rows: the n-th row gives the x-values of the solutions of the equation 2*(x - 1)*y - (x - 3)*x = 2*n for 0 < x <= y.

Original entry on oeis.org

2, 2, 2, 2, 3, 2, 2, 3, 2, 2, 3, 4, 2, 2, 3, 2, 4, 2, 3, 2, 5, 2, 3, 4, 2, 2, 3, 2, 4, 5, 2, 3, 2, 6, 2, 3, 4, 2, 5, 2, 3, 2, 4, 2, 3, 6, 2, 5, 2, 3, 4, 7, 2, 2, 3, 2, 4, 5, 6, 2, 3, 2, 2, 3, 4, 7, 2, 5, 2, 3, 6, 8, 2, 4, 2, 3, 2, 5, 2, 3, 4, 7, 2, 6, 2, 3, 2, 4, 5, 8
Offset: 3

Views

Author

Stefano Spezia, Feb 06 2022

Keywords

Comments

Equivalently, the n-th row gives the column indices corresponding to n in the triangle A351153.

Examples

			Triangle begins:
  2;
  2;
  2;
  2, 3;
  2;
  2, 3;
  2;
  2, 3, 4;
  ...
		

Crossrefs

Cf. A341829, A351153, A136107 (row length or solutions number), A351285 (y-values).

Programs

  • Mathematica
    Table[r={};For[d=1,d
    				
Showing 1-10 of 15 results. Next