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 21-30 of 40 results. Next

A227428 Number of twos in row n of triangle A083093.

Original entry on oeis.org

0, 0, 1, 0, 0, 2, 1, 2, 4, 0, 0, 2, 0, 0, 4, 2, 4, 8, 1, 2, 4, 2, 4, 8, 4, 8, 13, 0, 0, 2, 0, 0, 4, 2, 4, 8, 0, 0, 4, 0, 0, 8, 4, 8, 16, 2, 4, 8, 4, 8, 16, 8, 16, 26, 1, 2, 4, 2, 4, 8, 4, 8, 13, 2, 4, 8, 4, 8, 16, 8, 16, 26, 4, 8, 13, 8, 16, 26, 13, 26, 40
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 11 2013

Keywords

Comments

"The number of entries with value r in the n-th row of Pascal's triangle modulo k is found to be 2^{#r^k (n)}, where now #_r^k (n) gives the number of occurrences of the digit r in the base-k representation of the integer n." [Wolfram] - _R. J. Mathar, Jul 26 2017 [This is not correct: there are entries in the sequence that are not powers of 2. - Antti Karttunen, Jul 26 2017]

Examples

			Example of Wilson's formula: a(26) = 13 = 2^(0-1)*(3^3-1) = 26/2, where A062756(26)=0, A081603(26)=3, 26=(222)_3. - _R. J. Mathar_, Jul 26 2017
		

Crossrefs

Programs

  • Haskell
    a227428 = sum . map (flip div 2) . a083093_row
    
  • Maple
    A227428 := proc(n)
        local a;
        a := 0 ;
        for k from 0 to n do
            if A083093(n,k) = 2 then
                a := a+1 ;
            end if;
        end do:
        a ;
    end proc:
    seq(A227428(n),n=0..20) ; # R. J. Mathar, Jul 26 2017
  • Mathematica
    Table[Count[Mod[Binomial[n, Range[0, n]], 3], 2], {n, 0, 99}] (* Alonso del Arte, Feb 07 2012 *)
  • PARI
    A227428(n) = sum(k=0,n,2==(binomial(n,k)%3)); \\ (Naive implementation, from the description) Antti Karttunen, Jul 26 2017
    
  • Python
    from sympy import binomial
    def a(n):
        return sum(1 for k in range(n + 1) if binomial(n, k) % 3 == 2)
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jul 26 2017
    
  • Python
    from sympy.ntheory import digits
    def A227428(n):
        s = digits(n,3)[1:]
        return 3**s.count(2)-1<>1 # Chai Wah Wu, Jul 24 2025
    
  • Scheme
    (define (A227428 n) (* (A000079 (- (A062756 n) 1)) (+ -1 (A000244 (A081603 n))))) ;; After Wilson's direct formula, Antti Karttunen, Jul 26 2017

Formula

a(n) = A006047(n) - A206424(n) = n + 1 - A062296(n) - A206424(n).
a(n) = 2^(N_1-1)*(3^N_2-1) where N_1 = A062756(n), N_2 = A081603(n). [Wilson, Theorem 2, Wells] - R. J. Mathar, Jul 26 2017
a(n) = A206424(n) * ((3^A081603(n))-1) / ((3^A081603(n))+1). - Antti Karttunen, Jul 27 2017
a(n) = (1/2)*Sum_{k = 0..n} mod(C(n,k)^2 - C(n,k), 3). - Peter Bala, Dec 17 2020

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.

A290094 Restricted growth sequence transform of A290093.

Original entry on oeis.org

1, 2, 3, 2, 4, 5, 3, 5, 6, 2, 7, 5, 4, 8, 9, 5, 10, 11, 3, 5, 12, 5, 9, 13, 6, 11, 14, 2, 7, 5, 7, 15, 10, 5, 10, 11, 4, 15, 9, 8, 16, 17, 9, 18, 19, 5, 10, 13, 10, 18, 20, 11, 21, 22, 3, 5, 12, 5, 9, 13, 12, 13, 23, 5, 10, 13, 9, 17, 24, 13, 20, 25, 6, 11, 23, 11, 19, 25, 14, 22, 26, 2, 7, 5, 7, 15, 10, 5, 10, 11, 7, 27, 10, 15, 28, 18, 10, 29, 21, 5, 10, 13
Offset: 0

Views

Author

Antti Karttunen, Jul 26 2017

Keywords

Crossrefs

For all i, j: a(i) = a(j) <=> A290093(n) = A290093(n), thus this matches to all the same base-3 (ternary) related sequences as A290093: A006047, A053735, A062756, A081603, A117942, A206424, A227428, A290091, A290092, A290079, and many others.

A382725 Number of entries in the n-th row of Pascal's triangle not divisible by 8.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 5, 10, 9, 12, 11, 14, 14, 16, 5, 10, 13, 20, 13, 18, 20, 24, 11, 22, 20, 28, 22, 28, 28, 32, 5, 10, 13, 20, 17, 26, 28, 40, 13, 26, 26, 36, 28, 40, 40, 48, 11, 22, 28, 44, 28, 40, 44, 56, 22, 44, 40, 56, 44, 56, 56, 64, 5, 10, 13, 20, 17, 26, 28, 40, 17, 34, 34, 52, 36, 56, 56, 80, 13
Offset: 0

Views

Author

N. J. A. Sloane, Apr 23 2025

Keywords

Crossrefs

Programs

  • Python
    def A382725(n):
        n1 = n>>1
        n2 = n1>>1
        np = ~n
        n100 = (n2&(~n1)&np).bit_count()
        n110 = (n2&n1&np).bit_count()
        n10 = (n1&np).bit_count()
        return ((n100+1<<3)+(n110<<1)+n10*(n10+3))<>3 # Chai Wah Wu, Aug 10 2025

A089898 Product of (digits of n each incremented by 1).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 8, 16, 24, 32, 40, 48, 56, 64
Offset: 0

Views

Author

Marc LeBrun, Nov 13 2003

Keywords

Comments

Sum of products of all subsets of digits of n (with the empty subset contributing 1).
Number of nonnegative values k such that the lunar sum of k and n is n.
First 100 values are 10 X 10 multiplication table, read by rows/columns.

Examples

			a(12)=6 since (1+1)*(2+1)=2*3=6 and since (1*2)+(1)+(2)+(1)=2+1+2+1=6 and since the lunar sum of 12 with any of the six values {0,1,2,10,11,12} is 12.
		

Crossrefs

Programs

  • Haskell
    a089898 n = if n < 10 then n + 1 else (d + 1) * a089898 n'
                where (n', d) = divMod n 10
    -- Reinhard Zumkeller, Jul 06 2014
  • Maple
    seq(convert(map(`+`,convert(n,base,10),1),`*`), n = 0 .. 1000); # Robert Israel, Nov 17 2014
  • Mathematica
    a089898[n_Integer] :=
    Prepend[Array[Times @@ (IntegerDigits[#] + 1) &, n], 1]; a089898[77] (* Michael De Vlieger, Dec 22 2014 *)
  • PARI
    a(n) = my(d=digits(n)); prod(i=1, #d, d[i]+1); \\ Michel Marcus, Apr 06 2014
    
  • PARI
    a(n) = vecprod(apply(x->x+1, digits(n))); \\ Michel Marcus, Feb 01 2023
    

Formula

a(n) = a(floor(n/10))*(1+(n mod 10)). - Robert Israel, Nov 17 2014
G.f. g(x) satisfies g(x) = (10*x^11 - 11*x^10 + 1)*g(x^10)/(x-1)^2. - Robert Israel, Nov 17 2014

A386952 Number of entries in the n-th row of Pascal's triangle not divisible by 9.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 4, 8, 12, 9, 12, 15, 14, 16, 18, 7, 14, 21, 14, 19, 24, 21, 24, 27, 4, 8, 12, 12, 18, 24, 20, 28, 36, 9, 18, 27, 20, 28, 36, 31, 38, 45, 14, 28, 42, 28, 38, 48, 42, 48, 54, 7, 14, 21, 20, 31, 42, 33, 48, 63, 14, 28, 42, 31, 44, 57, 48
Offset: 0

Views

Author

Chai Wah Wu, Aug 10 2025

Keywords

Crossrefs

Programs

  • Python
    import re
    from gmpy2 import digits
    def A386952(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*((1+n01<<2)+n11)+((n02<<2)+n12<<2))*3**n2<>2

A387050 Number of entries in the n-th row of Pascal's triangle not divisible by 16.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 9, 18, 15, 20, 17, 22, 21, 24, 21, 26, 25, 28, 27, 30, 30, 32, 9, 18, 23, 36, 21, 30, 33, 40, 25, 34, 35, 44, 37, 42, 44, 48, 21, 42, 37, 52, 37, 50, 48, 56, 43, 54, 52, 60, 54, 60, 60, 64, 9, 18, 23, 36, 29
Offset: 0

Views

Author

Chai Wah Wu, Aug 15 2025

Keywords

Crossrefs

Programs

  • Python
    def A387050(n):
        n1 = n>>1
        n2 = n1>>1
        n3 = n2>>1
        np = ~n
        n10, n100, n110 = (k1:=n1&np).bit_count(), (k2:=(k1>>1)&np).bit_count(), (k3:=n2&k1).bit_count()
        n1100, n1000, n1010, n1110 = (n3&k2).bit_count(), ((k2>>1)&np).bit_count(), ((k1>>2)&k1).bit_count(), (n3&k3).bit_count()
        return n10*(n10*(n10+3)+6*((n100<<2)+n110)+20)//6+((n1000<<2)+n100+n1010+n1100<<2)+n110+n1110+8<>3

A268128 a(n) = (A000123(n) - A001316)/2.

Original entry on oeis.org

0, 0, 1, 1, 4, 5, 8, 9, 17, 21, 28, 33, 45, 53, 66, 75, 100, 117, 140, 161, 193, 221, 258, 291, 344, 389, 446, 499, 573, 639, 722, 797, 913, 1013, 1132, 1249, 1393, 1533, 1698, 1859, 2060, 2253, 2478, 2699, 2965, 3223, 3522, 3813, 4173, 4517, 4910, 5299, 5753
Offset: 0

Views

Author

Tom Edgar, Jan 26 2016

Keywords

Crossrefs

Programs

  • Mathematica
    b[0] = 1; b[n_] := b[n] = b[Floor[n/2]] + b[n - 1];
    c[n_] := Sum[Mod[Binomial[n, k], 2], {k, 0, n}];
    a[n_] := (b[n] - c[n])/2;
    Table[a[n], {n, 0, 52}] (* Jean-François Alcover, Dec 12 2018 *)
  • Sage
    def b(n):
        A=[1]
        for i in [1..n]:
            A.append(A[i-1] + A[floor(i/2)])
        return A[n]
    [(b(n)-prod(x+1 for x in n.digits(2)))/2 for n in [0..60]]

Formula

Let b(0) = 1 and b(n) = b(n-1) + b(floor(n/2)) and let c(n) = Product_{i=0..k}(n_i+1) where n = Sum_{i=0..k}n_i*2^i is the binary representation of n. Then a(n) = (1/2)*(b(n) - c(n)).

A268444 a(n) = Product_{i=0..k}(n_i+1) where n = Sum_{i=0..k}n_i*4^i is the base-4 representation of n.

Original entry on oeis.org

1, 2, 3, 4, 2, 4, 6, 8, 3, 6, 9, 12, 4, 8, 12, 16, 2, 4, 6, 8, 4, 8, 12, 16, 6, 12, 18, 24, 8, 16, 24, 32, 3, 6, 9, 12, 6, 12, 18, 24, 9, 18, 27, 36, 12, 24, 36, 48, 4, 8, 12, 16, 8, 16, 24, 32, 12, 24, 36, 48, 16, 32, 48, 64, 2, 4, 6, 8, 4, 8, 12, 16, 6, 12, 18, 24
Offset: 0

Views

Author

Tom Edgar, Feb 04 2016

Keywords

Comments

a(n) gives the number of 1's in row n of A243756.

Examples

			The base-4 representation of 10 is (2,2) so a(10) = (2+1)*(2+1) = 9.
		

Crossrefs

Programs

  • PARI
    a(n) = my(d=digits(n,4)); prod(k=1, #d, d[k]+1); \\ Michel Marcus, Feb 05 2016
    
  • Python
    from math import prod
    from gmpy2 import digits
    def A268444(n):
        s = digits(n,4)
        return prod((int(d)+1)**s.count(d) for d in '123') # Chai Wah Wu, Apr 24 2025
  • Sage
    [prod(x+1 for x in n.digits(4)) for n in [0..75]]
    
  • Scheme
    (define (A268444 n) (if (zero? n) 1 (let ((d (mod n 4))) (* (+ 1 d) (A268444 (/ (- n d) 4)))))) ;; For R6RS standard. Use modulo instead of mod in older Schemes like MIT/GNU Scheme. - Antti Karttunen, May 28 2017
    

Formula

a(n) = Product_{i=0..k}(n_i+1) where n = Sum_{i=0..k}n_i*4^i.

A382721 Number of entries in the n-th row of Pascal's triangle not divisible by 11.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 77, 8, 16, 24, 32
Offset: 0

Views

Author

N. J. A. Sloane, Apr 23 2025

Keywords

Crossrefs

Programs

  • Python
    from math import prod
    from gmpy2 import digits
    def A382721(n): return prod(int(d,11)+1 for d in digits(n,11)) # Chai Wah Wu, Aug 10 2025
Previous Showing 21-30 of 40 results. Next