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.

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

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3, 0, 4, 2, 0, 2, 1, 0, 12, 6, 0, 8, 4, 0, 4, 2, 0, 24, 21, 18, 19, 14, 9, 14, 7, 0, 28, 20, 12, 20, 13, 6, 12, 6, 0, 32, 19, 6, 21, 12, 3, 10, 5, 0, 48, 42, 36, 38, 28, 18, 28, 14, 0, 50, 37, 24, 36, 24, 12, 22, 11, 0, 52, 32, 12, 34, 20, 6, 16, 8, 0
Offset: 0

Views

Author

Antti Karttunen, Nov 04 2014

Keywords

Comments

Number of zeros on row n of A095143 (Pascal's triangle reduced modulo 9).
This should have a formula. See for example A062296, A006047 and A048967.

Examples

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

Crossrefs

Programs

  • Mathematica
    Total/@Table[If[Mod[Binomial[n,k],9]==0,1,0],{n,0,80},{k,0,n}] (* Harvey P. Dale, Feb 12 2020 *)
  • PARI
    A249733(n) = { my(c=0); for(k=0,n\2,if(!(binomial(n,k)%9),c += (if(k<(n/2),2,1)))); return(c); } \\ Unoptimized.
    for(n=0, 6561, write("b249733.txt", n, " ", A249733(n)));
    
  • Python
    import re
    from gmpy2 import digits
    def A249733(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 n+1-(((3*(n01+1)+(n02<<2)+n12<<2)+3*n11)*(3**n2<Chai Wah Wu, Jul 24 2025

Formula

For all n >= 0, the following holds:
a(n) <= A048277(n).
a(n) <= A062296(n).
a(2*A249719(n)) > 0 and a((2*A249719(n))-1) > 0.
a(n) is odd if and only if n is one of the terms of A249720.

A249441 a(n) is the smallest prime whose square divides at least one entry in the n-th row of Pascal's triangle, or 0 if there is no such prime.

Original entry on oeis.org

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

Views

Author

Vladimir Shevelev, Oct 28 2014

Keywords

Comments

a(n) = 3 for 15, 31, 47, 63, 95, 127, 191, 255, 383, 511, 767, 1023, 1535, 2047, 3071, etc.
The above values all occur in A249723 and from 31 onward seem to be given by A052955(n>=8). (Cf. also A249714 & A249715). - Antti Karttunen, Nov 04 2014
Using the Kummer theorem on carries, one can prove that, if a(n)>3 or 0, then n>23 takes the form of either 1...1 or 101...1 in base 2 and simultaneously 212...2 in base 3. However, it is easy to see that this leads to a contradiction. Thus there are no terms greater than 3 and only 8 zeros, i.e., there are only 8 rows in Pascal's triangle that contain all squarefree numbers. It turns out that the latter result has been known for a long time (see A048278).

Crossrefs

Programs

  • Maple
    a_list := proc(len) local s; s := proc(L,p) local n; seq(max(op(map(b-> padic[ordp](b,p),{seq(binomial(n,k),k=0..n)}))),n=0..L); map(k-> `if`(k<2,0,p),[%]) end: zip((x,y)-> `if`(x=0,y,x),s(len,2),s(len,3)) end: a_list(86); # Peter Luschny, Nov 01 2014
    # alternative
    A249441 := proc(n)
        local p,wrks,bi,k;
        if n in [0,1,2,3,5,7,11,23] then
            return 0 ;
        end if;
        p :=2 ;
        while true do
            wrks := false;
            bi := 1 ;
            for k from 0 to n do
                if modp(bi,p^2) = 0 then
                    wrks := true;
                    break;
                end if;
                bi := bi*(n-k)/(1+k) ;
            end do:
            if wrks then
                return p;
            end if;
            p := nextprime(p) ;
        end do:
    end proc: # R. J. Mathar, Nov 04 2014
  • Mathematica
    row[n_] := Table[Binomial[n, k], {k, 1, (n-Mod[n, 2])/2}];
    a[n_] := If[MemberQ[{0, 1, 2, 3, 5, 7, 11, 23}, n], 0, For[p = 2, True, p = NextPrime[p], If[AnyTrue[row[n], Divisible[#, p^2]&], Return[p]]]];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jul 30 2018 *)
  • PARI
    a(n) = my(o=0); for(k=1,n\2, o+=valuation((n-k+1)/k, 2); if(o>1, return(2))); if(n<24 && n!=15, 0, 3) \\ Charles R Greathouse IV, Nov 03 2014
    
  • PARI
    A249441(n) = { forprime(p=2,3,for(k=0,n\2,if((0==(binomial(n,k)%(p*p))),return(p)))); return(0); } \\ This is more straightforward, but a slower implementation - Antti Karttunen, Nov 03 2014
    
  • PARI
    a(n)=if((n+1)>>valuation(n+1,2)<5, if(n<24 && setsearch([1,2,3,5,7,11,23],n), 0, 3), 2) \\ Charles R Greathouse IV, Nov 06 2014

Extensions

More terms from Peter J. C. Moses, Oct 28 2014

A249695 a(n)=0, if A249441(n)=0; otherwise, a(n) is the smallest i such that A249441(n)^2 divides binomial(n,i).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 3, 0, 1, 2, 3, 0, 1, 6, 3, 7, 1, 2, 3, 4, 1, 6, 3, 0, 1, 2, 3, 12, 1, 6, 3, 5, 1, 2, 3, 4, 1, 6, 3, 8, 1, 2, 3, 12, 1, 6, 3, 21, 1, 2, 3, 4, 1, 6, 3, 24, 1, 2, 3, 12, 1, 6, 3, 1, 1, 2, 3, 4, 1, 6, 3, 8, 1, 2, 3, 12, 1, 6, 3, 16, 1, 2, 3, 4, 1, 6, 3
Offset: 0

Views

Author

Vladimir Shevelev, Nov 04 2014

Keywords

Comments

After a(0) = 0, A048278 gives the positions of seven other zeros in the sequence. - Antti Karttunen, Nov 04 2014

Crossrefs

A249714 and A249715 give the record values and their positions.
Differs from A249442 for the first time at n=9.

Programs

  • Maple
    A249695 := proc(n)
        a41n := A249441(n) ;
        if a41n = 0 then
            return 0;
        end if;
        bi := 1;
        for i from 0 do
            if modp(bi,a41n^2)= 0 then
                return i;
            end if;
            bi := bi*(n-i)/(1+i) ;
        end do:
    end proc: # R. J. Mathar, Nov 04 2014
  • Mathematica
    bb[n_] := Table[Binomial[n, k], {k, 1, (n - Mod[n, 2])/2}];
    a41[n_] := If[MemberQ[{0, 1, 2, 3, 5, 7, 11, 23}, n], 0, For[p = 2, True, p = NextPrime[p], If[AnyTrue[bb[n], Divisible[#, p^2]&], Return[p]]]];
    a[n_] := If[(a41n = a41[n]) == 0, 0, For[i = 1, True, i++, If[Divisible[ Binomial[n, i], a41n^2], Return[i]]]];
    a /@ Range[0, 100] (* Jean-François Alcover, Mar 27 2020 *)
  • PARI
    A249695(n) = { forprime(p=2,3,for(k=0,floor(n/2),if((0==(binomial(n,k)%(p*p))),return(k)))); return(0); } \\ Straightforward and unoptimized version. But fast enough for 10000 terms.
    A249695(n) = { for(p=2,3, my(o=0); for(k=1, n\2, o+=valuation((n-k+1)/k, p); if(o>1, return(k)))); return(0); } \\ This version is based on Charles R Greathouse IV's code for A249441.
    for(n=0, 10000, write("b249695.txt", n, " ", A249695(n)));
    \\ Antti Karttunen, Nov 04 2014

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
    				

A249724 Numbers k such that on row k of Pascal's triangle there is no multiple of 9 which would be less than any (potential) multiple of 4 on the same row.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 14, 16, 17, 20, 22, 23, 24, 25, 26, 28, 30, 32, 33, 34, 35, 36, 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, 72, 73, 74, 76, 77, 78, 80, 84, 86, 88, 89, 92, 94, 96, 97, 98, 100, 101, 102, 104, 105, 106, 107, 108, 110, 112, 113, 114, 115, 116, 120, 121
Offset: 1

Views

Author

Antti Karttunen, Nov 04 2014

Keywords

Comments

Disjoint union of {0} and the following sequences: A048278 (gives 7 other cases where there are neither multiples of 4 nor 9 on row k), A249722 (rows where a multiple of 4 is found before a multiple of 9), A249726 (cases where the least term on row k which is a multiple of 4 is also a multiple of 9, and vice versa, i.e., such a term a multiple of 36).
If A249717(k) < 3 then k is included in this sequence. This is a sufficient but not necessary condition, e.g., A249717(25) = 5, but 25 is also included in this sequence.

Crossrefs

Programs

  • PARI
    A249724list(upto_n) = { my(i=0, n=0, dont_print=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).
Showing 1-7 of 7 results.