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.

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).

A048277 Number of (not necessarily distinct) nonsquarefree numbers among C(n,k), k=0..n.

Original entry on oeis.org

0, 0, 0, 0, 2, 0, 1, 0, 6, 8, 5, 0, 9, 4, 3, 2, 15, 12, 17, 12, 13, 12, 11, 0, 21, 22, 19, 26, 25, 18, 25, 20, 31, 30, 27, 28, 35, 30, 25, 28, 37, 30, 29, 18, 29, 38, 27, 6, 47, 48, 49, 48, 47, 36, 51, 50, 55, 52, 49, 38, 53, 36, 23, 56, 63, 62, 61, 60, 61, 54, 59, 54, 71, 66, 57
Offset: 0

Views

Author

Keywords

Comments

Number of nonsquarefree numbers (A013929) on row n of Pascal's triangle (A007318). - Antti Karttunen, Nov 05 2014

Examples

			a(13) = 4 because C(13,5) = C(13,8) = 3^2*11*13 and C(13,6) = C(13,7) = 2^2*3*11*13.
If n=20, then C[ 20, k ] is divisible by a square for 13 values of k, i.e. for k = 1, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15, 17, 19, so a[ 20 ] = 13.
		

Crossrefs

Programs

  • Maple
    seq(nops(remove(numtheory:-issqrfree,[seq(binomial(n,k),k=0..n)])),n=0..100); # Robert Israel, Nov 05 2014
  • Mathematica
    f[ n_ ] := (c = 0; k = 1; While[ k < n, If[ Union[ Transpose[ FactorInteger[ Binomial[ n, k ] ] ] [ [ 2 ] ] ] [ [ -1 ] ] > 1, c++ ]; k++ ]; c); Table[ f[ n ], {n, 0, 75} ]
    Table[(1 + n) - Length[Select[Binomial[n, Range[0, n]], SquareFreeQ[#] &]], {n, 0, 100}] (* Vincenzo Librandi, Nov 06 2014 *)
  • PARI
    a(n) = sum(k=0, n, !issquarefree(binomial(n, k))); \\ Michel Marcus, Mar 05 2014
    
  • PARI
    A048277(n) = sum(k=0,n\2,((0==moebius(binomial(n,k)))*(if(k<(n/2),2,1))));
    for(n=0, 8192, write("b048277.txt", n, " ", A048277(n))); \\ b-file was computed with this program. - Antti Karttunen, Nov 05 2014

Formula

From Antti Karttunen, Nov 05 2014: (Start)
a(n) = 1 + n - A048276(n).
Also, for all n >= 0:
a(n) >= A249732(n).
a(n) >= A249733(n).
(End)

Extensions

Definition corrected by Michel Marcus, Mar 05 2014

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
    				

A249720 a(n) = 2 * A249719(n).

Original entry on oeis.org

10, 16, 28, 30, 32, 34, 40, 46, 48, 50, 52, 64, 70, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 112, 118, 120, 122, 124, 130, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 172, 178, 190, 192, 194, 196, 202, 208, 210, 212, 214, 226, 232, 244, 246, 248, 250, 252, 254, 256
Offset: 1

Views

Author

Antti Karttunen, Nov 14 2014

Keywords

Comments

Gives the positions of odd terms in A249733.

Crossrefs

Programs

Formula

a(n) = 2 * A249719(n).

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.

A249719 Complement of A051382.

Original entry on oeis.org

5, 8, 14, 15, 16, 17, 20, 23, 24, 25, 26, 32, 35, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 56, 59, 60, 61, 62, 65, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 86, 89, 95, 96, 97, 98, 101, 104, 105, 106, 107, 113, 116, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131
Offset: 1

Views

Author

Antti Karttunen, Nov 05 2014

Keywords

Comments

Numbers n whose base 3 expansion does not match (0|1)*(02)?(0|1)*

Crossrefs

Complement: A051382.
Terms of A249720 halved.

A249721 Numbers whose base-3 representation consists entirely of 0's and 2's, except possibly for a single pair of adjacent 1's among them.

Original entry on oeis.org

0, 2, 4, 6, 8, 12, 14, 18, 20, 22, 24, 26, 36, 38, 42, 44, 54, 56, 58, 60, 62, 66, 68, 72, 74, 76, 78, 80, 108, 110, 114, 116, 126, 128, 132, 134, 162, 164, 166, 168, 170, 174, 176, 180, 182, 184, 186, 188, 198, 200, 204, 206, 216, 218, 220, 222, 224, 228, 230, 234, 236, 238, 240, 242, 324
Offset: 0

Views

Author

Antti Karttunen, Nov 14 2014

Keywords

Comments

9 divides neither C(s-1,s/2) (= A001700(s/2)) nor C(s,s/2) (= A000984(s/2)) if and only if s = a(n).

Examples

			   2, which in base 3 is also '2', satisfies the condition, thus it is included;
   4, which in base 3 is  '11', is included;
   6, which in base 3 is  '20', is included;
   8, which in base 3 is  '22', is included;
  12, which in base 3 is '110', is included;
  14, which in base 3 is '112', is included;
however, e.g., 13, 40, and 130, whose ternary representations are '111', '1111' and '11211' respectively, are not included, because they all contain more than one pair of 1's.
		

Crossrefs

Formula

a(n) = 2 * A051382(n).
Showing 1-7 of 7 results.