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

A137214 a(n) is the number of distinct decimal digits in 2^n.

Original entry on oeis.org

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

Views

Author

Ctibor O. Zizka, Mar 06 2008

Keywords

Comments

Appears to be all 10's starting at a(169). - T. D. Noe, Apr 01 2014

Examples

			a(16) = 3 because 2^16 = 65536, which contains 3 distinct decimal digits [3,5,6].
		

Crossrefs

Programs

  • Maple
    A043537 := proc(n) nops(convert(convert(n,base,10),set)) ; end: A137214 := proc(n) A043537(2^n) ; end: seq(A137214(n),n=0..120) ; # R. J. Mathar, Mar 16 2008
    a:=proc(n) options operator, arrow: nops(convert(convert(2^n,base,10),set)) end proc: seq(a(n),n=0..80); # Emeric Deutsch, Apr 02 2008
  • Mathematica
    Table[Length[Union[IntegerDigits[2^n]]], {n, 0, 100}] (* T. D. Noe, Apr 01 2014 *)
  • Python
    def a(n): return len(set(str(2**n)))
    print([a(n) for n in range(99)]) # Michael S. Branicky, Jul 23 2021

Formula

a(n) = A043537(2^n). - R. J. Mathar, Mar 16 2008

Extensions

More terms from R. J. Mathar and Emeric Deutsch, Mar 16 2008

A044949 Number of runs of odd length in the base-9 representation of n.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Array[Count[Map[Length, Split@ IntegerDigits[#, 9]], ?OddQ] &, 105] (* _Michael De Vlieger, Dec 22 2017 *)
  • PARI
    A044949(n) = { my(rl=0, d, prev_d = -1, s=0); while(n>0, d = (n%9); n = ((n-d)/9); if(d==prev_d, rl++, s += (rl%2); prev_d = d; rl = 1)); (s + (rl%2)); }; \\ Antti Karttunen, Dec 22 2017

Formula

As 731 = 1*(9^3) + 0*(9^2) + 0*(9^1) + 2*(9^0), it is written in base 9 (A007095) as "1002". There is one run of even length, and two runs of length 1 (thus of odd length), thus a(731) = 2. - Antti Karttunen, Dec 22 2017

Extensions

More terms from Antti Karttunen, Dec 22 2017
Showing 1-2 of 2 results.