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.

Previous Showing 11-20 of 62 results. Next

A325328 Heinz numbers of finite arithmetic progressions (integer partitions with equal differences).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19, 21, 22, 23, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 37, 38, 39, 41, 43, 46, 47, 49, 51, 53, 55, 57, 58, 59, 61, 62, 64, 65, 67, 69, 71, 73, 74, 77, 79, 81, 82, 83, 85, 86, 87, 89, 91, 93, 94, 95, 97
Offset: 1

Views

Author

Gus Wiseman, Apr 23 2019

Keywords

Comments

The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).
The enumeration of these partitions by sum is given by A049988.

Examples

			Most small numbers are in the sequence. However the sequence of non-terms together with their prime indices begins:
   12: {1,1,2}
   18: {1,2,2}
   20: {1,1,3}
   24: {1,1,1,2}
   28: {1,1,4}
   36: {1,1,2,2}
   40: {1,1,1,3}
   42: {1,2,4}
   44: {1,1,5}
   45: {2,2,3}
   48: {1,1,1,1,2}
   50: {1,3,3}
   52: {1,1,6}
   54: {1,2,2,2}
   56: {1,1,1,4}
   60: {1,1,2,3}
   63: {2,2,4}
   66: {1,2,5}
   68: {1,1,7}
   70: {1,3,4}
For example, 60 is the Heinz number of (3,2,1,1), which has differences (-1,-1,0), which are not equal, so 60 does not belong to the sequence.
		

Crossrefs

Programs

  • Mathematica
    primeptn[n_]:=If[n==1,{},Reverse[Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]];
    Select[Range[100],SameQ@@Differences[primeptn[#]]&]

A054519 Number of increasing arithmetic progressions of nonnegative integers ending in n, including those of length 1 or 2.

Original entry on oeis.org

1, 2, 4, 6, 9, 11, 15, 17, 21, 24, 28, 30, 36, 38, 42, 46, 51, 53, 59, 61, 67, 71, 75, 77, 85, 88, 92, 96, 102, 104, 112, 114, 120, 124, 128, 132, 141, 143, 147, 151, 159, 161, 169, 171, 177, 183, 187, 189, 199, 202, 208, 212, 218, 220, 228, 232, 240, 244, 248
Offset: 0

Views

Author

Henry Bottomley, Apr 07 2000

Keywords

Comments

a(0)=1, a(n) = a(n-1) + sigma_0(n) (A000005). - Ctibor O. Zizka, Nov 08 2008
a(n) is the index of the n-th term of A027750 whose value is 1. - Michel Marcus, Oct 15 2015
From Gus Wiseman, Jun 07 2019: (Start)
Also the number of subsets of {1..n} that are closed under taking the difference of two strictly decreasing terms. For example, the a(0) = 1 through a(6) = 15 subsets are:
{} {} {} {} {} {} {}
{1} {1} {1} {1} {1} {1}
{2} {2} {2} {2} {2}
{1,2} {3} {3} {3} {3}
{1,2} {4} {4} {4}
{1,2,3} {1,2} {5} {5}
{2,4} {1,2} {6}
{1,2,3} {2,4} {1,2}
{1,2,3,4} {1,2,3} {2,4}
{1,2,3,4} {3,6}
{1,2,3,4,5} {1,2,3}
{2,4,6}
{1,2,3,4}
{1,2,3,4,5}
{1,2,3,4,5,6}
(End)

Examples

			a(3)=6 because the six increasing progressions (3), (2,3), (1,2,3), (0,1,2,3), (1,3) and (0,3) all end in 3.
		

Crossrefs

Programs

  • Magma
    [1] cat [&+[Ceiling((k+1)/(i+1)): i in [1..k+1]]: k in [1..60]]; // Marius A. Burtea, Jun 10 2019
  • Maple
    IBI:= {{}}: a[0]:= 1: for n from 1 to 45 do IBI:= IBI union map(t -> t union {n}, select(t -> (t minus map(q -> n-q, t)={}), IBI)); a[n]:= nops(IBI) od: seq(a[n], n=0..45); # Zerinvary Lajos, Mar 18 2007
    with(numtheory):a[1]:=2: for n from 2 to 59 do a[n]:=a[n-1]+tau(n) od: seq(a[n], n=0..45); # Zerinvary Lajos, Mar 21 2009
    map(`+`, ListTools:-PartialSums(map(numtheory:-tau, [$0..1000])),1); # Robert Israel, Oct 15 2015
  • Mathematica
    a[0]=1; a[n_] := a[n] = a[n-1] + DivisorSigma[0, n]; Table[a[n], {n, 0, 45}] (* Jean-François Alcover, Oct 05 2012, after Ctibor O. Zizka *)
    nxt[{n_,a_}]:={n+1,a+DivisorSigma[0,n+1]}; Transpose[NestList[nxt,{0,1},50]][[2]] (* Harvey P. Dale, Oct 15 2012 *)
    Table[Length[Select[Subsets[Range[n]],SubsetQ[#,Subtract@@@Reverse/@Subsets[#,{2}]]&]],{n,0,10}] (* Gus Wiseman, Jun 07 2019 *)
  • PARI
    vector(100, n, n--; sum(k=1, n, n\k) + 1) \\ Altug Alkan, Oct 15 2015
    

Formula

a(n) = A051336(n+1) - A051336(n) = a(n-1) + A000005(n) = A006218(n)+1.
G.f.: (1-x)^(-1) * (1 + Sum_{j>=1} x^j/(1-x^j)). - Robert Israel, Oct 15 2015
a(n) = Sum_{i=1..n+1} ceiling((n+1)/(i+1)). - Wesley Ivan Hurt, Sep 15 2017

A129654 Number of different ways to represent n as general polygonal number P(m,r) = 1/2*r*((m-2)*r-(m-4)) = n>1, for m,r>1.

Original entry on oeis.org

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

Views

Author

Alexander Adamchuk, Apr 27 2007

Keywords

Comments

The indices k of the first appearance of number n in a(k) are listed in A063778(n) = {2,3,6,15,36,225,...} = Least number k>1 such that k could be represented in n different ways as general m-gonal number P(m,r) = 1/2*r*((m-2)*r-(m-4)).
From Gus Wiseman, May 03 2019: (Start)
Also the number of integer partitions of n whose augmented differences are all equal, where the augmented differences aug(y) of an integer partition y of length k are given by aug(y)i = y_i - y{i + 1} + 1 if i < k and aug(y)_k = y_k; for example aug(6,5,5,3,3,3) = (2,1,3,1,1,3). Equivalently, a(n) is the number of integer partitions of n whose differences are all equal to the last part minus one. The Heinz numbers of these partitions are given by A307824. For example, the a(35) = 5 partitions are:
(35)
(23,12)
(11,9,7,5,3)
(8,7,6,5,4,3,2)
(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)
(End)

Examples

			a(6) = 3 because 6 = P(2,6) = P(3,3) = P(6,2).
		

Crossrefs

Programs

  • Maple
    A129654 := proc(n) local resul, dvs, i, r, m ;
       dvs := numtheory[divisors](2*n) ;
       resul := 0 ;
       for i from 1 to nops(dvs) do
          r := op(i, dvs) ;
          if r > 1 then
             m := (2*n/r-4+2*r)/(r-1) ;
             if is(m, integer) then
                resul := resul+1 ;
             fi ;
          fi ;
       od ;
       RETURN(resul) ;
    end: # R. J. Mathar, May 14 2007
  • Mathematica
    a[n_] := (dvs = Divisors[2*n]; resul = 0; For[i = 1, i <= Length[dvs], i++, r = dvs[[i]]; If[r > 1, m = (2*n/r-4+2*r)/(r-1); If[IntegerQ[m], resul = resul+1 ] ] ]; resul); Table[a[n], {n, 2, 106}] (* Jean-François Alcover, Sep 13 2012, translated from R. J. Mathar's Maple program *)
    Table[Length[Intersection[Divisors[2 n - 2] + 1, Divisors[2 n]]], {n, 2, 106}] (* Jonathan Sondow, May 09 2014 *)
    atpms[n_]:=Select[Join@@Table[i*Range[k,1,-1],{k,n},{i,0,n}],Total[#+1]==n&];
    Table[Length[atpms[n]],{n,100}] (* Gus Wiseman, May 03 2019 *)
  • PARI
    a(n) = sumdiv(2*n, d, (d>1) && (2*n/d + 2*d - 4) % (d-1) == 0); \\ Daniel Suteu, Dec 22 2018

Formula

a(n) = A177025(n) + 1.
G.f.: x * Sum_{k>=1} x^k / (1 - x^(k*(k + 1)/2)) (conjecture). - Ilya Gutkovskiy, Apr 09 2020

A014405 Number of arithmetic progressions of 3 or more positive integers, strictly increasing with sum n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 2, 1, 0, 3, 0, 1, 5, 1, 0, 6, 0, 2, 7, 2, 0, 8, 2, 2, 9, 3, 0, 13, 0, 2, 11, 3, 4, 15, 0, 3, 13, 6, 0, 18, 0, 4, 20, 4, 0, 19, 2, 8, 18, 5, 0, 23, 6, 6, 20, 5, 0, 30, 0, 5, 25, 6, 7, 29, 0, 6, 24, 15, 0, 32, 0, 6, 34, 7, 4, 34, 0, 14, 31, 7, 0, 39, 9, 7, 31, 9, 0, 49, 5, 9, 33, 8, 10, 42, 0, 12
Offset: 1

Views

Author

Keywords

Examples

			E.g., 15 = 1+2+3+4+5 = 1+5+9 = 2+5+8 = 3+5+7 = 4+5+6.
		

Crossrefs

Programs

  • PARI
    a(n)= t=0; st=0; forstep(s=(n-3)\3,1,-1, st++; for(c=1,st, m=3; w=m*(s+c); while(wRick L. Shepherd, Aug 30 2006

Formula

G.f.: Sum_{k >= 3} x^t(k)/(x^t(k) - x^t(k-1) - x^k + 1) = Sum_{k >= 3} x^t(k)/((1 - x^k) * (1 - x^t(k-1))), where t(k) = k*(k+1)/2 = A000217(k) is the k-th triangular number [Graeme McRae]. - Petros Hadjicostas, Sep 29 2019
a(n) = A049992(n) - A023645(n). - Antti Karttunen, Feb 20 2023

A238423 Number of compositions of n avoiding three consecutive parts in arithmetic progression.

Original entry on oeis.org

1, 1, 2, 3, 7, 13, 22, 42, 81, 149, 278, 516, 971, 1812, 3374, 6297, 11770, 21970, 41002, 76523, 142901, 266779, 497957, 929563, 1735418, 3239698, 6047738, 11289791, 21076118, 39344992, 73448769, 137113953, 255965109, 477835991, 892023121, 1665227859
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Feb 26 2014

Keywords

Comments

These are compositions of n whose second-differences are nonzero. - Gus Wiseman, Jun 03 2019

Examples

			The a(5) = 13 such compositions are:
01:  [ 1 1 2 1 ]
02:  [ 1 1 3 ]
03:  [ 1 2 1 1 ]
04:  [ 1 2 2 ]
05:  [ 1 3 1 ]
06:  [ 1 4 ]
07:  [ 2 1 2 ]
08:  [ 2 2 1 ]
09:  [ 2 3 ]
10:  [ 3 1 1 ]
11:  [ 3 2 ]
12:  [ 4 1 ]
13:  [ 5 ]
		

Crossrefs

Cf. A238424 (equivalent for partitions).
Cf. A238569 (equivalent for any 3-term arithmetic progression).

Programs

  • Maple
    # b(n, r, d): number of compositions of n where the leftmost part j
    #             does not have distance d to the recent part r
    b:= proc(n, r, d) option remember; `if`(n=0, 1,
          add(`if`(j=r+d, 0, b(n-j, j, j-r)), j=1..n))
        end:
    a:= n-> b(n, infinity, 0):
    seq(a(n), n=0..45);
  • Mathematica
    b[n_, r_, d_] := b[n, r, d] = If[n == 0, 1, Sum[If[j == r + d, 0, b[n - j, j, j - r]], {j, 1, n}]]; a[n_] := b[n, Infinity, 0]; Table[a[n], {n, 0, 45}] (* Jean-François Alcover, Nov 06 2014, after Maple *)
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MemberQ[Differences[#,2],0]&]],{n,0,10}] (* Gus Wiseman, Jun 03 2019 *)

Formula

a(n) ~ c * d^n, where d = 1.866800016014240677813344121155900699..., c = 0.540817940878009616510727217687704495... - Vaclav Kotesovec, May 01 2014

A325390 Heinz number of the negated differences plus one of the integer partition with Heinz number n (with the last part taken to be 0).

Original entry on oeis.org

1, 3, 5, 6, 7, 9, 11, 12, 10, 15, 13, 18, 17, 21, 15, 24, 19, 18, 23, 30, 25, 33, 29, 36, 14, 39, 20, 42, 31, 27, 37, 48, 35, 51, 21, 36, 41, 57, 55, 60, 43, 45, 47, 66, 30, 69, 53, 72, 22, 30, 65, 78, 59, 36, 35, 84, 85, 87, 61, 54, 67, 93, 50, 96, 49, 63, 71
Offset: 1

Views

Author

Gus Wiseman, May 02 2019

Keywords

Comments

The Heinz number of a positive integer sequence (y_1,...,y_k) is prime(y_1)*...*prime(y_k).
The differences of a sequence are defined as if the sequence were increasing, so for example the differences of (6,3,1) (with the last part taken to be 0) are (-3,-2,-1).

Examples

			The Heinz number of (6,3,1) is 130, and its negated differences plus one are (4,3,2), which has Heinz number 105, so a(130) = 105.
		

Crossrefs

Number of appearances of n is A325392(n).
Positions of squarefree numbers are A325367.

Programs

  • Mathematica
    primeptn[n_]:=If[n==1,{},Reverse[Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]];
    Table[Times@@Prime/@(1-Differences[Append[primeptn[n],0]]),{n,100}]

A014406 Number of strictly increasing arithmetic progressions of positive integers with at least 3 terms and sum <= n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 1, 3, 4, 4, 7, 7, 8, 13, 14, 14, 20, 20, 22, 29, 31, 31, 39, 41, 43, 52, 55, 55, 68, 68, 70, 81, 84, 88, 103, 103, 106, 119, 125, 125, 143, 143, 147, 167, 171, 171, 190, 192, 200, 218, 223, 223, 246, 252, 258, 278, 283, 283, 313, 313, 318, 343, 349, 356, 385, 385
Offset: 1

Views

Author

Keywords

Examples

			From _Petros Hadjicostas_, Sep 29 2019: (Start)
a(8) = 1 because we have only the following strictly increasing arithmetic progression of positive integers with at least 3 terms and sum <= 8: 1+2+3.
a(9) = 3 because we have the following strictly increasing arithmetic progressions of positive integers with at least 3 terms and sum <= 9: 1+2+3, 1+3+5, and 2+3+4.
a(10) = 4 because we have the following strictly increasing arithmetic progressions of positive integers with at least 3 terms and sum <= 10: 1+2+3, 1+3+5, 2+3+4, and 1+2+3+4.
(End)
		

Crossrefs

Formula

a(n) = Sum_{k=1..n} A014405(k). - Sean A. Irvine, Oct 22 2018
G.f.: (g.f. of A014405)/(1-x). - Petros Hadjicostas, Sep 29 2019

Extensions

a(59)-a(67) corrected by Fausto A. C. Cariboni, Oct 02 2018

A127938 Number of arithmetic progressions of 2 or more nonnegative integers, strictly increasing with sum n.

Original entry on oeis.org

1, 1, 3, 2, 3, 6, 4, 4, 8, 7, 6, 11, 7, 8, 15, 9, 9, 17, 10, 13, 20, 13, 12, 22, 15, 15, 24, 18, 15, 32, 16, 18, 29, 20, 22, 36, 19, 22, 34, 27, 21, 42, 22, 26, 46, 27, 24, 45, 27, 34, 45, 31, 27, 52, 35, 35, 50, 34, 30, 64, 31, 36, 59, 38, 40, 65, 34, 40, 60, 51, 36, 71, 37, 43
Offset: 1

Views

Author

Graeme McRae, Feb 08 2007

Keywords

Comments

From Petros Hadjicostas, Sep 28 2019: (Start)
We want to find the number of pairs of integers (b, w) such that b >= 0 and w >= 1 and there is an integer m >= 1 so that m*b + (1/2)*m*(m-1)*w = n.
If we insist that b > 0, we get A049982 (= number of arithmetic progressions of 2 or more positive integers, strictly increasing with sum n). The number of integers m >= 1 such that (1/2)*m*(m-1)*w = n equals A007862(n) (= number of triangular numbers that divide n).
Thus, to get a(n), we add A049982(n) to A007862(n).
(End)

Examples

			a(10) = 7 because there are five 2-element arithmetic progressions that sum to 10, as well as 1+2+3+4 and 0+1+2+3+4.
		

Crossrefs

Programs

  • PARI
    seq(n)={Vec(sum(k=1, (sqrtint(8*n+1)-1)\2,  x^binomial(k+1, 2)/(x^binomial(k+2, 2) - x^binomial(k+1, 2) - x^(k+1) + 1) + O(x*x^n)))} \\ Andrew Howroyd, Sep 28 2019

Formula

G.f.: x/(x^3 - x - x^2 + 1) + x^3/(x^6 - x^3 - x^3 + 1) + x^6/(x^10 - x^6 - x^4 + 1) + ... = Sum_{k >= 2} x^{t(k-1)}/(x^{t(k)} - x^{t(k-1)} - x^k + 1), where t(k) = A000217(k) is the k-th triangular number. Term k of this generating function generates the number of arithmetic progressions of k nonnegative integers, strictly increasing with sum n.
a(n) = A049982(n) + A007862(n). - Petros Hadjicostas, Sep 28 2019

A320509 Number of partitions of n such that the successive differences of consecutive parts are nonincreasing, and first difference <= first part.

Original entry on oeis.org

1, 1, 2, 3, 3, 4, 6, 4, 6, 8, 7, 8, 11, 7, 12, 14, 10, 13, 19, 12, 18, 21, 16, 19, 27, 19, 25, 30, 25, 30, 37, 25, 35, 40, 35, 42, 49, 35, 49, 56, 46, 54, 66, 50, 65, 72, 60, 70, 83, 68, 84, 90, 80, 94, 110, 86, 107, 116, 98, 119, 137, 111, 134, 146, 130, 148, 165, 141, 169
Offset: 0

Views

Author

Seiichi Manyama, Oct 14 2018

Keywords

Comments

Partitions are usually written with parts in descending order, but the conditions are easier to check visually if written in ascending order.
The differences of a sequence are defined as if the sequence were increasing, so for example the differences (with the first part taken to be 0) of (6,3,1) are (-3,-2,-1). Then a(n) is the number of integer partitions of n whose differences (with the last part taken to be 0) are weakly decreasing. The Heinz numbers of these partitions are given by A325364. Of course, the number of such integer partitions of n is also the number of reversed integer partitions of n whose differences (with the first part taken to be 0) are weakly decreasing, which is the author's interpretation. - Gus Wiseman, May 03 2019

Examples

			There are a(11) = 8 such partitions of 11:
01: [11]
02: [4, 7]
03: [5, 6]
04: [2, 4, 5]
05: [3, 4, 4]
06: [2, 3, 3, 3]
07: [1, 2, 2, 2, 2, 2]
08: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
There are a(12) = 11 such partitions of 12:
01: [12]
02: [4, 8]
03: [5, 7]
04: [6, 6]
05: [2, 4, 6]
06: [3, 4, 5]
07: [4, 4, 4]
08: [3, 3, 3, 3]
09: [1, 2, 3, 3, 3]
10: [2, 2, 2, 2, 2, 2]
11: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
		

Crossrefs

Cf. A320387 (distinct parts, nonincreasing, and first difference <= first part).

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],GreaterEqual@@Differences[Append[#,0]]&]],{n,0,30}] (* Gus Wiseman, May 03 2019 *)
  • Ruby
    def partition(n, min, max)
      return [[]] if n == 0
      [max, n].min.downto(min).flat_map{|i| partition(n - i, min, i).map{|rest| [i, *rest]}}
    end
    def f(n)
      return 1 if n == 0
      cnt = 0
      partition(n, 1, n).each{|ary|
        ary << 0
        ary0 = (1..ary.size - 1).map{|i| ary[i - 1] - ary[i]}
        cnt += 1 if ary0.sort == ary0
      }
      cnt
    end
    def A320509(n)
      (0..n).map{|i| f(i)}
    end
    p A320509(50)

A325327 Heinz numbers of multiples of triangular partitions, or finite arithmetic progressions with offset 0.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 11, 13, 17, 19, 21, 23, 29, 30, 31, 37, 41, 43, 47, 53, 59, 61, 65, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 133, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 210, 211, 223, 227, 229, 233, 239
Offset: 1

Views

Author

Gus Wiseman, Apr 23 2019

Keywords

Comments

The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).
Also numbers of the form Product_{k = 1..b} prime(k * c) for some b >= 0 and c > 0.
The enumeration of these partitions by sum is given by A007862.

Examples

			The sequence of terms together with their prime indices begins:
    1: {}
    2: {1}
    3: {2}
    5: {3}
    6: {1,2}
    7: {4}
   11: {5}
   13: {6}
   17: {7}
   19: {8}
   21: {2,4}
   23: {9}
   29: {10}
   30: {1,2,3}
   31: {11}
   37: {12}
   41: {13}
   43: {14}
   47: {15}
   53: {16}
		

Crossrefs

Programs

  • Mathematica
    primeptn[n_]:=If[n==1,{},Reverse[Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]];
    Select[Range[100],SameQ@@Differences[Append[primeptn[#],0]]&]
Previous Showing 11-20 of 62 results. Next