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

A107461 Number of gap-free compositions of n into distinct parts, cf. A107428.

Original entry on oeis.org

1, 1, 3, 1, 3, 7, 3, 1, 9, 25, 3, 7, 3, 25, 129, 1, 3, 31, 3, 121, 729, 25, 3, 7, 123, 25, 729, 5041, 3, 151, 3, 1, 729, 25, 5163, 40327, 3, 25, 729, 121, 3, 5071, 3, 40321, 363729, 25, 3, 7, 5043, 145, 729, 40321, 3, 362911, 3628923, 5041, 729, 25, 3, 40447, 3, 25
Offset: 1

Views

Author

Vladeta Jovovic, May 26 2005

Keywords

Examples

			a(6) = 7 because we have 6, 123, 132, 213, 231, 312 and 321.
		

Programs

  • Maple
    G:=sum(k!*x^(k*(k+1)/2)/(1-x^k),k=1..20): Gser:=series(G,x=0,73): seq(coeff(Gser,x^n),n=1..70); # Emeric Deutsch
  • Mathematica
    nn=62;Drop[CoefficientList[Series[Sum[k!x^(k (k+1)/2)/(1-x^k),{k,1,nn}],{x,0,nn}],x],1] (* Geoffrey Critzer, Apr 13 2014 *)
  • PARI
    N=66;  q='q+O('q^N);  S=1+2*sqrtint(N);
    gf=sum(n=1,S, n! * q^(n*(n+1)/2) / (1-q^n) );
    Vec(gf)
    /* Joerg Arndt, Oct 20 2012 */

Formula

G.f.: Sum_{k>0} k!*x^(k*(k+1)/2)/(1-x^k).

Extensions

More terms from Emeric Deutsch, Jun 19 2005

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

A107429 Number of complete compositions of n.

Original entry on oeis.org

1, 1, 3, 4, 8, 18, 33, 65, 127, 264, 515, 1037, 2052, 4103, 8217, 16408, 32811, 65590, 131127, 262112, 524409, 1048474, 2097319, 4194250, 8389414, 16778024, 33557921, 67116113, 134235473, 268471790, 536948820, 1073893571, 2147779943, 4295515305, 8590928746
Offset: 1

Views

Author

N. J. A. Sloane, May 26 2005

Keywords

Comments

A composition is complete if it is gap-free and contains a 1. - Geoffrey Critzer, Apr 13 2014

Examples

			a(5)=8 because we have: 2+2+1, 2+1+2, 1+2+2, 2+1+1+1, 1+2+1+1, 1+1+2+1, 1+1+1+2, 1+1+1+1+1. - _Geoffrey Critzer_, Apr 13 2014
		

Crossrefs

Row sums of A371417 and of A373118.

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, `if`(i=0, t!, 0),
          `if`(i<1 or n add(b(n, i, 0), i=1..n):
    seq(a(n), n=1..40);  # Alois P. Heinz, Apr 14 2014
  • Mathematica
    Table[Length[Select[Level[Map[Permutations,IntegerPartitions[n]],{2}],MemberQ[#,1]&&Length[Union[#]]==Max[#]-Min[#]+1&]],{n,1,20}] (* Geoffrey Critzer, Apr 13 2014 *)
    b[n_, i_, t_] := b[n, i, t] = If[n == 0, If[i == 0, t!, 0], If[i < 1 || n < i, 0, Sum[b[n - i*j, i - 1, t + j]/j!, {j, 1, n/i}]]];
    a[n_] := Sum[b[n, i, 0], {i, 1, n}];
    Table[a[n], {n, 1, 40}] (* Jean-François Alcover, Aug 30 2016, after Alois P. Heinz *)
  • PARI
    C_x(s,N)={my(x='x+O('x^N), g=if(#s <1,1, sum(i=1,#s, C_x(setminus(s,[s[i]]),N) * x^(s[i]) )/(1-sum(i=1,#s, x^(s[i]))))); return(g)}
    B_x(N)={my(x='x+O('x^N), j=1, h=0); while((j*(j+1))/2 <= N, h += C_x(vector(j,i,i),N+1); j+=1); my(a = Vec(h)); vector(N,i,a[i])}
    B_x(35) \\ John Tyler Rascoe, May 25 2024

Formula

a(n) ~ 2^(n-2). - Vaclav Kotesovec, Sep 05 2014
G.f.: Sum_{k>0} C({1..k},x) where C({s},x) = Sum_{i in {s}} (C({s}-{i},x)*x^i)/(1 - Sum_{i in {s}} (x^i)) is the g.f. for compositions such that the set of parts equals {s} with C({},x) = 1. - John Tyler Rascoe, May 24 2024

Extensions

More terms from Vladeta Jovovic, May 26 2005

A287170 a(n) = number of runs of consecutive prime numbers among the prime divisors of n.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 2, 1, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2
Offset: 1

Views

Author

Rémy Sigrist, Jun 04 2017

Keywords

Comments

a(n) = 0 iff n = 1.
a(n) = 1 iff n belongs to A073491.
a(p) = 1 for any prime p.
a(A002110(n)) = 1 for any n > 0.
a(n!) = 1 for any n > 1.
a(A066205(n)) = n for any n > 0.
a(n) = a(A007947(n)) for any n > 0.
a(n) = a(A003961(n)) for any n > 0.
a(n*m) <= a(n) + a(m) for any n > 0 and m > 0.
Each number n can be uniquely represented as a product of a(n) distinct terms from A073491; this representation is minimal relative to the number of terms.

Examples

			See illustration of the first terms in the Links section.
The prime indices of 18564 are {1,1,2,4,6,7}, which separate into maximal gapless submultisets {1,1,2}, {4}, {6,7}, so a(18564) = 3; this corresponds to the ordered factorization 18564 = 12 * 7 * 221. - _Gus Wiseman_, Sep 03 2022
		

Crossrefs

Positions of first appearances are A066205.
These are the row-lengths of A356226 and A356234. Other statistics are:
- length: A287170 (this sequence)
- minimum: A356227
- maximum: A356228
- bisected length: A356229
- standard composition: A356230
- Heinz number: A356231
- positions of first appearances: A356603 or A356232 (sorted)
A001222 counts prime factors, distinct A001221.
A003963 multiplies together the prime indices.
A056239 adds up the prime indices, row sums of A112798.
A073491 lists numbers with gapless prime indices, complement A073492.

Programs

  • Mathematica
    Table[Length[Select[First/@If[n==1,{},FactorInteger[n]],!Divisible[n,NextPrime[#]]&]],{n,30}] (* Gus Wiseman, Sep 03 2022 *)
  • PARI
    a(n) = my (f=factor(n)); if (#f~==0, return (0), return (#f~ - sum(i=1, #f~-1, if (primepi(f[i,1])+1 == primepi(f[i+1,1]), 1, 0))))
    
  • Python
    from sympy import factorint, primepi
    def a087207(n):
        f=factorint(n)
        return sum([2**primepi(i - 1) for i in f])
    def a069010(n): return sum(1 for d in bin(n)[2:].split('0') if len(d)) # this function from Chai Wah Wu
    def a(n): return a069010(a087207(n)) # Indranil Ghosh, Jun 06 2017

Formula

a(n) = A069010(A087207(n))

A356841 Numbers k such that the k-th composition in standard order covers an interval of positive integers (gapless).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 13, 14, 15, 16, 18, 20, 21, 22, 23, 26, 27, 29, 30, 31, 32, 36, 37, 38, 41, 42, 43, 44, 45, 46, 47, 50, 52, 53, 54, 55, 58, 59, 61, 62, 63, 64, 68, 72, 74, 75, 77, 78, 82, 83, 84, 85, 86, 87, 89, 90, 91, 92, 93, 94, 95, 101
Offset: 1

Views

Author

Gus Wiseman, Aug 31 2022

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The terms and their corresponding standard compositions begin:
   0: ()
   1: (1)
   2: (2)
   3: (1,1)
   4: (3)
   5: (2,1)
   6: (1,2)
   7: (1,1,1)
   8: (4)
  10: (2,2)
  11: (2,1,1)
  13: (1,2,1)
  14: (1,1,2)
  15: (1,1,1,1)
  16: (5)
  18: (3,2)
  20: (2,3)
  21: (2,2,1)
		

Crossrefs

See link for sequences related to standard compositions.
An unordered version is A073491, complement A073492.
These compositions are counted by A107428.
The complement is A356842.
The non-initial case is A356843, unordered A356845.
A356230 ranks gapless factorization lengths, firsts A356603.
A356233 counts factorizations into gapless numbers.
A356844 ranks compositions with at least one 1.

Programs

  • Mathematica
    nogapQ[m_]:=m=={}||Union[m]==Range[Min[m],Max[m]];
    stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],nogapQ[stc[#]]&]

A251729 Number of gap-free but not complete compositions of n.

Original entry on oeis.org

0, 1, 1, 2, 3, 3, 6, 6, 14, 12, 27, 33, 58, 86, 134, 210, 323, 539, 810, 1371, 2044, 3510, 5263, 8927, 13702, 22870, 35821, 58750, 93343, 152236, 243244, 395078, 634342, 1027876, 1656543, 2676693, 4325727, 6982440, 11299457, 18232217, 29518334, 47641410
Offset: 1

Views

Author

Alois P. Heinz, Dec 07 2014

Keywords

Comments

A composition is gap-free but not complete if all integers in the interval defined by the smallest and the largest part are parts but 1 is not a part.

Examples

			a(6) = 3: [6], [3,3], [2,2,2].
a(7) = 6: [7], [3,4], [4,3], [2,2,3], [2,3,2], [3,2,2].
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, `if`(i=0, 0, t!),
         `if`(i<1 or n add(b(n, i, 0), i=1..n):
    seq(a(n), n=1..50);
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0, If[i == 0, 0, t!], If[i < 1 || n < i, 0, Sum[b[n - i*j, i - 1, t + j]/j!, {j, 1, n/i}]]];
    a[n_] := Sum[b[n, i, 0], {i, 1, n}];
    Array[a, 50] (* Jean-François Alcover, Jan 25 2021, after Alois P. Heinz *)

Formula

a(n) = A107428(n) - A107429(n).
lim_{n -> oo} a(n)/a(n-1) = (1+sqrt(5))/2 = phi = A001622.

A339737 Triangle read by rows where T(n,k) is the number of integer partitions of n with greatest gap k.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Apr 20 2021

Keywords

Comments

We define the greatest gap of a partition to be the greatest nonnegative integer less than the greatest part and not in the partition.

Examples

			Triangle begins:
   1
   1   0
   1   1   0
   2   0   1   0
   2   1   1   1   0
   3   1   1   1   1   0
   4   1   2   2   1   1   0
   5   1   3   2   2   1   1   0
   6   2   3   4   3   2   1   1   0
   8   2   4   5   4   3   2   1   1   0
  10   2   5   7   6   5   3   2   1   1   0
  12   3   6   8   9   6   5   3   2   1   1   0
  15   3   8  11  11  10   7   5   3   2   1   1   0
  18   4   9  13  15  13  10   7   5   3   2   1   1   0
  22   5  10  17  19  18  14  11   7   5   3   2   1   1   0
  27   5  13  20  24  23  20  14  11   7   5   3   2   1   1   0
For example, row n = 9 counts the following partitions:
  (3321)       (432)   (333)      (54)      (522)    (63)    (72)   (81)  (9)
  (22221)      (3222)  (4311)     (441)     (531)    (621)   (711)
  (32211)              (33111)    (4221)    (5211)   (6111)
  (222111)             (3111111)  (42111)   (51111)
  (321111)                        (411111)
  (2211111)
  (21111111)
  (111111111)
		

Crossrefs

Column k = 0 is A000009.
Row sums are A000041.
Central diagonal is A000041.
Column k = 1 is A087897.
The version for least gap is A264401, with Heinz number encoding A257993.
The version for greatest difference is A286469 or A286470.
An encoding (of greatest gap) using Heinz numbers is A339662.
A000070 counts partitions with a selected part.
A006128 counts partitions with a selected position.
A015723 counts strict partitions with a selected part.
A048004 counts compositions by greatest part.
A056239 adds up prime indices, row sums of A112798.
A064391 is the version for crank.
A064428 counts partitions of nonnegative crank.
A073491 list numbers with gap-free prime indices.
A107428 counts gap-free compositions.
A238709/A238710 counts partitions by least/greatest difference.
A342050/A342051 have prime indices with odd/even least gap.

Programs

  • Mathematica
    maxgap[q_]:=Max@@Complement[Range[0,If[q=={},0,Max[q]]],q];
    Table[Length[Select[IntegerPartitions[n],maxgap[#]==k&]],{n,0,15},{k,0,n}]
  • PARI
    S(n,k)={if(k>n, O(x*x^n), x^k*(S(n-k,k+1) + 1)/(1 - x^k))}
    ColGf(k,n) = {(k==0) + S(n,k+1)/prod(j=1, k-1, 1 - x^j + O(x^max(1,n-k)))}
    A(n,m=n)={Mat(vector(m+1, k, Col(ColGf(k-1,n), -(n+1))))}
    { my(M=A(10)); for(i=1, #M, print(M[i,1..i])) } \\ Andrew Howroyd, Jan 13 2024

Extensions

Offset corrected by Andrew Howroyd, Jan 13 2024

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[#]]&]

A356843 Numbers k such that the k-th composition in standard order covers an interval of positive integers (gapless) but contains no 1's.

Original entry on oeis.org

2, 4, 8, 10, 16, 18, 20, 32, 36, 42, 64, 68, 72, 74, 82, 84, 128, 136, 146, 148, 164, 170, 256, 264, 272, 274, 276, 290, 292, 296, 298, 324, 328, 330, 338, 340, 512, 528, 548, 580, 584, 586, 594, 596, 658, 660, 676, 682, 1024, 1040, 1056, 1092, 1096, 1098
Offset: 1

Views

Author

Gus Wiseman, Sep 01 2022

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The terms together with their corresponding standard compositions begin:
    2: (2)
    4: (3)
    8: (4)
   10: (2,2)
   16: (5)
   18: (3,2)
   20: (2,3)
   32: (6)
   36: (3,3)
   42: (2,2,2)
   64: (7)
   68: (4,3)
   72: (3,4)
   74: (3,2,2)
   82: (2,3,2)
   84: (2,2,3)
		

Crossrefs

See link for sequences related to standard compositions.
A subset of A022340.
These compositions are counted by A251729.
The unordered version (using Heinz numbers of partitions) is A356845.
A333217 ranks complete compositions.
A356230 ranks gapless factorization lengths, firsts A356603.
A356233 counts factorizations into gapless numbers.
A356841 ranks gapless compositions, counted by A107428.
A356842 ranks non-gapless compositions, counted by A356846.
A356844 ranks compositions with at least one 1.

Programs

  • Mathematica
    nogapQ[m_]:=Or[m=={},Union[m]==Range[Min[m],Max[m]]];
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[100],!MemberQ[stc[#],1]&&nogapQ[stc[#]]&]

Formula

Complement of A333217 in A356841.

A339886 Numbers whose prime indices cover an interval of positive integers starting with 2.

Original entry on oeis.org

1, 3, 9, 15, 27, 45, 75, 81, 105, 135, 225, 243, 315, 375, 405, 525, 675, 729, 735, 945, 1125, 1155, 1215, 1575, 1875, 2025, 2187, 2205, 2625, 2835, 3375, 3465, 3645, 3675, 4725, 5145, 5625, 5775, 6075, 6561, 6615, 7875, 8085, 8505, 9375, 10125, 10395, 10935
Offset: 1

Views

Author

Gus Wiseman, Apr 20 2021

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.

Examples

			The sequence of terms together with their prime indices begins:
    3: {2}
    9: {2,2}
   15: {2,3}
   27: {2,2,2}
   45: {2,2,3}
   75: {2,3,3}
   81: {2,2,2,2}
  105: {2,3,4}
  135: {2,2,2,3}
  225: {2,2,3,3}
  243: {2,2,2,2,2}
  315: {2,2,3,4}
  375: {2,3,3,3}
  405: {2,2,2,2,3}
  525: {2,3,3,4}
  675: {2,2,2,3,3}
  729: {2,2,2,2,2,2}
  735: {2,3,4,4}
  945: {2,2,2,3,4}
		

Crossrefs

The version starting at 1 is A055932.
The partitions with these Heinz numbers are counted by A264396.
Positions of 1's in A339662.
A000009 counts partitions covering an initial interval.
A000070 counts partitions with a selected part.
A016945 lists numbers with smallest prime index 2.
A034296 counts gap-free (or flat) partitions.
A056239 adds up prime indices, row sums of A112798.
A073491 lists numbers with gap-free prime indices.
A107428 counts gap-free compositions (initial: A107429).
A286469 and A286470 give greatest difference for Heinz numbers.
A325240 lists numbers with smallest prime multiplicity 2.
A342050/A342051 have prime indices with odd/even least gap.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    normQ[m_]:=Or[m=={},Union[m]==Range[Max[m]]];
    Select[Range[100],normQ[primeMS[#]-1]&]
Showing 1-10 of 23 results. Next