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

A095145 Triangle, read by rows, formed by reading Pascal's triangle (A007318) mod 12.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, May 29 2004

Keywords

Crossrefs

Sequences based on the triangles formed by reading Pascal's triangle mod m: A047999 (m = 2), A083093 (m = 3), A034931 (m = 4), A095140 (m = 5), A095141 (m = 6), A095142 (m = 7), A034930 (m = 8), A095143 (m = 9), A008975 (m = 10), A095144 (m = 11), (this sequence) (m = 12), A275198 (m = 14), A034932 (m = 16).

Programs

  • Mathematica
    Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 12]
  • Python
    # uses python code from A034931 and A083093
    from sympy.ntheory.modular import crt
    def A095145(n): return crt([4,3],[A034931(n),A083093(n)])[0] # Chai Wah Wu, Jul 19 2025

Formula

T(i, j) = binomial(i, j) mod 12.

A275198 Triangle, read by rows, formed by reading Pascal's triangle (A007318) mod 14.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Aug 11 2016

Keywords

Examples

			Triangle begins:
                      1,
                    1,  1,
                  1,  2,  1,
                1,  3,  3,  1,
              1,  4,  6,  4,  1,
            1,  5, 10, 10,  5,  1,
          1,  6,  1,  6,  1,  6,  1,
        1,  7,  7,  7,  7,  7,  7,  1,
      1,  8,  0,  0,  0,  0,  0,  8,  1,
    1,  9,  8,  0,  0,  0,  0,  8,  9,  1,
  1, 10,  3,  8,  0,  0,  0,  8,  3, 10,  1,
  ...
		

Crossrefs

Sequences based on the triangles formed by reading Pascal's triangle mod m: A047999 (m = 2), A083093 (m = 3), A034931 (m = 4), A095140 (m = 5), A095141 (m = 6), A095142 (m = 7), A034930 (m = 8), A095143 (m = 9), A008975 (m = 10), A095144 (m = 11), A095145 (m = 12), (this sequence) (m = 14), A034932 (m = 16).

Programs

  • Mathematica
    Mod[Flatten[Table[Binomial[n, k], {n, 0, 14}, {k, 0, n}]], 14]
  • Python
    from math import comb, isqrt
    from sympy.ntheory.modular import crt
    def A275198(n):
        w, c = n-((r:=(m:=isqrt(k:=n+1<<1))-(k<=m*(m+1)))*(r+1)>>1), 1
        d = int(not ~r & w)
        while True:
            r, a = divmod(r,7)
            w, b = divmod(w,7)
            c = c*comb(a,b)%7
            if r<7 and w<7:
                c = c*comb(r,w)%7
                break
        return crt([7,2],[c,d])[0] # Chai Wah Wu, May 01 2025

Formula

T(n, k) = binomial(n, k) mod 14.
a(n) = A070696(A007318(n)).

A249723 Numbers n such that there is a multiple of 9 on row n of Pascal's triangle with property that all multiples of 4 on the same row (if they exist) are larger than it.

Original entry on oeis.org

9, 10, 13, 15, 18, 19, 21, 27, 29, 31, 37, 39, 43, 45, 46, 47, 54, 55, 59, 63, 75, 79, 81, 82, 83, 85, 87, 90, 91, 93, 95, 99, 103, 109, 111, 117, 118, 119, 123, 126, 127, 135, 139, 151, 153, 154, 157, 159, 162, 163, 165, 167, 171, 175, 181, 183, 187, 189, 190, 191, 198, 199, 207, 219, 223, 225, 226, 229, 231, 234, 235, 237, 239, 243, 245, 247, 251, 253, 255
Offset: 1

Views

Author

Antti Karttunen, Nov 04 2014

Keywords

Comments

All n such that on row n of A095143 (Pascal's triangle reduced modulo 9) there is at least one zero and the distance from the edge to the nearest zero is shorter than the distance from the edge to the nearest zero on row n of A034931 (Pascal's triangle reduced modulo 4), the latter distance taken to be infinite if there are no zeros on that row in the latter triangle.
A052955 from its eight term onward, 31, 47, 63, 95, 127, ... seems to be a subsequence. See also the comments at A249441.

Examples

			Row 13 of Pascal's triangle (A007318) is: {1, 13, 78, 286, 715, 1287, 1716, 1716, 1287, 715, 286, 78, 13, 1} and the term binomial(13, 5) = 1287 = 9*11*13 occurs before any term which is a multiple of 4. Note that one such term occurs right next to it, as binomial(13, 6) = 1716 = 4*3*11*13, but 1287 < 1716, thus 13 is included.
		

Crossrefs

Complement: A249724.
Natural numbers (A000027) is a disjoint union of the sequences A048278, A249722, A249723 and A249726.

Programs

  • PARI
    A249723list(upto_n) = { my(i=0, n=0); while(i
    				

A384715 a(n) = Sum_{k=0..n} (binomial(n, k) mod 4).

Original entry on oeis.org

1, 2, 4, 8, 4, 8, 12, 16, 4, 8, 12, 24, 12, 24, 24, 32, 4, 8, 12, 24, 12, 24, 32, 48, 12, 24, 32, 48, 24, 48, 48, 64, 4, 8, 12, 24, 12, 24, 32, 48, 12, 24, 32, 64, 32, 64, 64, 96, 12, 24, 32, 48, 32, 64, 64, 96, 24, 48, 64, 96, 48, 96, 96, 128, 4, 8, 12, 24
Offset: 0

Views

Author

David Radcliffe, Jun 23 2025

Keywords

Comments

This is a 2-automatic sequence.

Examples

			Let b(n) be the binary expansion of n. Then a(n) = (1 + p10 + p11) * 2^c, where c is the number of set bits in b(n), p10 is the number of '10' patterns in b(n), and p11 is 1 or 0 depending on whether the pattern '11' is occurring in b(n) or not. This formula is used by _Chai Wah Wu_ in the Python function below. For instance:
  n = 25 -> b(n) = 11001 -> a(n) = (1+1+1) * 2^3 = 24.
  n = 26 -> b(n) = 11010 -> a(n) = (1+2+1) * 2^3 = 32.
  n = 27 -> b(n) = 11011 -> a(n) = (1+1+1) * 2^4 = 48.
- _Peter Luschny_, Jun 25 2025
		

Crossrefs

Cf. A001316, A014081, A033264, A051638 (mod 3 analog), A085357. Row sums of triangle A034931.

Programs

  • Mathematica
    A384715[n_] := 2^DigitSum[n, 2]*(StringCount[IntegerString[n, 2], "10"] - Boole[BitAnd[n,2*n] == 0] + 2);
    Array[A384715, 100, 0] (* Paolo Xausa, Jun 26 2025 *)
  • PARI
    a(n) = sum(k=0, n, binomial(n,k)%4); \\ Michel Marcus, Jun 25 2025
  • Python
    def A001316(n): return (1 + (n % 2)) * A001316(n // 2) if n else 1
    def A033264(n): return (n % 4 == 2) + A033264(n // 2) if n else 0
    def A085357(n): return int(n & (n<<1) == 0)
    def A384715(n): return A001316(n) * (A033264(n) - A085357(n) + 2)
    
  • Python
    def A384715(n): return (((n>>1)&~n).bit_count()+bool(n&(n<<1))+1)<Chai Wah Wu, Jun 25 2025
    
  • Python
    def a(n: int) -> int:  # after Chai Wah Wu
        b = bin(n)[2:]; p = b.count("10"); q = b.count("11")
        return (p + (2 if q else 1)) * 2**n.bit_count()  # Peter Luschny, Jun 25 2025
    

Formula

a(n) = A001316(n) * (A033264(n) - A085357(n) + 2) for n > 0.
Recurrences:
a(4n) = a(2n),
a(4n+1) = 2a(2n),
a(8n+2) = a(4n+2) + 2a(2n) - a(2n+1),
a(8n+3) = a(4n+3) + 4a(2n) - 4a(n),
a(8n+6) = a(4n+3) + 2a(4n+2) - 2a(2n+1),
a(8n+7) = 2a(4n+3).

A163000 Count of integers x in [0,n] satisfying A000120(x) + A000120(n-x) = A000120(n) + 1.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 2, 0, 1, 2, 4, 4, 2, 4, 4, 0, 1, 2, 4, 4, 4, 8, 8, 8, 2, 4, 8, 8, 4, 8, 8, 0, 1, 2, 4, 4, 4, 8, 8, 8, 4, 8, 12, 16, 8, 16, 16, 16, 2, 4, 8, 8, 8, 16, 16, 16, 4, 8, 16, 16, 8, 16, 16, 0, 1, 2, 4, 4, 4, 8, 8, 8, 4, 8, 12, 16, 8, 16, 16, 16, 4, 8, 12, 16, 12, 24, 24, 32, 8, 16, 24, 32, 16
Offset: 0

Views

Author

Vladimir Shevelev, Jul 20 2009

Keywords

Comments

For every solution x, binomial(n,x) is 2 times an odd integer.
A generalization: for every solution 0 <= x <= n of the equation A000120(x) + A000120(n-x) = A000120(n) + r, binomial(n,x) is 2^r times an odd integer.
Apparently this is also the number of 2's in the n-th row of A034931. - R. J. Mathar, Jul 28 2017

Crossrefs

A001316 and A163577 count binomial coefficients with 2-adic valuation 0 and 2. A275012 gives a measure of complexity of these sequences. - Eric Rowland, Mar 15 2017

Programs

  • Maple
    A163000 := proc(n) local a,x; a := 0 ; for x from 0 to n do if A000120(x)+A000120(n-x) = A000120(n)+1 then a := a+1; fi; od: a; end:
    seq(A163000(n),n=0..100) ; # R. J. Mathar, Jul 21 2009
  • Mathematica
    okQ[x_, n_] := DigitCount[x, 2, 1] + DigitCount[n - x, 2, 1] == DigitCount[n, 2, 1] + 1; a[n_] := Count[Range[0, n], x_ /; okQ[x, n]]; Table[a[n], {n, 0, 92}] (* Jean-François Alcover, Jul 13 2017 *)
  • PARI
    a(n) = my(z=hammingweight(n)+1); sum(x=0, n, hammingweight(x) + hammingweight(n-x) == z); \\ Michel Marcus, Jun 06 2021

Formula

a(n)=0 iff n=2^k-1, k>=0. a(n)=1 iff n=2^k, k>=1.
Conjecture: a(n) = A033264(n)* 2^(A000120(n)-1); from [Davis & Webb]. - R. J. Mathar, Jul 28 2017

Extensions

Extended beyond a(22) by R. J. Mathar, Jul 21 2009

A249732 Number of (not necessarily distinct) multiples of 4 on row n of Pascal's triangle.

Original entry on oeis.org

0, 0, 0, 0, 2, 0, 1, 0, 6, 4, 3, 0, 7, 2, 3, 0, 14, 12, 11, 8, 13, 6, 7, 0, 19, 14, 11, 4, 17, 6, 7, 0, 30, 28, 27, 24, 29, 22, 23, 16, 33, 26, 23, 12, 29, 14, 15, 0, 43, 38, 35, 28, 37, 22, 23, 8, 45, 34, 27, 12, 37, 14, 15, 0, 62, 60, 59, 56, 61, 54, 55, 48, 65, 58, 55, 44, 61, 46, 47, 32
Offset: 0

Views

Author

Antti Karttunen, Nov 04 2014

Keywords

Comments

a(n) = Number of zeros on row n of A034931 (Pascal's triangle reduced modulo 4).
This should have a formula (see A048967).

Examples

			Row 9 of Pascal's triangle is: {1,9,36,84,126,126,84,36,9,1}. The terms 36 and 84 are only multiples of four, and both of them occur two times on that row, thus a(9) = 2*2 = 4.
Row 10 of Pascal's triangle is: {1,10,45,120,210,252,210,120,45,10,1}. The terms 120 (= 4*30) and 252 (= 4*63) are only multiples of four, and the former occurs twice, while the latter is alone at the center, thus a(10) = 2+1 = 3.
		

Crossrefs

Programs

  • PARI
    A249732(n) = { my(c=0); for(k=0,n\2,if(!(binomial(n,k)%4),c += (if(k<(n/2),2,1)))); return(c); } \\ Slow...
    for(n=0, 8192, write("b249732.txt", n, " ", A249732(n)));
    
  • Python
    def A249732(n): return n+1-(2+((n>>1)&~n).bit_count()<>1) # Chai Wah Wu, Jul 24 2025

Formula

Other identities:
a(n) <= A048277(n) for all n.
a(n) <= A048967(n) for all n.

A046097 Values of n for which binomial(2n-1, n) is squarefree.

Original entry on oeis.org

1, 2, 3, 4, 6, 9, 10, 12, 36
Offset: 1

Views

Author

Keywords

Comments

No more terms up to 2^300. The sequence is finite by results of Sander and of Granville and Ramaré (see links). - Robert Israel, Dec 10 2015

Crossrefs

Cf. A001700.
For a term to be here, it needs to be at least in the intersection of A048645, A051382, A050607, A050608 and an infinitude of similar sequences. The corresponding location in next-to-center column should be nonzero in A034931 (Pascal's triangle mod 4) and all similarly constructed fractal triangles (Pascal's triangle mod p^2).

Programs

  • Magma
    [n: n in [1..150] | IsSquarefree(Binomial(2*n-1,n))]; // Vincenzo Librandi, Dec 10 2015
  • Maple
    select(n -> numtheory:-issqrfree(binomial(2*n-1,n)), [$1..2000]); # Robert Israel, Dec 09 2015
    N:= 300: # to find all terms <= 2^N
    carries:= proc(n,m,p)
    # number of carries when adding n + m in base p.
    local A,B,C,j,nc, t;
       A:= convert(m,base,p);
       B:= convert(n,base,p);
    C:= 0; nc:= 0;
       if nops(A) < nops(B) then A = [op(A),0$(nops(B)-nops(A))]
       elif nops(A) > nops(B) then B:= [op(B), 0$(nops(A)-nops(B))]
       fi;
    for j from 1 to nops(A) do
        t:= C + A[j] + B[j];
        if t >= p then
           nc:= nc+1;
           C:= 1;
        else
           C:= 0
        fi
    od:
    nc;
    end proc:
    Cands:=  {seq(2^j,j=0..N), seq(seq(2^j + 2^k, k=0..j-1),j=1..N-1)}:
    for i from 2 to 10 do
      Cands:= select(n -> carries(n-1,n,ithprime(i)) <= 1, Cands)
    od:
    select(n -> numtheory:-issqrfree(binomial(2*n-1,n)),Cands); # Robert Israel, Dec 10 2015
  • Mathematica
    Select[ Range[1500], SquareFreeQ[ Binomial[ 2#-1, #]] &] (* Jean-François Alcover, Oct 25 2012 *)
  • PARI
    is(n)=issquarefree(binomial(2*n-1,n)) \\ Anders Hellström, Dec 09 2015
    

Extensions

James Sellers reports no further terms below 1500.
Michael Somos checked to 99999. Probably there are no more terms.
Mauro Fiorentini checked up to 2^64, as for n = 545259520, the binomial coefficient is a multiple of 5^4 and other possible exceptions have been checked (see Weisstein page for details).

A249722 Numbers n such that there is a multiple of 4 on row n of Pascal's triangle with property that all multiples of 9 on the same row (if they exist) are larger than it.

Original entry on oeis.org

4, 6, 8, 12, 14, 16, 17, 20, 22, 24, 25, 26, 28, 30, 32, 33, 34, 35, 38, 40, 41, 42, 44, 48, 49, 50, 51, 52, 53, 56, 57, 58, 60, 61, 62, 64, 65, 66, 67, 68, 69, 70, 71, 74, 76, 77, 78, 80, 84, 86, 88, 89, 92, 94, 96, 97, 98, 100, 101, 102, 104, 105, 106, 107, 112, 113, 114, 115, 116, 120, 121, 122, 124, 125
Offset: 1

Views

Author

Antti Karttunen, Nov 04 2014

Keywords

Comments

All n such that on row n of A034931 (Pascal's triangle reduced modulo 4) there is at least one zero and the distance from the edge to the nearest zero is shorter than the distance from the edge to the nearest zero on row n of A095143 (Pascal's triangle reduced modulo 9), the latter distance taken to be infinite if there are no zeros on that row in the latter triangle.

Examples

			Row 4 of Pascal's triangle (A007318) is {1,4,6,4,1}. The least multiple of 4 occurs as C(4,1) = 4, and there are no multiples of 9 present, thus 4 is included among the terms.
Row 12 of Pascal's triangle is {1,12,66,220,495,792,924,792,495,220,66,12,1}. The least multiple of 4 occurs as C(12,1) = 12, which is less than the least multiple of 9 present at C(12,4) = 495 = 9*55, thus 12 is included among the terms.
		

Crossrefs

A subsequence of A249724.
Natural numbers (A000027) is a disjoint union of the sequences A048278, A249722, A249723 and A249726.

Programs

  • PARI
    A249722list(upto_n) = { my(i=0, n=0); while(i
    				

A249726 Numbers n such that there is a multiple of 36 on row n of Pascal's triangle with property that it is also the least multiple of 4 and the least multiple of 9 on the same row.

Original entry on oeis.org

36, 72, 73, 108, 110, 144, 145, 147, 180, 216, 217, 218, 221, 252, 288, 289, 291, 295, 324, 326, 360, 361, 396, 432, 433, 434, 435, 437, 443, 468, 504, 505, 540, 542, 576, 577, 579, 583, 612, 648, 649, 650, 653, 684, 720, 721, 723, 756, 758, 792, 793, 828, 864, 865, 866, 867, 869, 871, 875, 887, 900, 936, 937, 972, 974, 1008, 1009, 1011, 1044, 1080
Offset: 1

Views

Author

Antti Karttunen, Nov 04 2014

Keywords

Comments

All n such that both on row n of A034931 (Pascal's triangle reduced modulo 4) and on row n of A095143 (Pascal's triangle reduced modulo 9) there is at least one zero and the distance from the edge to the nearest zero is same on both rows.

Crossrefs

Subsequence of A249724.
A044102 is a subsequence (after zero).
Natural numbers (A000027) is a disjoint union of the sequences A048278, A249722, A249723 and A249726.

Programs

  • PARI
    A249726list(upto_n) = { my(i=0, n=0); while(i
    				

A249731 Number of multiples of 4 on row n of Pascal's triangle minus the number of multiples of 9 on the same row: a(n) = A249732(n) - A249733(n).

Original entry on oeis.org

0, 0, 0, 0, 2, 0, 1, 0, 6, -2, 0, 0, 3, 0, 3, -2, 13, 12, -1, 2, 13, -2, 3, 0, 15, 12, 11, -20, -4, -12, -12, -14, 21, 14, 20, 24, 1, 2, 11, -4, 20, 20, 11, 6, 29, -18, -4, -6, 22, 26, 32, 18, 32, 22, -25, -34, 9, -4, -1, -6, 9, 0, 15, -50, 25, 36, 23, 32, 49, 32, 44, 48, 13, 26, 43, 10, 41, 40, 31, 24, 73, -12
Offset: 0

Views

Author

Antti Karttunen, Nov 05 2014

Keywords

Crossrefs

Programs

  • Python
    import re
    from gmpy2 import digits
    def A249731(n):
        s = digits(n,3)
        n1 = s.count('1')
        n2 = s.count('2')
        n01 = s.count('10')
        n02 = s.count('20')
        n11 = len(re.findall('(?=11)',s))
        n12 = s.count('21')
        return (((3*(n01+1)+(n02<<2)+n12<<2)+3*n11)*(3**n2<>1)&~n).bit_count()<>1) # Chai Wah Wu, Jul 24 2025
  • Scheme
    (define (A249731 n) (- (A249732 n) (A249733 n)))
    

Formula

a(n) = A249732(n) - A249733(n).
Previous Showing 11-20 of 24 results. Next