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

A081603 Number of 2's in ternary representation of n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Mar 23 2003

Keywords

Comments

Fixed point of the morphism: 0 ->001; 1 ->112; 2 ->223; 3 ->334, etc., starting from a(0)=0. - Philippe Deléham, Oct 26 2011

Crossrefs

Programs

  • Haskell
    a081603 0 = 0
    a081603 n = a081603 n' + m `div` 2 where (n',m) = divMod n 3
    -- Reinhard Zumkeller, Feb 21 2013
    
  • Maple
    A081603 := proc(n)
        local a,d ;
        a := 0 ;
        for d in convert(n,base,3) do
            if d= 2 then
                a := a+1 ;
            end if;
        end do:
        a;
    end proc: # R. J. Mathar, Jul 12 2016
  • Mathematica
    Table[Count[IntegerDigits[n,3],2],{n,0,6!}] (* Vladimir Joseph Stephan Orlovsky, Jul 25 2009 *)
    Nest[ Flatten[# /. a_Integer -> {a, a, a + 1}] &, {0}, 5] (* Robert G. Wilson v, May 20 2014 *)
    DigitCount[Range[0,120],3,2] (* Harvey P. Dale, Jul 10 2019 *)
  • PARI
    a(n)=hammingweight(digits(n,3)\2); \\ Ruud H.G. van Tol, Dec 10 2023
    
  • Python
    from gmpy2 import digits
    def A081603(n): return digits(n,3).count('2') # Chai Wah Wu, Dec 05 2024

Formula

a(n) = floor(n/2) if n < 3, otherwise a(floor(n/3)) + floor((n mod 3)/2).
A077267(n) + A062756(n) + a(n) = A081604(n);
a(n) = (A053735(n) - A062756(n))/2.

A117942 a(n) = a(3n) = -a(3n+1) = -a(3n+2)/2.

Original entry on oeis.org

1, -1, -2, -1, 1, 2, -2, 2, 4, -1, 1, 2, 1, -1, -2, 2, -2, -4, -2, 2, 4, 2, -2, -4, 4, -4, -8, -1, 1, 2, 1, -1, -2, 2, -2, -4, 1, -1, -2, -1, 1, 2, -2, 2, 4, 2, -2, -4, -2, 2, 4, -4, 4, 8, -2, 2, 4, 2, -2, -4, 4, -4, -8, 2, -2, -4, -2, 2, 4, -4, 4, 8, 4, -4, -8, -4, 4, 8, -8, 8, 16, -1, 1, 2, 1, -1, -2, 2, -2, -4, 1, -1
Offset: 0

Views

Author

Paul Barry, Apr 05 2006

Keywords

Comments

a(n) = a(3n)/a(0) = a(3n+1)/a(1) = a(3n+2)/a(2).
Row sums of A117941.

Crossrefs

Cf. A117592 (gives the absolute values).

Programs

  • Scheme
    ;; A stand-alone recurrence:
    (define (A117942 n) (cond ((zero? n) 1) ((zero? (modulo n 3)) (A117942 (/ n 3))) (else (let ((d (modulo n 3))) (- (* d (A117942 (/ (- n d) 3))))))))
    ;; An implementation based on a new formula:
    
  • Scheme
    (define (A117942 n) (* (A000079 (A081603 n)) (expt -1 (+ (A062756 n) (A081603 n)))))
    ;; Antti Karttunen, Jul 26 2017

Formula

a(n) = 2^A081603(n) * (-1)^(A062756(n)+A081603(n)). - Antti Karttunen, Jul 26 2017

Extensions

More terms from Antti Karttunen, Jul 26 2017

A338882 Product of the nonzero digits of (n written in base 9).

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Nov 13 2020

Keywords

Crossrefs

Product of the nonzero digits of (n written in base k): A000012 (k = 2), A117592 (k = 3), A338854 (k = 4), A338803 (k = 5), A338863 (k = 6), A338880 (k = 7), A338881 (k = 8), this sequence (k = 9), A051801 (k = 10).

Programs

  • Mathematica
    Table[Times @@ DeleteCases[IntegerDigits[n, 9], 0], {n, 0, 80}]
    nmax = 80; A[] = 1; Do[A[x] = (1 + x + 2 x^2 + 3 x^3 + 4 x^4 + 5 x^5 + 6 x^6 + 7 x^7 + 8 x^8) A[x^9] + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
    Table[Times@@(IntegerDigits[n,9]/.(0->1)),{n,0,80}] (* Harvey P. Dale, Oct 08 2021 *)
  • PARI
    a(n) = vecprod(select(x->x, digits(n, 9))); \\ Michel Marcus, Nov 14 2020

Formula

G.f. A(x) satisfies: A(x) = (1 + x + 2*x^2 + 3*x^3 + 4*x^4 + 5*x^5 + 6*x^6 + 7*x^7 + 8*x^8) * A(x^9).

A338880 Product of the nonzero digits of (n written in base 7).

Original entry on oeis.org

1, 1, 2, 3, 4, 5, 6, 1, 1, 2, 3, 4, 5, 6, 2, 2, 4, 6, 8, 10, 12, 3, 3, 6, 9, 12, 15, 18, 4, 4, 8, 12, 16, 20, 24, 5, 5, 10, 15, 20, 25, 30, 6, 6, 12, 18, 24, 30, 36, 1, 1, 2, 3, 4, 5, 6, 1, 1, 2, 3, 4, 5, 6, 2, 2, 4, 6, 8, 10, 12, 3, 3, 6, 9, 12, 15, 18, 4, 4, 8, 12
Offset: 0

Views

Author

Ilya Gutkovskiy, Nov 13 2020

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Times @@ DeleteCases[IntegerDigits[n, 7], 0], {n, 0, 80}]
    nmax = 80; A[] = 1; Do[A[x] = (1 + x + 2 x^2 + 3 x^3 + 4 x^4 + 5 x^5 + 6 x^6) A[x^7] + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
  • PARI
    a(n) = vecprod(select(x->x, digits(n, 7))); \\ Michel Marcus, Nov 14 2020

Formula

G.f. A(x) satisfies: A(x) = (1 + x + 2*x^2 + 3*x^3 + 4*x^4 + 5*x^5 + 6*x^6) * A(x^7).

A338803 Product of the nonzero digits of (n written in base 5).

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Nov 12 2020

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Times @@ DeleteCases[IntegerDigits[n, 5], 0], {n, 0, 80}]
    nmax = 80; A[] = 1; Do[A[x] = (1 + x + 2 x^2 + 3 x^3 + 4 x^4) A[x^5] + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
  • PARI
    a(n) = vecprod(select(x->x, digits(n, 5))); \\ Michel Marcus, Nov 12 2020

Formula

G.f. A(x) satisfies: A(x) = (1 + x + 2*x^2 + 3*x^3 + 4*x^4) * A(x^5).

A338854 Product of the nonzero digits of (n written in base 4).

Original entry on oeis.org

1, 1, 2, 3, 1, 1, 2, 3, 2, 2, 4, 6, 3, 3, 6, 9, 1, 1, 2, 3, 1, 1, 2, 3, 2, 2, 4, 6, 3, 3, 6, 9, 2, 2, 4, 6, 2, 2, 4, 6, 4, 4, 8, 12, 6, 6, 12, 18, 3, 3, 6, 9, 3, 3, 6, 9, 6, 6, 12, 18, 9, 9, 18, 27, 1, 1, 2, 3, 1, 1, 2, 3, 2, 2, 4, 6, 3, 3, 6, 9, 1
Offset: 0

Views

Author

Ilya Gutkovskiy, Nov 12 2020

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Times @@ DeleteCases[IntegerDigits[n, 4], 0], {n, 0, 80}]
    nmax = 80; A[] = 1; Do[A[x] = (1 + x + 2 x^2 + 3 x^3) A[x^4] + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
  • PARI
    a(n) = vecprod(select(x->x, digits(n, 4))); \\ Michel Marcus, Nov 12 2020

Formula

G.f. A(x) satisfies: A(x) = (1 + x + 2*x^2 + 3*x^3) * A(x^4).
a(n) = 2^A160382(n) * 3^A160383(n).

A338863 Product of the nonzero digits of (n written in base 6).

Original entry on oeis.org

1, 1, 2, 3, 4, 5, 1, 1, 2, 3, 4, 5, 2, 2, 4, 6, 8, 10, 3, 3, 6, 9, 12, 15, 4, 4, 8, 12, 16, 20, 5, 5, 10, 15, 20, 25, 1, 1, 2, 3, 4, 5, 1, 1, 2, 3, 4, 5, 2, 2, 4, 6, 8, 10, 3, 3, 6, 9, 12, 15, 4, 4, 8, 12, 16, 20, 5, 5, 10, 15, 20, 25, 2, 2, 4, 6, 8, 10, 2, 2, 4
Offset: 0

Views

Author

Ilya Gutkovskiy, Nov 12 2020

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Times @@ DeleteCases[IntegerDigits[n, 6], 0], {n, 0, 80}]
    nmax = 80; A[] = 1; Do[A[x] = (1 + x + 2 x^2 + 3 x^3 + 4 x^4 + 5 x^5) A[x^6] + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
  • PARI
    a(n) = vecprod(select(x->x, digits(n, 6))); \\ Michel Marcus, Nov 13 2020

Formula

G.f. A(x) satisfies: A(x) = (1 + x + 2*x^2 + 3*x^3 + 4*x^4 + 5*x^5) * A(x^6).

A338881 Product of the nonzero digits of (n written in base 8).

Original entry on oeis.org

1, 1, 2, 3, 4, 5, 6, 7, 1, 1, 2, 3, 4, 5, 6, 7, 2, 2, 4, 6, 8, 10, 12, 14, 3, 3, 6, 9, 12, 15, 18, 21, 4, 4, 8, 12, 16, 20, 24, 28, 5, 5, 10, 15, 20, 25, 30, 35, 6, 6, 12, 18, 24, 30, 36, 42, 7, 7, 14, 21, 28, 35, 42, 49, 1, 1, 2, 3, 4, 5, 6, 7, 1, 1, 2, 3, 4, 5, 6, 7, 2
Offset: 0

Views

Author

Ilya Gutkovskiy, Nov 13 2020

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Times @@ DeleteCases[IntegerDigits[n, 8], 0], {n, 0, 80}]
    nmax = 80; A[] = 1; Do[A[x] = (1 + x + 2 x^2 + 3 x^3 + 4 x^4 + 5 x^5 + 6 x^6 + 7 x^7) A[x^8] + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
  • PARI
    a(n) = vecprod(select(x->x, digits(n, 8))); \\ Michel Marcus, Nov 14 2020

Formula

G.f. A(x) satisfies: A(x) = (1 + x + 2*x^2 + 3*x^3 + 4*x^4 + 5*x^5 + 6*x^6 + 7*x^7) * A(x^8).
Showing 1-8 of 8 results.