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

A370859 Numbers m such that c(0) < c(1) > c(2), where c(k) = number of k's in the ternary representation of m.

Original entry on oeis.org

1, 4, 10, 12, 13, 14, 16, 22, 31, 32, 34, 37, 38, 39, 40, 41, 42, 43, 46, 48, 49, 58, 64, 66, 67, 85, 91, 93, 94, 95, 97, 103, 109, 111, 112, 113, 115, 117, 118, 119, 120, 121, 122, 123, 124, 125, 127, 129, 130, 131, 133, 139, 145, 147, 148, 149, 151, 157
Offset: 1

Views

Author

Clark Kimberling, Mar 03 2024

Keywords

Examples

			The ternary representation of 16 is 121, for which c(0)=0 < c(1)=2 > c(2)=1.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L,m;
    L:= convert(n,base,3); m:= numboccur(1,L);
    numboccur(0,L) < m and numboccur(2,L) < m
    end proc:
    select(filter, [$1 .. 200]); # Robert Israel, Mar 03 2024
  • Mathematica
    Select[Range[1000], DigitCount[#, 3, 0] < DigitCount[#, 3, 1] > DigitCount[#, 3, 2] &]

A104320 Number of zeros in ternary representation of 2^n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 1, 1, 1, 4, 1, 0, 4, 2, 3, 3, 3, 3, 3, 7, 7, 9, 5, 6, 6, 4, 4, 3, 5, 6, 7, 9, 9, 10, 6, 6, 9, 9, 8, 9, 8, 7, 13, 12, 13, 9, 5, 9, 8, 6, 16, 13, 9, 10, 11, 11, 7, 14, 13, 13, 9, 12, 14, 15, 15, 11, 11, 17, 15, 19, 14, 19, 12, 18, 15, 11, 10, 16, 15, 14, 14, 13, 17, 14
Offset: 0

Views

Author

Reinhard Zumkeller, Mar 01 2005

Keywords

Comments

Conjecture from N. J. A. Sloane: a(n) > 0 for n > 15, see A102483.

Examples

			n=13: 2^13=8192 -> '102020102', a(13) = 4.
		

Crossrefs

Programs

  • Magma
    [Multiplicity(Intseq(2^n,3),0):n in [0..90]]; // Marius A. Burtea, Nov 17 2019
  • Maple
    f:= n -> numboccur(0, convert(2^n,base,3)):
    map(f, [$0..100]); # Robert Israel, Nov 17 2019
  • Mathematica
    Table[DigitCount[2^n,3,0],{n,0,90}] (* Harvey P. Dale, May 06 2014 *)
  • PARI
    a(n) = my(d=vecsort(digits(2^n, 3))); #setintersect(d, vector(#d)) \\ Felix Fröhlich, Nov 17 2019
    
  • PARI
    a(n) = #select(d->!d, digits(2^n, 3)); \\ Ruud H.G. van Tol, May 09 2024
    

Formula

a(n) = A077267(A000079(n)).
a(A104321(n))=n and a(m)<>n for m < A104321(n).

A188341 Numbers having no 0's and not more than one 1 in their representation in base 3.

Original entry on oeis.org

1, 2, 5, 7, 8, 17, 23, 25, 26, 53, 71, 77, 79, 80, 161, 215, 233, 239, 241, 242, 485, 647, 701, 719, 725, 727, 728, 1457, 1943, 2105, 2159, 2177, 2183, 2185, 2186, 4373, 5831, 6317, 6479, 6533, 6551, 6557, 6559, 6560, 13121, 17495, 18953
Offset: 1

Views

Author

Vladimir Shevelev, Apr 02 2011

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local i, l, m, t;
          m:= `if`(n=1, 0, a(n-1));
          l:= NULL;
          for t while m>0 do l:= l, irem(m, 3, 'm') od;
          l:= array([l, 0]);
          for i while l[i]=2 do od;
          if l[i]=0 then l[i]:= 1
                    else l[i]:= 2;
                         if i>1 then l[i-1]:= 1 fi
          fi;
          add(l[i] *3^(i-1), i=1..t)
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Apr 02 2011
  • Mathematica
    okQ[n_]:=DigitCount[n,3,0]==0&&DigitCount[n,3,1]<2; Select[Range[20000], okQ]  (* Harvey P. Dale, Apr 16 2011 *)

A081607 Number of numbers <= n having at least one 0 in their ternary representation.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 5, 6, 7, 7, 7, 8, 8, 8, 9, 10, 11, 12, 12, 12, 13, 13, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 26, 26, 27, 27, 27, 28, 29, 30, 31, 31, 31, 32, 32, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 45, 45, 46, 46, 46, 47, 48, 49, 50
Offset: 0

Views

Author

Reinhard Zumkeller, Mar 23 2003

Keywords

Comments

a(n) + A081608(n) = n+1.

Crossrefs

Programs

  • Maple
    f:= n -> `if`(has(convert(n,base,3),0),1,0):
    ListTools:-PartialSums(map(f, [$0..100])); # Robert Israel, Mar 18 2018
  • Mathematica
    Accumulate[Boole[Table[DigitCount[n,3,0]>0,{n,0,80}]]] (* Harvey P. Dale, Jun 23 2017 *)
  • PARI
    first(n)=my(s,t); vector(n,k, t=Set(digits(k,3)); s+=(t[1]==0)) \\ Charles R Greathouse IV, Sep 02 2015

A081608 Number of numbers <= n having no 0 in their ternary representation.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Mar 23 2003

Keywords

Comments

a(n) + A081607(n) = n+1.

Crossrefs

Programs

  • Mathematica
    Accumulate[Table[If[DigitCount[n,3,0]==0,1,0],{n,0,80}]] (* Harvey P. Dale, Oct 21 2024 *)
  • PARI
    first(n)=my(s,t); vector(n,k, t=Set(digits(k,3)); s+=!!t[1]) \\ Charles R Greathouse IV, Sep 02 2015

A370863 Numbers m such that c(0) > c(1) < c(2), where c(k) = number of k's in the ternary representation of m.

Original entry on oeis.org

6, 18, 20, 24, 54, 56, 60, 62, 72, 74, 78, 89, 101, 105, 137, 141, 153, 162, 164, 167, 168, 169, 170, 173, 177, 180, 181, 182, 183, 186, 188, 191, 195, 207, 216, 217, 218, 219, 222, 224, 225, 234, 236, 240, 251, 263, 267, 269, 299, 303, 305, 315, 317, 321
Offset: 1

Views

Author

Clark Kimberling, Mar 09 2024

Keywords

Examples

			The ternary representation of 20 is 202, for which c(0)=1 > c(1)=0 < c(2)=2.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[1000], DigitCount[#, 3, 0] > DigitCount[#, 3, 1] < DigitCount[#, 3, 2] &]

A370870 Numbers m such that c(0) > c(1) > c(2), where c(k) = number of k's in the ternary representation of m.

Original entry on oeis.org

9, 27, 81, 82, 84, 90, 108, 243, 244, 246, 248, 250, 252, 254, 258, 262, 264, 270, 272, 276, 288, 298, 300, 306, 324, 326, 330, 342, 378, 406, 408, 414, 432, 490, 496, 498, 514, 516, 522, 568, 570, 576, 594, 729, 730, 732, 733, 734, 736, 738, 739, 740, 741
Offset: 1

Views

Author

Clark Kimberling, Mar 11 2024

Keywords

Examples

			The ternary representation of 84 is 10010, for which c(0)=3 > c(1)=2 > c(2)=0.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[1000], DigitCount[#, 3, 0] > DigitCount[#, 3, 1] > DigitCount[#, 3, 2] &]

A073779 Number of 0's in base-3 representation of n-th prime.

Original entry on oeis.org

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

Views

Author

Zak Seidov, Aug 11 2002

Keywords

Comments

a(n) = 0 if prime(n) is in A082555. - Robert Israel, Dec 28 2018

Examples

			a(10)=2 as 10th prime is 29 in base-10 representation, or 1002 in base-3 representation.
		

Crossrefs

Programs

  • Magma
    [ Multiplicity({* a: a in Intseq(p, 3) *}, 0): p in PrimesUpTo(600) ]; // Klaus Brockhaus, Oct 10 2010
  • Maple
    f:= n -> numboccur(0,convert(ithprime(n),base,3)):
    map(f, [$1..200]); # Robert Israel, Dec 28 2018
  • Mathematica
    A073779[n_] := Length[Cases[IntegerDigits[Prime[n], 3], 0]];
    DigitCount[#,3,0]&/@Prime[Range[120]]  (* Harvey P. Dale, Apr 26 2011 *)

Formula

a(n) = A077267(A000040(n)). - Michel Marcus, Oct 02 2013

Extensions

More terms from Klaus Brockhaus, Oct 10 2010

A160380 a(0) = 0; for n >= 1, a(n) = number of 0's in base-4 representation of n.

Original entry on oeis.org

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

Views

Author

Frank Ruskey, Jun 05 2009

Keywords

Comments

The base-4 representation of 0 is 0, and contains a single zero. - N. J. A. Sloane, Apr 26 2021

Crossrefs

Programs

  • Haskell
    import Data.List (unfoldr)
    a160380 = sum . map ((0 ^ ) . (`mod` 4)) .
       unfoldr (\x -> if x == 0 then Nothing else Just (x, x `div` 4))
    -- Reinhard Zumkeller, Apr 22 2011
    
  • Mathematica
    Join[{0},Table[DigitCount[n,4,0],{n,110}]] (* Harvey P. Dale, Oct 18 2015 *)
  • PARI
    a(n) = #select(x->(x==0), digits(n, 4)); \\ Michel Marcus, Apr 26 2021

Formula

Recurrence relation: a(0) = 0, a(4m) = 1+a(m), a(4m+1) = a(4m+2) = a(4m+3) = a(m).
Generating function: (1/(1-z))*Sum_{m>=0} (z^(4^(m+1))*(1 - z^(4^m))/(1 - z^(4^(m+1)))).

Extensions

Definition clarified by Georg Fischer, Apr 26 2021

A077268 Number of bases in which n requires at least one zero to be written.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Nov 01 2002

Keywords

Examples

			a(9)=3 since it requires zeros when written in bases 2, 3 or 9 (as 1001, 100 or 10 respectively).
		

Crossrefs

Programs

  • PARI
    a(n) = sum(i=2, n, ! vecmin(digits(n, i))); \\ Michel Marcus, Jul 09 2014
  • Sage
    def A077268(n) : return sum(0 in n.digits(m) for m in range(2,n+1)) # Eric M. Schmidt, Jul 09 2014
    
Previous Showing 11-20 of 39 results. Next