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-5 of 5 results.

A049820 a(n) = n - d(n), where d(n) is the number of divisors of n (A000005).

Original entry on oeis.org

0, 0, 1, 1, 3, 2, 5, 4, 6, 6, 9, 6, 11, 10, 11, 11, 15, 12, 17, 14, 17, 18, 21, 16, 22, 22, 23, 22, 27, 22, 29, 26, 29, 30, 31, 27, 35, 34, 35, 32, 39, 34, 41, 38, 39, 42, 45, 38, 46, 44, 47, 46, 51, 46, 51, 48, 53, 54, 57, 48, 59, 58, 57, 57, 61, 58, 65
Offset: 1

Views

Author

Keywords

Comments

a(n) is the number of non-divisors of n in 1..n. - Jaroslav Krizek, Nov 14 2009
Also equal to the number of partitions p of n such that max(p)-min(p) = 1. The number of partitions of n with max(p)-min(p) <= 1 is n; there is one with k parts for each 1 <= k <= n. max(p)-min(p) = 0 iff k divides n, leaving n-d(n) with a difference of 1. It is easiest to see this by looking at fixed k with increasing n: for k=3, starting with n=3 the partitions are [1,1,1], [2,1,1], [2,2,1], [2,2,2], [3,2,2], etc. - Giovanni Resta, Feb 06 2006 and Franklin T. Adams-Watters, Jan 30 2011
Number of positive numbers in n-th row of array T given by A049816.
Number of proper non-divisors of n. - Omar E. Pol, May 25 2010
a(n+2) is the sum of the n-th antidiagonal of A225145. - Richard R. Forberg, May 02 2013
For n > 2, number of nonzero terms in n-th row of triangle A051778. - Reinhard Zumkeller, Dec 03 2014
Number of partitions of n of the form [j,j,...,j,i] (j > i). Example: a(7)=5 because we have [6,1], [5,2], [4,3], [3,3,1], and [2,2,2,1]. - Emeric Deutsch, Sep 22 2016

Examples

			a(7) = 5; the 5 non-divisors of 7 in 1..7 are 2, 3, 4, 5, and 6.
The 5 partitions of 7 with max(p) - min(p) = 1 are [4,3], [3,2,2], [2,2,2,1], [2,2,1,1,1] and [2,1,1,1,1,1]. - _Emeric Deutsch_, Mar 01 2006
		

Crossrefs

Cf. A000005.
One less than A062968, two less than A059292.
Cf. A161664 (partial sums).
Cf. A060990 (number of solutions to a(x) = n).
Cf. A045765 (numbers not occurring in this sequence).
Cf. A236561 (same sequence sorted into ascending order), A236562 (with also duplicates removed), A236565, A262901 and A262903.
Cf. A262511 (numbers that occur only once).
Cf. A055927 (positions of repeated terms).
Cf. A245388 (positions of squares).
Cf. A155043 (number of steps needed to reach zero when iterating a(n)), A262680 (number of nonzero squares encountered).
Cf. A259934 (an infinite trunk of the tree defined by edge-relation a(child) = parent, conjectured to be unique).
Cf. tables and arrays A047916, A051731, A051778, A173540, A173541.
Cf. also arrays A225145, A262898, A263255 and tables A263265, A263267.

Programs

Formula

a(n) = Sum_{k=1..n} ceiling(n/k)-floor(n/k). - Benoit Cloitre, May 11 2003
G.f.: Sum_{k>0} x^(2*k+1)/(1-x^k)/(1-x^(k+1)). - Emeric Deutsch, Mar 01 2006
a(n) = A006590(n) - A006218(n) = A161886(n) - A000005(n) - A006218(n) + 1 for n >= 1. - Jaroslav Krizek, Nov 14 2009
a(n) = Sum_{k=1..n} A000007(A051731(n,k)). - Reinhard Zumkeller, Mar 09 2010
a(n) = A076627(n) / A000005(n). - Reinhard Zumkeller, Feb 06 2012
For n >= 2, a(n) = A094181(n) / A051953(n). - Antti Karttunen, Nov 27 2015
a(n) = Sum_{k=1..n} ((n mod k) + (-n mod k))/k. - Wesley Ivan Hurt, Dec 28 2015
G.f.: Sum_{j>=2} (x^(j+1)*(1-x^(j-1))/(1-x^j))/(1-x). - Emeric Deutsch, Sep 22 2016
Dirichlet g.f.: zeta(s-1)- zeta(s)^2. - Ilya Gutkovskiy, Apr 12 2017
a(n) = Sum_{i=1..n-1} sign(i mod n-i). - Wesley Ivan Hurt, Sep 27 2018

Extensions

Edited by Franklin T. Adams-Watters, Jan 30 2012

A097364 Triangle read by rows, 0 <= k < n: T(n,k) = number of partitions of n such that the differences between greatest and smallest parts are k.

Original entry on oeis.org

1, 2, 0, 2, 1, 0, 3, 1, 1, 0, 2, 3, 1, 1, 0, 4, 2, 3, 1, 1, 0, 2, 5, 3, 3, 1, 1, 0, 4, 4, 6, 3, 3, 1, 1, 0, 3, 6, 6, 7, 3, 3, 1, 1, 0, 4, 6, 10, 7, 7, 3, 3, 1, 1, 0, 2, 9, 10, 12, 8, 7, 3, 3, 1, 1, 0, 6, 6, 15, 14, 13, 8, 7, 3, 3, 1, 1, 0, 2, 11, 15, 20, 16, 14, 8, 7, 3, 3, 1, 1, 0, 4, 10, 21, 22, 24, 17
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 09 2004

Keywords

Comments

Sum_{k=0..n-1} T(n,k) = A000041(n); T(n,0) + T(n,1) = n for n > 1;
T(n,0) = A000005(n); T(n,1) = A049820(n) for n > 1;
T(n,2) = floor((n-2)/2)*(floor((n-2)/2) + 1)/2 = A000217(floor((n-2)/2)) = A008805(n-4) for n > 3.
Without the 0's (which are of no consequence for the triangle) this sequence is A116685. - Emeric Deutsch, Feb 23 2006

Examples

			Triangle starts:
01:  1
02:  2  0
03:  2  1  0
04:  3  1  1  0
05:  2  3  1  1  0
06:  4  2  3  1  1  0
07:  2  5  3  3  1  1 0
08:  4  4  6  3  3  1 1 0
09:  3  6  6  7  3  3 1 1 0
10:  4  6 10  7  7  3 3 1 1 0
11:  2  9 10 12  8  7 3 3 1 1 0
12:  6  6 15 14 13  8 7 3 3 1 1 0
13:  2 11 15 20 16 14 8 7 3 3 1 1 0
14:  4 10 21 22 24 17 ...
- _Joerg Arndt_, Feb 22 2014
T(8,0)=4: 8=4+4=2+2+2+2=1+1+1+1+1+1+1+1,
T(8,1)=4: 3+3+2=2+2+2+1+1=2+2+1+1+1+1=2+1+1+1+1+1+1,
T(8,2)=6: 5+3=4+2+2=3+3+1+1=3+2+2+1=3+2+1+1+1=3+1+1+1+1+1,
T(8,3)=3: 4+3+1=4+2+1+1=4+1+1+1+1,
T(8,4)=3: 6+2=5+2+1=5+1+1+1,
T(8,5)=1: 6+1+1,
T(8,6)=1: 7+1,
T(8,7)=0;
Sum_{k=0..7} T(8,k) = 4+4+6+3+3+1+1+0 = 22 = A000041(8).
		

Crossrefs

Cf. A116685 (same sequence with zeros omitted).
Columns k=3..10 give A128508, A218567, A218568, A218569, A218570, A218571, A218572, A218573. T(2*n,n) = A117989(n). - Alois P. Heinz, Nov 02 2012

Programs

  • Haskell
    a097364 n k = length [qs | qs <- pss !! n, last qs - head qs == k] where
       pss = [] : map parts [1..] where
             parts x = [x] : [i : ps | i <- [1..x],
                                       ps <- pss !! (x - i), i <= head ps]
    a097364_row n = map (a097364 n) [0..n-1]
    a097364_tabl = map a097364_row [1..]
    -- Reinhard Zumkeller, Feb 01 2013
  • Maple
    g:=sum(x^i/(1-x^i)/product(1-t*x^j,j=1..i-1),i=1..50): gser:=simplify(series(g,x=0,18)): for n from 1 to 15 do P[n]:=coeff(gser,x^n) od: 1; for n from 2 to 15 do seq(coeff(P[n],t,j),j=0..n-1) od;
    # yields sequence in triangular form # Emeric Deutsch, Feb 23 2006
  • Mathematica
    rows = 14; max = rows+2; col[k0_ /; k0 > 0] := col[k0] = Sum[x^(2*k + k0) / Product[(1-x^(k+j)), {j, 0, k0}], {k, 1, Ceiling[max/2]}] + O[x]^max // CoefficientList[#, x]&; col[0] := Table[Switch[n, 1, 0, 2, 1, , n - 1 - col[1][[n]]], {n, 1, Length[col[1]]}]; Table[col[k][[n+2]], {n, 0, rows-1 }, {k, 0, n}] // Flatten (* _Jean-François Alcover, Sep 10 2017, after Alois P. Heinz *)

Formula

G.f.: Sum_{i>=1} x^i/((1 - x^i)*Product_{j=1..i-1} (1 - t*x^j)). - Emeric Deutsch, Feb 23 2006

A116685 Triangle read by rows: T(n,k) is number of partitions of n that have k parts smaller than the largest part (n>=1, k>=0).

Original entry on oeis.org

1, 2, 2, 1, 3, 1, 1, 2, 3, 1, 1, 4, 2, 3, 1, 1, 2, 5, 3, 3, 1, 1, 4, 4, 6, 3, 3, 1, 1, 3, 6, 6, 7, 3, 3, 1, 1, 4, 6, 10, 7, 7, 3, 3, 1, 1, 2, 9, 10, 12, 8, 7, 3, 3, 1, 1, 6, 6, 15, 14, 13, 8, 7, 3, 3, 1, 1, 2, 11, 15, 20, 16, 14, 8, 7, 3, 3, 1, 1, 4, 10, 21, 22, 24, 17, 14, 8, 7, 3, 3, 1, 1, 4, 11, 21
Offset: 1

Views

Author

Emeric Deutsch, Feb 23 2006

Keywords

Comments

Same as A097364 without the 0's.
Also number of partitions of n such that the difference between the largest and smallest parts is k (see A097364). Example: T(6,2)=3 because we have [4,2],[3,2,1] and [3,1,1,1].
Row 1 has one term; row n (n>=2) has n-1 terms.
Row sums yield the partition numbers (A000041).
T(n,0)=A000005(n) (number of divisors of n).
T(n,1)=A049820(n) (n minus number of divisors of n).
T(n,2)=A008805(n-4) for n>=4.
Sum(k*T(n,k),k=0..n-2)=A116686

Examples

			Triangle starts:
01:  1
02:  2
03:  2  1
04:  3  1  1
05:  2  3  1  1
06:  4  2  3  1  1
07:  2  5  3  3  1  1
08:  4  4  6  3  3  1 1
09:  3  6  6  7  3  3 1 1
10:  4  6 10  7  7  3 3 1 1
11:  2  9 10 12  8  7 3 3 1 1
12:  6  6 15 14 13  8 7 3 3 1 1
13:  2 11 15 20 16 14 8 7 3 3 1 1
14:  4 10 21 22 24 17 ...
T(6,2)=3 because we have [4,1,1],[3,2,1] and [2,2,1,1].
		

Crossrefs

Columns k=3-10 give: A128508, A218567, A218568, A218569, A218570, A218571, A218572, A218573. T(2*n,n) = A117989(n). - Alois P. Heinz, Nov 02 2012

Programs

Formula

G.f.: sum(i>=1, x^i/(1-x^i)/prod(j=1..i-1, 1-t*x^j) ).

A240871 Number of partitions p of n into distinct parts such that max(p) = 3 + min(p).

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Apr 15 2014

Keywords

Examples

			a(7) counts these 2 partitions: 5+2, 4+2+1.
		

Crossrefs

Programs

  • Mathematica
    z = 40; f[n_] := f[n] = Select[IntegerPartitions[n], Max[Length /@ Split@#] == 1 &]; Table[Count[f[n], p_ /; Max[p] == 2 + Min[p]], {n, 0, z}] (* A171182 *)
        Table[Count[f[n], p_ /; Max[p] == 3 + Min[p]], {n, 0, z}] (* A240871 *)
        Table[Count[f[n], p_ /; Max[p] == 4 + Min[p]], {n, 0, z}] (* A240872 *)
        Table[Count[f[n], p_ /; Max[p] == 5 + Min[p]], {n, 0, z}] (* A240873 *)
  • PARI
    A240871aux(n, minp=0, maxp=0) = if(0==n, (minp>0 && (maxp==3+minp)), sum(i=1+maxp, min(n,3+minp), A240871aux(n-i, if(!minp,i,minp), i)));
    A240871(n) = sum(i=1,floor(n/2),A240871aux(n-i,i,i)); \\ Antti Karttunen, Jan 13 2025

Formula

From Alois P. Heinz, Jan 13 2025: (Start)
G.f.: -x^5*(x^7+2*x^6+3*x^5+3*x^4+3*x^3+3*x^2+x+1)/((x-1)*(x+1)*(x^2+1)*(x^2+x+1)).
a(n) = a(n-12) for n>=19. (End)

Extensions

More terms from Antti Karttunen, Jan 13 2025

A244966 Triangle read by rows: T(n,k) is the difference between the largest and the smallest part of the k-th partition in the list of colexicographically ordered partitions of n, with n>=1 and 1<=k<=p(n), where p(n) is the number of partitions of n.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Jul 18 2014

Keywords

Comments

The number of t's in row n gives A097364(n,t), with n>=1 and 0<=t
Rows converge to A244967, which is A141285 - 1.
Row n has length A000041(n).
Row sums give A116686.

Examples

			Triangle begins:
0;
0, 0;
0, 1, 0;
0, 1, 2, 0, 0;
0, 1, 2, 1, 3, 1, 0;
0, 1, 2, 1, 3, 2, 4, 0, 2, 0, 0;
0, 1, 2, 1, 3, 2, 4, 1, 3, 2, 5, 1, 3, 1, 0;
0, 1, 2, 1, 3, 2, 4, 1, 3, 2, 5, 2, 4, 3, 6, 0, 2, 1, 4, 2, 0, 0;
...
For n = 6 we have:
--------------------------------------------------------
.                        Largest  Smallest   Difference
k    Partition of 6        part     part       T(6,k)
--------------------------------------------------------
1:  [1, 1, 1, 1, 1, 1]      1    -    1     =     0
2:  [2, 1, 1, 1, 1]         2    -    1     =     1
3:  [3, 1, 1, 1]            3    -    1     =     2
4:  [2, 2, 1, 1]            2    -    1     =     1
5:  [4, 1, 1]               4    -    1     =     3
6:  [3, 2, 1]               3    -    1     =     2
7:  [5, 1]                  5    -    1     =     4
8:  [2, 2, 2]               2    -    2     =     0
9:  [4, 2]                  4    -    2     =     2
10: [3, 3]                  3    -    3     =     0
11: [6]                     6    -    6     =     0
--------------------------------------------------------
So the 6th row of triangle is [0,1,2,1,3,2,4,0,2,0,0] and the row sum is A116686(6) = 15.
Note that in the 6th row there are four 0's so A097364(6,0) = 4, there are two 1's so A097364(6,1) = 2, there are three 2's so A097364(6,2) = 3, there is only one 3 so A097364(6,3) = 1, there is only one 4 so A097364(6,4) = 1 and there are no 5's so A097364(6,5) = 0.
		

Formula

T(n,k) = A141285(k) - A196931(n,k), n>=1, 1<=k<=A000041(n).
Showing 1-5 of 5 results.