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

A360071 Regular tetrangle where T(n,k,i) = number of integer partitions of n of length k with i distinct parts.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jan 28 2023

Keywords

Comments

I call this a tetrangle because it is a sequence of finite triangles. - Gus Wiseman, Jan 30 2023

Examples

			Tetrangle begins:
  1   1     1       1         1           1             1
      1 0   0 1     1 1       0 2         1 2           0 3
            1 0 0   0 1 0     0 2 0       1 1 1         0 3 1
                    1 0 0 0   0 1 0 0     0 2 0 0       0 2 1 0
                              1 0 0 0 0   0 1 0 0 0     0 2 0 0 0
                                          1 0 0 0 0 0   0 1 0 0 0 0
                                                        1 0 0 0 0 0 0
For example, finite triangle n = 5 counts the following partitions:
    (5)
     .    (41)(32)
     .   (311)(221)  .
     .     (2111)    .   .
  (11111)     .      .   .   .
		

Crossrefs

Row sums are A008284 (partitions by number of parts), reverse A058398.
First columns i = 1 are A051731.
Last columns i = k are A060016.
Column sums are A116608 (partitions by number of distinct parts).
Positive terms are counted by A360072.
A000041 counts partitions, strict A000009.
Other tetrangles: A318393, A318816, A320808, A334433, A345197.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n], Length[#]==k&&Length[Union[#]]==i&]],{n,1,9},{k,1,n},{i,1,k}]

A360573 Odd numbers with exactly three zeros in their binary expansion.

Original entry on oeis.org

17, 35, 37, 41, 49, 71, 75, 77, 83, 85, 89, 99, 101, 105, 113, 143, 151, 155, 157, 167, 171, 173, 179, 181, 185, 199, 203, 205, 211, 213, 217, 227, 229, 233, 241, 287, 303, 311, 315, 317, 335, 343, 347, 349, 359, 363, 365, 371, 373, 377, 399, 407, 411, 413
Offset: 1

Views

Author

Bernard Schott, Feb 12 2023

Keywords

Comments

If m is a term then 2*m+1 is another term, since if M is the binary expansion of m, then M.1 where . stands for concatenation is the binary expansion of 2*m+1.
A052996 \ {1,3,8} is a subsequence, since for m >= 3, A052996(m) = 9*2^(m-2) - 1 has 100011..11 with m-2 trailing 1 for binary expansion.
A171389 \ {20} is a subsequence, since for m >= 1, A171389(m) = 21*2^m - 1 has 1010011..11 with m trailing 1 for binary expansion.
A198276 \ {18} is a subsequence, since for m >= 1, A198276(m) = 19*2^m - 1 has 1001011..11 with m trailing 1 for binary expansion.
Binary expansion of a(n) is A360574(n).
{8*a(n), n>0} form a subsequence of A353654 (numbers with three trailing 0 bits and three other 0 bits).
Numbers of the form 2^(a+1) - 2^b - 2^c - 2^d - 1 where a > b > c > d > 0. - Robert Israel, Feb 13 2023

Examples

			35_10 = 100011_2, so 35 is a term.
		

Crossrefs

Subsequences: A052996 \ {1,3,8}, A171389 \ {20}, A198276 \ {18}.
Odd numbers with k zeros in their binary expansion: A000225 (k=0), A190620 (k=1), A357773 (k=2), this sequence (k=3).

Programs

  • Maple
    q:= n-> n::odd and add(1-i, i=Bits[Split](n))=3:
    select(q, [$1..575])[];  # Alois P. Heinz, Feb 12 2023
    # Alternative:
    [seq(seq(seq(seq(2^(a+1) - 2^b - 2^c - 2^d - 1, d = c-1..1,-1), c=b-1..2,-1),b=a-1..3,-1),a=4..12)]; # Robert Israel, Feb 13 2023
  • Mathematica
    Select[Range[1, 500, 2], DigitCount[#, 2, 0] == 3 &] (* Amiram Eldar, Feb 12 2023 *)
  • PARI
    isok(m) = (m%2) && #select(x->(x==0), binary(m)) == 3; \\ Michel Marcus, Feb 13 2023
  • Python
    def ok(n): return n&1 and bin(n)[2:].count("0") == 3
    print([k for k in range(414) if ok(k)]) # Michael S. Branicky, Feb 12 2023
    
  • Python
    from itertools import count, islice
    from sympy.utilities.iterables import multiset_permutations
    def A360573_gen(): # generator of terms
        yield from (int('1'+''.join(d)+'1',2) for l in count(0) for d in  multiset_permutations('000'+'1'*l))
    A360573_list = list(islice(A360573_gen(),54)) # Chai Wah Wu, Feb 18 2023
    
  • Python
    from itertools import combinations, count, islice
    def agen(): yield from ((1<Michael S. Branicky, Feb 18 2023
    
  • Python
    from math import comb, isqrt
    from sympy import integer_nthroot
    def A056557(n): return (k:=isqrt(r:=n+1-comb((m:=integer_nthroot(6*(n+1), 3)[0])-(nA333516(n): return (r:=n-1-comb((m:=integer_nthroot(6*n, 3)[0])+(n>comb(m+2, 3))+1, 3))-comb((k:=isqrt(m:=r+1<<1))+(m>k*(k+1)), 2)+1
    def A360010(n): return (m:=integer_nthroot(6*n, 3)[0])+(n>comb(m+2, 3))
    def A360573(n):
        a = (a2:=integer_nthroot(24*n, 4)[0])+(n>comb(a2+2, 4))+3
        j = comb(a-1,4)-n
        b, c, d = A360010(j+1)+2, A056557(j)+2, A333516(j+1)
        return (1<Chai Wah Wu, Dec 18 2024
    

Formula

A023416(a(n)) = 3.
Let a = floor((24n)^(1/4))+4 if n>binomial(floor((24n)^(1/4))+2,4) and a = floor((24n)^(1/4))+3 otherwise. Let j = binomial(a-1,4)-n. Then a(n) = 2^a-1-2^(A360010(j+1)+2)-2^(A056557(j)+2)-2^(A333516(j+1)). - Chai Wah Wu, Dec 18 2024

A360072 Number of pairs of positive integers (k,i) such that k >= i and there exists an integer partition of n of length k with i distinct parts.

Original entry on oeis.org

0, 1, 2, 3, 5, 5, 9, 9, 13, 14, 18, 19, 26, 25, 30, 34, 39, 40, 48, 48, 56, 59, 64, 67, 78, 78, 84, 89, 97, 99, 111, 111, 121, 125, 131, 137, 149, 149, 158, 165, 176, 177, 190, 191, 202, 210, 216, 222, 238, 239, 250, 256, 266, 270, 284, 289, 302, 307, 316, 323
Offset: 0

Views

Author

Gus Wiseman, Jan 28 2023

Keywords

Comments

This is the number of nonzero terms in the n-th triangle of A360071.

Examples

			The a(5) = 5 pairs are: (1,1), (2,2), (3,2), (4,2), (5,1). The pair (3,3) is absent because it is not possible to partition 5 into 3 parts, all 3 of which are distinct.
The a(6) = 9 pairs are: (1,1), (2,1), (2,2), (3,1), (3,2), (3,3), (4,2), (5,2), (6,1). The pair (3,3) is present because (3,2,1) is a partition of 6 into 3 parts, all 3 of which are distinct.
		

Crossrefs

A000041 counts integer partitions, strict A000009.
A008284 counts partitions by number of parts, reverse A058398.
A116608 counts partitions by number of distinct parts.

Programs

  • Mathematica
    Table[Count[Flatten[Sign[Table[Length[Select[IntegerPartitions[n], Length[#]==k&&Length[Union[#]]==i&]],{k,1,n},{i,1,k}]]],1],{n,0,30}]
  • PARI
    a(n) = if(n < 1, 0, numdiv(n) + sum(k=2, (sqrtint(8*n+1)-1)\2, n-binomial(k+1,2)+1)) \\ Andrew Howroyd, Jan 30 2023

Formula

a(n) = A000005(n) + Sum_{k=2..floor((sqrt(8*n+1)-1)/2)} (1 + n - binomial(k+1,2)) for n > 0. - Andrew Howroyd, Jan 30 2023

Extensions

Terms a(31) and beyond from Andrew Howroyd, Jan 30 2023

A360240 Weakly decreasing triples of positive integers sorted lexicographically and concatenated.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Feb 11 2023

Keywords

Examples

			Triples begin: (1,1,1), (2,1,1), (2,2,1), (2,2,2), (3,1,1), (3,2,1), (3,2,2), (3,3,1), (3,3,2), (3,3,3), ...
		

Crossrefs

The triples have sums A070770.
Positions of first appearances are A158842.
For pairs instead of triples we have A330709 + 1.
The zero-based version is A331195.
- The first part is A360010 = A056556 + 1.
- The second part is A194848 = A056557 + 1.
- The third part is A333516 = A056558 + 1.

Programs

  • Mathematica
    nn=9;Join@@Select[Tuples[Range[nn],3],GreaterEqual@@#&]
  • Python
    from math import isqrt, comb
    from sympy import integer_nthroot
    def A360240(n): return (m:=integer_nthroot((n-1<<1)+6,3)[0])+(n>3*comb(m+2,3)) if (a:=n%3)==1 else (k:=isqrt(r:=(b:=(n-1)//3)+1-comb((m:=integer_nthroot((n-1<<1)-1,3)[0])-(b(k<<2)*(k+1)+1) if a==2 else 1+(r:=(b:=(n-1)//3)-comb((m:=integer_nthroot((n-1<<1)-3,3)[0])+(b>=comb(m+2,3))+1,3))-comb((k:=isqrt(m:=r+1<<1))+(m>k*(k+1)),2) # Chai Wah Wu, Jun 07 2025

Formula

a(n) = A331195(n-1) + 1.

A379269 Numbers whose binary representation has exactly three zeros.

Original entry on oeis.org

8, 17, 18, 20, 24, 35, 37, 38, 41, 42, 44, 49, 50, 52, 56, 71, 75, 77, 78, 83, 85, 86, 89, 90, 92, 99, 101, 102, 105, 106, 108, 113, 114, 116, 120, 143, 151, 155, 157, 158, 167, 171, 173, 174, 179, 181, 182, 185, 186, 188, 199, 203, 205, 206, 211, 213, 214, 217
Offset: 1

Views

Author

Chai Wah Wu, Dec 19 2024

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[2^8],Count[IntegerDigits[#,2],0]==3&] (* James C. McMahon, Dec 20 2024 *)
  • Python
    from math import comb, isqrt
    from sympy import integer_nthroot
    def A056557(n): return (k:=isqrt(r:=n+1-comb((m:=integer_nthroot(6*(n+1), 3)[0])-(nA333516(n): return (r:=n-1-comb((m:=integer_nthroot(6*n, 3)[0])+(n>comb(m+2, 3))+1, 3))-comb((k:=isqrt(m:=r+1<<1))+(m>k*(k+1)), 2)+1
    def A360010(n): return (m:=integer_nthroot(6*n, 3)[0])+(n>comb(m+2, 3))
    def A379269(n):
        a = (a2:=integer_nthroot(24*n, 4)[0])+(n>comb(a2+2, 4))+2
        j = comb(a,4)-n
        b, c, d = A360010(j+1)+1, A056557(j)+1, A333516(j+1)-1
        return (1<
    				

Formula

a(n) = (A360573(n)-1)/2.
A023416(a(n)) = 3.
Let a = floor((24n)^(1/4))+3 if n>binomial(floor((24n)^(1/4))+2,4) and a = floor((24n)^(1/4))+2 otherwise. Let j = binomial(a,4)-n. Then a(n) = 2^a-1-2^(A360010(j+1)+1)-2^(A056557(j)+1)-2^(A333516(j+1)-1).
Sum_{n>=1} 1/a(n) = 1.3949930090659130972172214185888677947877214389482588641632435250211546702139813215203065255971026537... (calculated using Baillie's irwinSums.m, see Links). - Amiram Eldar, Dec 21 2024

A376276 Table T(n, k) n > 0, k > 2 read by upward antidiagonals. The sequences in each column k is a triangle read by rows (blocks), where each row is a permutation of the numbers of its constituents. The length of the row number n in column k is equal to the n-th k-gonal number A086270.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Sep 18 2024

Keywords

Comments

A209278 presents an algorithm for generating permutations.
The sequence is an intra-block permutation of integer positive numbers.

Examples

			Table begins:
  k =      3   4   5   6   7   8
--------------------------------------
  n = 1:   1,  1,  1,  1,  1,  1, ...
  n = 2:   3,  4,  4,  5,  5,  6, ...
  n = 3:   4,  3,  5,  4,  6,  5, ...
  n = 4:   2,  5,  3,  6,  4,  7, ...
  n = 5:   8,  2,  6,  3,  7,  4, ...
  n = 6:   7, 10,  2,  7,  3,  8, ...
  n = 7:   9, 11, 13,  2,  8,  3, ...
  n = 8:   6,  9, 12, 15,  2,  9, ...
  n = 9:  10, 12, 14, 16, 18,  2, ...
  n =10:   5,  8, 11, 14, 17, 20, ...
  n =11:  16, 13, 15, 17, 19, 21, ...
  n =12:  15, 7,  10, 13, 16, 19, ...
  n =13:  17, 14, 16, 18, 20, 22, ...
  n =14:  14,  6,  9, 12, 15, 18, ...
  n =15:  18, 23, 17, 19, 21, 23, ...
  n =16:  13, 22,  8, 11, 14, 17, ...
  n =17:  19, 24, 18, 20, 22, 24, ...
  n =18:  12, 21,  7, 10, 13, 16, ...
  n =19:  20, 25, 30, 21, 23, 25, ...
  n =20:  11, 20, 29,  9, 12, 15, ...
          ... .
For k = 3 the first 4 blocks have lengths 1,3,6 and 10.
For k = 4 the first 3 blocks have lengths 1,4, and 9.
For k = 5 the first 3 blocks have lengths 1,5, and 12.
Each block is a permutation of the numbers of its constituents.
The first 6 antidiagonals are:
  1;
  3, 1;
  4, 4, 1;
  2, 3, 4, 1;
  8, 5, 5, 5, 1;
  7, 2, 3, 4, 5, 1;
		

References

  • E. Deza and M. M. Deza, Figurate numbers, World Scientific Publishing (2012), page 45.

Crossrefs

Programs

  • Mathematica
    T[n_,k_]:=Module[{L,R,P,Res,result},L=Ceiling[Max[x/.NSolve[x^3*(k-2)+3*x^2-x*(k-5)-6*n==0,x,Reals]]];
    R=n-(((L-1)^3)*(k-2)+3*(L-1)^2-(L-1)*(k-5))/6;P=Which[OddQ[R]&&OddQ[k*L*(L-1)/2-L^2+2*L],((k*L*(L-1)/2-L^2+2*L+1-R)+1)/2,OddQ[R]&&EvenQ[k*L*(L-1)/2-L^2+2*L],(R+k*L*(L-1)/2-L^2+2*L+1)/2,EvenQ[R]&&OddQ[k*L*(L-1)/2-L^2+2*L],Ceiling[(k*L*(L-1)/2-L^2+2*L+1)/2]+R/2,EvenQ[R]&&EvenQ[k*L*(L-1)/2-L^2+2*L],Ceiling[(k*L*(L-1)/2-L^2+2*L+1)/2]-R/2];
    Res=P+((L-1)^3*(k-2)+3*(L-1)^2-(L-1)*(k-5))/6;result=Res;result]
    Nmax=6;Table[T[n,k],{n,1,Nmax},{k,3,Nmax+2}]

Formula

T(n,k) = P(n,k) + ((L(n,k)-1)^3*(k-2)+3*(L(n,k)-1)^2-(L(n,k)-1)*(k-5))/6, where L(n,k) = ceiling(x(n,k)), x(n,k) is largest real root of the equation x^3*(k - 2) + 3*x^2 - x*(k - 5) - 6*n = 0. R(n,k) = n - ((L(n,k) - 1)^3*(k-2)+3*(L(n,k)-1)^2-(L(n,k)-1)*(k-5))/6. P(n,k) = ((k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) + 2 - R(n,k)) / 2 if R is odd and (k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) is odd, P(n,k) = (R(n,k) + (k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) + 1) / 2 if R is odd and (k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) is even, P(n,k) = ceiling(((k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) + 1) / 2) + (R(n,k) / 2) if R is even and (k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) is odd, P(n,k) = ceiling(((k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) + 1) / 2) - (R(n,k) / 2) if R is even and (k * L(n,k) * (L(n,k) - 1) / 2) - L(n,k)^2 + 2 * L(n,k) is even.
T(1,n) = A000012(n). T(2,n) = A004526(n+7). T(3,n) = A028242(n+6). T(4,n) = A084964(n+5). T(n-2,n) = A000027(n) for n > 3. L(n,3) = A360010(n). L(n,4) = A074279(n).

A379270 Numbers with only digits "1" and three digits "0".

Original entry on oeis.org

1000, 10001, 10010, 10100, 11000, 100011, 100101, 100110, 101001, 101010, 101100, 110001, 110010, 110100, 111000, 1000111, 1001011, 1001101, 1001110, 1010011, 1010101, 1010110, 1011001, 1011010, 1011100, 1100011, 1100101, 1100110, 1101001, 1101010, 1101100
Offset: 1

Views

Author

Chai Wah Wu, Dec 19 2024

Keywords

Comments

Binary representation of A379269.
Numbers in A007088 with three 0 digits.

Crossrefs

Programs

  • Mathematica
    Select[Range[10^7],Count[IntegerDigits[#],0]==3&&Max[IntegerDigits[#]]==1&] (* James C. McMahon, Dec 20 2024 *)
  • Python
    from math import isqrt, comb
    from sympy import integer_nthroot
    def A056557(n): return (k:=isqrt(r:=n+1-comb((m:=integer_nthroot(6*(n+1), 3)[0])-(nA333516(n): return (r:=n-1-comb((m:=integer_nthroot(6*n, 3)[0])+(n>comb(m+2, 3))+1, 3))-comb((k:=isqrt(m:=r+1<<1))+(m>k*(k+1)), 2)+1
    def A360010(n): return (m:=integer_nthroot(6*n, 3)[0])+(n>comb(m+2, 3))
    def A379270(n):
        a = (a2:=integer_nthroot(24*n, 4)[0])+(n>comb(a2+2, 4))+2
        j = comb(a,4)-n
        b, c, d = A360010(j+1)+1, A056557(j)+1, A333516(j+1)-1
        return (10**a-1)//9-10**b-10**c-10**d

Formula

a(n) = A007088(A379269(n)).
Showing 1-7 of 7 results.