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

A049778 a(n) = Sum_{k=1..floor((n+1)/2)} T(n,2k-1), array T as in A049777.

Original entry on oeis.org

1, 3, 9, 17, 32, 50, 78, 110, 155, 205, 271, 343, 434, 532, 652, 780, 933, 1095, 1285, 1485, 1716, 1958, 2234, 2522, 2847, 3185, 3563, 3955, 4390, 4840, 5336, 5848, 6409, 6987, 7617, 8265, 8968, 9690, 10470, 11270, 12131
Offset: 1

Views

Author

Keywords

Comments

Principal diagonal of the convolution array A213849. - Clark Kimberling, Jul 04 2012

Crossrefs

Programs

  • GAP
    List([1..50], n-> (3 +10*n +18*n^2 +8*n^3 -3*(-1)^n*(1+2*n))/48); # G. C. Greubel, Dec 12 2019
  • Magma
    [(3 +10*n +18*n^2 +8*n^3 -3*(-1)^n*(1+2*n))/48: n in [1..50]]; // G. C. Greubel, Dec 12 2019
    
  • Maple
    seq( (3 +10*n +18*n^2 +8*n^3 -3*(-1)^n*(1+2*n))/48, n=1..50); # G. C. Greubel, Dec 12 2019
  • Mathematica
    Table[Floor[(n+1)/2]*(3*(n-1)*(n+2) -(1+Floor[(n+1)/2])*(4*Floor[(n+1)/2]-7))/6, {n,50}] (* G. C. Greubel, Dec 12 2019 *)
  • PARI
    vector(50, n, (3 +10*n +18*n^2 +8*n^3 -3*(-1)^n*(1+2*n))/48) \\ G. C. Greubel, Dec 12 2019
    
  • Sage
    [(3 +10*n +18*n^2 +8*n^3 -3*(-1)^n*(1+2*n))/48 for n in (1..50)] # G. C. Greubel, Dec 12 2019
    

Formula

G.f.: x*(1 + x + 2*x^2)/((1-x)^4*(1+x)^2). Pairwise sums of A023855. - Ralf Stephan, May 06 2004
a(n) = Sum_{k=1..n} k*ceiling(k/2). - Vladeta Jovovic, Apr 29 2006
Row sums of triangle A095800^2. - Gary W. Adamson, Dec 12 2007
a(n) = (3 + 10*n + 18*n^2 + 8*n^3 - 3*(-1)^n*(1 + 2*n))/48. - R. J. Mathar, Mar 03 2011
From G. C. Greubel, Dec 12 2019: (Start)
a(n) = m*(3*(n-1)*(n+2) - (m+1)*(4*m-7))/6, where m = floor((n+1)/2).
E.g.f.: ( (3+36*x+42*x^2+8*x^3)*exp(x) - 3*(1-2*x)*exp(-x) )/48. (End)

A049779 a(n) = Sum_{k=1..floor(n/2)} T(n, 2k), array T as in A049777.

Original entry on oeis.org

2, 5, 13, 23, 41, 62, 94, 130, 180, 235, 307, 385, 483, 588, 716, 852, 1014, 1185, 1385, 1595, 1837, 2090, 2378, 2678, 3016, 3367, 3759, 4165, 4615, 5080, 5592, 6120, 6698, 7293, 7941, 8607, 9329, 10070, 10870, 11690, 12572, 13475, 14443, 15433
Offset: 2

Views

Author

Keywords

Comments

a(n) is coefficient of x^2 in -Product_{j=1..n} (1 + (-1)^j*j*x). - Robert Israel, Jun 08 2015

Programs

  • GAP
    List([2..50], n-> (8*n^3 +6*n^2 -2*n -3 +3*(-1)^n*(2*n+1))/48); # G. C. Greubel, Dec 12 2019
  • MATLAB
    a = @(n) 1/4*(n*(n+1)*(4*n-1)/6 + (-1)^n*floor((n+1)/2)); % Néstor Jofré, Apr 24 2017
    
  • Magma
    [n^3/6+n^2/8-n/24-1/16+(-1)^n*(n/8+1/16): n in [2..50]]; // Vincenzo Librandi, Apr 25 2017
    
  • Maple
    seq( (8*n^3 +6*n^2 -2*n -3 +3*(-1)^n*(2*n+1))/48, n=2..50); # G. C. Greubel, Dec 12 2019
  • Mathematica
    T[m_, n_]:=(m+n)(m-n+1)/2; Table[Sum[T[n, 2k], {k, Floor[n/2]}], {n, 2, 50}] (* Indranil Ghosh, Apr 24 2017 *)
    LinearRecurrence[{2, 1, -4, 1, 2, -1}, {2, 5, 13, 23, 41, 62}, 50] (* Vincenzo Librandi, Apr 25 2017 *)
  • PARI
    a(n)=(4*n^3 + 3*n^2 + 2*n - if(n%2,6*n+3))/24 \\ Charles R Greathouse IV, Jun 08 2015
    
  • Sage
    [(8*n^3 +6*n^2 -2*n -3 +3*(-1)^n*(2*n+1))/48 for n in (2..50)] # G. C. Greubel, Dec 12 2019
    

Formula

G.f.: x^2*(2+x+x^2)/((1-x)^4*(1+x)^2). Pairwise sums of A023856. - Ralf Stephan, May 06 2004
a(n) = Sum_{k=1..n} k*floor(k/2). - Vladeta Jovovic, Apr 29 2006
a(n) = (8*n^3 + 6*n^2 - 2*n - 3 + 3*(-1)^n *(2*n+1))/48. - Robert Israel, Jun 08 2015
a(n) = (n*(n+1)*(4*n-1) + 6*(-1)^n*floor((n+1)/2))/24. - Néstor Jofré, Apr 24 2017
E.g.f.: ( (8*x^3 + 30*x^2 + 12*x - 3)*exp(x) + 3*(1-2*x)*exp(-x) )/48. - G. C. Greubel, Dec 12 2019

Extensions

More terms from Ralf Stephan, May 06 2004

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

A095794 a(n) = A005449(n) - 1, where A005449 = second pentagonal numbers.

Original entry on oeis.org

1, 6, 14, 25, 39, 56, 76, 99, 125, 154, 186, 221, 259, 300, 344, 391, 441, 494, 550, 609, 671, 736, 804, 875, 949, 1026, 1106, 1189, 1275, 1364, 1456, 1551, 1649, 1750, 1854, 1961, 2071, 2184, 2300, 2419, 2541, 2666, 2794, 2925, 3059, 3196, 3336, 3479, 3625
Offset: 1

Views

Author

Gary W. Adamson, Jun 06 2004, Jul 08 2007

Keywords

Comments

Row sums of triangle A131414.
Equals binomial transform of (1,5,3,0,0,0,...). Equals A051340 * (1,2,3,...).
a(n) is essentially the case -1 of the polygonal numbers. The polygonal numbers are defined as P_k(n) = Sum_{i=1..n} (k-2)*i-(k-3). Thus P_{-1}(n) = n*(5-3*n)/2 and a(n) = -P_{-1}(n+2). - Peter Luschny, Jul 08 2011
Beginning with n=2, a(n) is the falling diagonal starting with T(1,3) in A049777 (as a square array). - Bob Selcoe, Oct 27 2014

Examples

			a(4) = 25 = A005449(4) - 1.
a(5) = 39 = (3/2)*5^2 + (1/2)*5 - 1.
a(7) = 76 = 3*56 - 3*39 + 25.
a(5) = 39 = right term of M^4 * [1 1 1] = [1 5 39].
For n = 8, a(8) = 8*22 - (1+4+7+10+13+16+19) - 7 = 99. - _Bruno Berselli_, May 04 2010
		

Crossrefs

Programs

Formula

a(n) = (3/2)*n^2 + (1/2)*n - 1 = (n+1)*(3*n-2)/2.
a(n) = A126890(n+1,n-2) for n>1. - Reinhard Zumkeller, Dec 30 2006, corrected by Jason Bandlow (jbandlow(AT)math.upenn.edu), Feb 28 2009
G.f.: x*(-1-3*x+x^2)/(-1+x)^3 = 1 - 3/(-1+x)^3 - 4/(-1+x)^2. - R. J. Mathar, Nov 19 2007
a(n) = n*A016777(n-1) - Sum_{i=1..n-2} A016777(i) - (n-1) = (n+1)*(3*n-2)/2. - Bruno Berselli, May 04 2010
a(n) = 3*n + a(n-1)-1, for n>1, a(1)=1. - Vincenzo Librandi, Nov 16 2010
a(n) = A115067(-n). - Bruno Berselli, Sep 02 2011
From Wesley Ivan Hurt, Dec 22 2015: (Start)
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n>3.
a(n) = Sum_{i=n..2n} (i-1). (End)
E.g.f.: 1 + exp(x)*(3*x^2 + 4*x - 2)/2. - Stefano Spezia, Jun 04 2021
From Amiram Eldar, Feb 22 2022: (Start)
Sum_{n>=1} 1/a(n) = Pi/(5*sqrt(3)) + 3*log(3)/5 + 2/5.
Sum_{n>=1} (-1)^(n+1)/a(n) = 2*Pi/(5*sqrt(3)) + 4*log(2)/5 - 2/5. (End)
a(n) = A000217(n) + A000290(n) - 1. - Leo Tavares, Jun 02 2023

Extensions

Corrected and extended by R. J. Mathar, Jun 23 2006

A111774 Numbers that can be written as a sum of at least three consecutive positive integers.

Original entry on oeis.org

6, 9, 10, 12, 14, 15, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 33, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 60, 62, 63, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 98, 99, 100, 102
Offset: 1

Views

Author

Jaap Spies, Aug 15 2005

Keywords

Comments

In this sequence there are no (odd) primes and there are no powers of 2.
So we have only three kinds of natural numbers: the odd primes, the powers of 2 and the numbers that can be represented as a sum of at least three consecutive integers.
Odd primes can only be written as a sum of two consecutive integers. Powers of 2 do not have a representation as a sum of k consecutive integers (other than the trivial n=n, for k=1).
Numbers of the form (x*(x+1)-y*(y+1))/2 for nonnegative integers x,y with x-y >= 3. - Bob Selcoe, Feb 21 2014
Numbers of the form (x + 1)*(x + 2*y)/2 for integers x,y with x >= 2 and y >= 1. For y = 1 only triangular numbers (A000217) >= 6 occur. - Ralf Steiner, Jun 27 2019
From Ralf Steiner, Jul 09 2019: (Start)
If k >= 1 sequences are c_k(n) = c_k(n - 1) + n + k - 1, c_k(0) = 0, means c_k(n) = n*(n + 2*k - 1)/2: A000217, A000096, A055998, A055999, A056000, ... then this sequence is the union of c_k(n), n >= 3. (End)
From Wolfdieter Lang, Oct 28 2020: (Start)
This sequence gives all positive integers that have at least one odd prime as proper divisor. The proof follows from the first two comments.
The set {a(n)}_{n>=1} equals the set {k positive integer : floor(k/2) - delta(k) >= 1}, where delta(k) = A055034(k). Proof: floor(k/2) gives the number of positive odd numbers < k, and delta(k), gives the number of positive odd numbers coprime to k. delta(1) = 1 but 1 is not < 1, therefore k = 1 is not a member of this set. Hence a member >= 2 of this set has at least one odd number > 1 and < k missing in the set of odd numbers relative prime to k. Therefore there exists at least one odd prime < k dividing k. (End)
For the multiplicity of a(n) see A338428, obtained from triangle A337940 (the array is given Bob Selcoe as example below, and in the Ralf Steiner comment above). - Wolfdieter Lang, Dec 09 2020

Examples

			a(1)=6 because 6 is the first number that can be written as a sum of three consecutive positive integers: 6 = 1+2+3.
From _Bob Selcoe_, Feb 23 2014: (Start)
Let the top row of an array be A000217(n). Let the diagonals (reading down and left) be A000217(n)-A000217(1),  A000217(n)-A000217(2), A000217(n)-A000217(3)..., A000217(n)-A000217(n-3).  This is A049777 read as a square array, starting with the third column. The array begins as follows:
   6 10 15 21 28 36 45 55 66
   9 14 20 27 35 44 54 65
  12 18 25 33 42 52 63
  15 22 30 39 49 60
  18 26 35 45 56
  21 30 40 51
  24 34 45
  27 38
  30
This is (x*(x+1)-y*(y+1))/2 for nonnegative integers x,y with x-y >= 3, because it is equivalent to 1+2+3/+4/+5/...+x/-0/-1/-2/-3/-4/-5/...-(x+3)/ for all possible strings of consecutive integers, which represents every possible way to sum three or more consecutive positive integers. So for example, 4+5+6+7 = 1+2+3+4+5+6+7-1-2-3 = 22, which is (x*(x+1)-y*(y+1))/2 when x=7, y=3. Notice that values can appear more than once in the array because some numbers can be represented as sums of more than one string of three or more consecutive positive integers. For example, 30 = (x*(x+1)-y*(y+1))/2 when (a) x=11, y=8: 9+10+11; (b) x=9, y=5: 6+7+8+9; and (c) x=8, y=3: 4+5+6+7+8. By definition, x-y is the number of integers in the string. (End)
		

References

  • Paul Halmos, "Problems for Mathematicians, Young and Old", Dolciani Mathematical Expositions, 1991, Solution to problem 3G p. 179.

Crossrefs

Programs

  • Maple
    ispoweroftwo := proc(n) local a, t; t := 1; while (n > t) do t := 2*t end do; if (n = t) then a := true else a := false end if; return a; end proc; f:= proc(n) if (not isprime(n)) and (not ispoweroftwo(n)) then return n end if; end proc; seq(f(i),i = 1..150);
  • Mathematica
    max=6!;lst={};Do[z=n+(n+1);Do[z+=(n+x);If[z>max,Break[]];AppendTo[lst,z],{x,2,max}],{n,max}];Union[lst] (* Vladimir Joseph Stephan Orlovsky, Mar 06 2010 *)
  • PARI
    isok(n) = !(n == 1) && !isprime(n) && !(isprimepower(n, &p) && (p == 2)); \\ Michel Marcus, Jul 02 2019
    
  • Python
    from sympy import primepi
    def A111774(n):
        def f(x): return int(n+(0 if x<=1 else primepi(x)-1)+x.bit_length())
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Sep 19 2024

A205378 Least k such that n divides s(k)-s(j) for some j

Original entry on oeis.org

2, 2, 3, 2, 4, 3, 5, 2, 5, 4, 7, 3, 8, 5, 6, 3, 10, 5, 11, 4, 7, 7, 13, 3, 8, 8, 8, 5, 16, 6, 17, 5, 9, 10, 9, 5, 20, 11, 10, 4, 22, 7, 23, 7, 10, 13, 25, 4, 11, 8, 12, 8, 28, 8, 11, 5, 13, 16, 31, 6
Offset: 1

Views

Author

Clark Kimberling, Jan 26 2012

Keywords

Comments

See A204892 for a discussion and guide to related sequences.

Crossrefs

Programs

  • Mathematica
    s[n_] := s[n] = (2 n - 1)^2; z1 = 600; z2 = 60;
    Table[s[n], {n, 1, 30}]     (* A016754, odd squares *)
    u[m_] :=  u[m] = Flatten[Table[s[k] - s[j], {k, 2, z1}, {j, 1, k - 1}]][[m]]
    Table[u[m], {m, 1, z1}]     (* A205376 *)
    %/8                         (* A049777 *)
    v[n_, h_] := v[n, h] = If[IntegerQ[u[h]/n], h, 0]
    w[n_] := w[n] = Table[v[n, h], {h, 1, z1}]
    d[n_] := d[n] = First[Delete[w[n], Position[w[n], 0]]]
    Table[d[n], {n, 1, z2}]     (* A205377 *)
    k[n_] := k[n] = Floor[(3 + Sqrt[8 d[n] - 1])/2]
    m[n_] := m[n] = Floor[(-1 + Sqrt[8 n - 7])/2]
    j[n_] := j[n] = d[n] - m[d[n]] (m[d[n]] + 1)/2
    Table[k[n], {n, 1, z2}]     (* A205378 *)
    Table[j[n], {n, 1, z2}]     (* A205379 *)
    Table[s[k[n]], {n, 1, z2}]  (* A205380 *)
    Table[s[j[n]], {n, 1, z2}]  (* A205381 *)
    Table[s[k[n]] - s[j[n]], {n, 1, z2}]      (* A205382 *)
    Table[(s[k[n]] - s[j[n]])/n, {n, 1, z2}]  (* A205383 *)

A049780 Array T, read by descending antidiagonals: T(n, k) = k*(2*n + k + 1)/2 for n, k >= 0.

Original entry on oeis.org

0, 1, 0, 3, 2, 0, 6, 5, 3, 0, 10, 9, 7, 4, 0, 15, 14, 12, 9, 5, 0, 21, 20, 18, 15, 11, 6, 0, 28, 27, 25, 22, 18, 13, 7, 0, 36, 35, 33, 30, 26, 21, 15, 8, 0, 45, 44, 42, 39, 35, 30, 24, 17, 9, 0, 55, 54, 52, 49, 45, 40, 34, 27, 19, 10, 0, 66, 65, 63, 60, 56, 51, 45, 38, 30, 21, 11, 0
Offset: 0

Views

Author

Keywords

Comments

Triangle S(n,k) = T(k, n-k), read by rows, is given by S(n,k) = A000217(n) - A000217(k) for n >= 0 and 0 <= k <= n. - Philippe Deléham, Mar 07 2013 [Edited by Petros Hadjicostas, Nov 20 2019]

Examples

			From _Petros Hadjicostas_, Nov 20 2019: (Start)
Rectangular array T(n,k) (with rows n >= 0 and columns k >= 0) begins as follows:
  0, 1,  3,  6, 10, 15, 21, 28, 36, 45,  55, ...
  0, 2,  5,  9, 14, 20, 27, 35, 44, 54,  65, ...
  0, 3,  7, 12, 18, 25, 33, 42, 52, 63,  75, ...
  0, 4,  9, 15, 22, 30, 39, 49, 60, 72,  85, ...
  0, 5, 11, 18, 26, 35, 45, 56, 68, 81,  95, ...
  0, 6, 13, 21, 30, 40, 51, 63, 76, 90, 105, ...
  ... (End)
From _Philippe Deléham_, Mar 07 2013: (Start)
Triangle S(n, k) (with rows n >= 0 and columns k >= 0) begins as follows:
   0;
   1,  0;
   3,  2,  0;
   6,  5,  3,  0;
  10,  9,  7,  4,  0;
  15, 14, 12,  9,  5,  0;
  21, 20, 18, 15, 11,  6,  0;
  28, 27, 25, 22, 18, 13,  7, 0;
  36, 35, 33, 30, 26, 21, 15, 8, 0;
  ... (End)
		

Crossrefs

Diagonal sums are in A000330. See also A049777 (triangle without the zeros).

Programs

  • GAP
    Flat(List([0..15], n-> List([0..n], k-> (n-k)*(n+k+1)/2 ))); # G. C. Greubel, Dec 12 2019
  • Magma
    [(n-k)*(n+k+1)/2: k in [0..n], n in [0..15]]; // G. C. Greubel, Dec 12 2019
    
  • Maple
    seq(seq( (n-k)*(n+k+1)/2, k=0..n), n=0..15); # G. C. Greubel, Dec 12 2019
  • Mathematica
    Table[(n-k)*(n+k+1)/2, {n,0,15}, {k,0,n}]//Flatten (* G. C. Greubel, Dec 12 2019 *)
  • PARI
    T(n,k) = k*(2*n+k+1)/2;
    for(n=0, 15, for(k=0,n, print1(T(k,n-k), ", "))) \\ G. C. Greubel, Dec 12 2019
    
  • Sage
    [[(n-k)*(n+k+1)/2 for k in (0..n)] for n in (0..15)] # G. C. Greubel, Dec 12 2019
    

Formula

T(n,k) = Sum_{j=1..k} (n+j) = k*(2*n + k + 1)/2.
S(n,k) = n*(n+1)/2 - k*(k+1)/2 for n >= 0 and 0 <= k <= n - Philippe Deléham, Mar 07 2013 [Edited by Petros Hadjicostas, Nov 20 2019]
From Stefano Spezia, Dec 13 2019: (Start)
G.f. for T(n,k): y*(1 - x*y)/((1 - x)^2*(1 - y)^3).
E.g.f. for T(n,k): (1/2)*exp(x+y)*y*(2 + 2*x + y). (End)
G.f. for S(n,k): x*(1 - x^2*y)/((1 - x*y)^2*(1 - x)^3). - Petros Hadjicostas, Dec 14 2019

A111775 Number of ways n can be written as a sum of at least three consecutive integers.

Original entry on oeis.org

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

Views

Author

Jaap Spies, Aug 16 2005

Keywords

Comments

Powers of 2 and (odd) primes cannot be written as a sum of at least three consecutive integers. a(n) strongly depends on the number of odd divisors of n (A001227): Suppose n is to be written as sum of k consecutive integers starting with m, then 2n = k(2m + k - 1). Only one of the factors is odd. For each odd divisor of n there is a unique corresponding k, k=1 and k=2 must be excluded.
When the initial 0 term is a(1), a(n) is the number of times n occurs after the second column in the square array of A049777. - Bob Selcoe, Feb 14 2014
For nonnegative integers x,y where x-y>=3: a(n) equals the number of ways n can be expressed as a function of (x*(x+1)-y*(y+1))/2 when the initial 0 term is a(1). - Bob Selcoe, Feb 14 2014

Examples

			a(15) = 2 because 15 = 4+5+6 and 15 = 1+2+3+4+5. The number of odd divisors of 15 is 4.
G.f. = x^6 + x^9 + x^10 + x^12 + x^14 + 2*x^15 + 2*x^18 + x^20 + 2*x^21 + x^22 + ...
a(30) = 3 because there are 3 ways to satisfy (x*(x+1)-y*(y+1))/2 = 30 when x-y>=3: x=8, y=3; x=9, y=5; and x=11, y=8. - _Bob Selcoe_, Feb 14 2014
		

References

  • Nieuw Archief voor Wiskunde 5/6 nr. 2 Problems/UWC Problem C part 4, Jun 2005, p. 181-182

Crossrefs

Cf. A111774, A001227 (number of odd divisors), A069283.

Programs

  • Maple
    A001227:= proc(n) local d, s; s := 0: for d from 1 by 2 to n do if n mod d = 0 then s:=s+1 fi: end do: return(s); end proc; A111775:= proc(n) local k; if n=1 then return(0) fi: k := A001227(n): if type(n,even) then k:=k-1 else k:=k-2 fi: return k; end proc; seq(A111775(i), i=1..150);
  • Mathematica
    a[n_] := If[n == 1, 0, Total[Mod[Divisors[n], 2]] - Mod[n, 2] - 1];
    a /@ Range[1, 100] (* Jean-François Alcover, Oct 14 2019 *)
  • PARI
    {a(n) = local(m); if( n<1, 0, sum( i=0, n, m=0; if( issquare( 1 + 8*(n + i * (i + 1)/2), &m), m\2 > i+2)))}; /* Michael Somos, Aug 27 2012 */

Formula

If n is even then a(n) = A001227(n)-1 = A069283(n) otherwise a(n) = A001227(n)-2, for n > 1.
G.f.: Sum_{n >= 2} x^(3*n)/(1 - x^(2*n)). - Peter Bala, Jan 12 2021

A140229 Binomial transform of [1, 3, 3, 1, -2, 3, -4, 5, ...].

Original entry on oeis.org

1, 4, 10, 20, 33, 49, 68, 90, 115, 143, 174, 208, 245, 285, 328, 374, 423, 475, 530, 588, 649, 713, 780, 850, 923, 999, 1078, 1160, 1245, 1333, 1424, 1518, 1615, 1715, 1818, 1924, 2033, 2145, 2260, 2378, 2499, 2623, 2750, 2880, 3013, 3149, 3288, 3430, 3575
Offset: 1

Views

Author

Gary W. Adamson, May 13 2008

Keywords

Comments

The falling diagonal starting with T(1,4) in A049777 (as a square array) gives the terms of this sequence for n >=3. - Bob Selcoe, Oct 27 2014
From Fatma E. Kurnaz, Salih E. Ariturk, and Arzu Caglar, Aug 08 2024: (Start)
Suppose a regular hexagon is divided into equilateral triangles. When we number the corners of the triangles in a spiral manner starting from the center, if the numbers increase counterclockwise, let's define them as "right triangle" and the remaining ones as "left triangle".
The number of downward-pointing left triangles, constitute this sequence for n>=2.
For n=3 a(3)=20, A hexagon with a side of 3 units consists of 54 equilateral triangles. The number of upward right triangles is 12, the number of upward left triangles is 15, the number of downward right triangles is 7. The number of downward left triangles is equal to 20. (End)

Examples

			a(5) = 33 = (1, 4, 6, 4, 1) dot (1, 3, 3, 1, -2) = (1 + 12 + 18 + 4 - 2).
		

Crossrefs

Programs

Formula

A007318 * [1, 3, 3, 1, -2, 3, -4, 5,...].
a(n) = (n+1)(3n-4)/2, for n>=3. - Emeric Deutsch, May 18 2008
G.f.: x(1+x+x^2+x^3-x^4)/(1-x)^3. a(n) = 3*a(n-1) -3*a(n-2) + a(n-3), n>5. a(n+1)-a(n) = A016777(n), n>3. - R. J. Mathar, Nov 25 2008

Extensions

More terms from Emeric Deutsch, May 18 2008
More terms from Vladimir Joseph Stephan Orlovsky, Oct 25 2008

A205376 Ordered differences of distinct odd squares, stored in triangle.

Original entry on oeis.org

8, 24, 16, 48, 40, 24, 80, 72, 56, 32, 120, 112, 96, 72, 40, 168, 160, 144, 120, 88, 48, 224, 216, 200, 176, 144, 104, 56, 288, 280, 264, 240, 208, 168, 120, 64, 360, 352, 336, 312, 280, 240, 192, 136, 72, 440, 432, 416, 392, 360, 320, 272, 216, 152
Offset: 1

Views

Author

Clark Kimberling, Jan 26 2012

Keywords

Comments

a(n) = 8*A049777(n). For a guide to related sequences, see A204892.
Triangle T(n,k), k>=0, n>=1, read by rows, given by T(n,k) = (2*n+1)^2 - (2*k+1)^2. - Philippe Deléham, Mar 07 2013

Examples

			a(1) = s(2)-s(1) =  9-1 = 8,
a(2) = s(3)-s(1) = 25-1 = 24,
a(3) = s(3)-s(2) = 25-9 = 16,
a(4) = s(4)-s(1) = 49-1 = 48,
a(5) = s(4)-s(2) = 49-9 = 40.
Triangle begins:
8
24,  16
48,  40,  24
80,  72,  56,  32
120, 112, 96,  72,  40
168, 160, 144, 120, 88, 48, ... - _Philippe Deléham_, Mar 07 2013
		

Crossrefs

Programs

  • Mathematica
    (See the program at A205378.)
Showing 1-10 of 14 results. Next