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

A032924 Numbers whose ternary expansion contains no 0.

Original entry on oeis.org

1, 2, 4, 5, 7, 8, 13, 14, 16, 17, 22, 23, 25, 26, 40, 41, 43, 44, 49, 50, 52, 53, 67, 68, 70, 71, 76, 77, 79, 80, 121, 122, 124, 125, 130, 131, 133, 134, 148, 149, 151, 152, 157, 158, 160, 161, 202, 203, 205, 206, 211, 212, 214, 215, 229, 230, 232, 233, 238, 239
Offset: 1

Views

Author

Keywords

Comments

Complement of A081605. - Reinhard Zumkeller, Mar 23 2003
Subsequence of A154314. - Reinhard Zumkeller, Jan 07 2009
The first 28 terms are the range of A059852 (Morse codes for letters, when written in base 3) union {44, 50} (which correspond to Morse codes of Ü and Ä). Subsequent terms represent the Morse code of other symbols in the same coding. - M. F. Hasler, Jun 22 2020

Crossrefs

Zeroless numbers in some other bases <= 10: A000042 (base 2), A023705 (base 4), A248910 (base 6), A255805 (base 8), A255808 (base 9), A052382 (base 10).

Programs

  • Haskell
    a032924 n = a032924_list !! (n-1)
    a032924_list = iterate f 1 where
       f x = 1 + if r < 2 then x else 3 * f x'  where (x', r) = divMod x 3
    -- Reinhard Zumkeller, Mar 07 2015, May 04 2012
    
  • Maple
    f:= proc(n) local L,i,m;
       L:= convert(n,base,2);
       m:= nops(L);
       add((1+L[i])*3^(i-1),i=1..m-1);
    end proc:
    map(f, [$2..101]); # Robert Israel, Aug 04 2015
  • Mathematica
    Select[Range@ 240, Last@ DigitCount[#, 3] == 0 &] (* Michael De Vlieger, Aug 05 2015 *)
    Flatten[Table[FromDigits[#,3]&/@Tuples[{1,2},n],{n,5}]] (* Harvey P. Dale, May 28 2016 *)
  • PARI
    apply( {A032924(n)=if(n<3,n,3*self()((n-1)\2)+2-n%2)}, [1..99]) \\ M. F. Hasler, Jun 22 2020
    
  • PARI
    a(n) = fromdigits(apply(d->d+1,binary(n+1)[^1]), 3); \\ Kevin Ryde, Jun 23 2020
    
  • Python
    def a(n): return sum(3**i*(int(b)+1) for i, b in enumerate(bin(n+1)[:2:-1]))
    print([a(n) for n in range(1, 61)]) # Michael S. Branicky, Aug 15 2022
    
  • Python
    def is_A032924(n):
        while n > 2:
           n,r = divmod(n,3)
           if r==0: return False
        return n > 0
    print([n for n in range(250) if is_A032924(n)]) # M. F. Hasler, Feb 15 2023
    
  • Python
    def A032924(n): return int(bin(m:=n+1)[3:],3) + (3**(m.bit_length()-1)-1>>1) # Chai Wah Wu, Oct 13 2023

Formula

a(n) = A107680(n) + A107681(n). - Reinhard Zumkeller, May 20 2005
A081604(A107681(n)) <= A081604(A107680(n)) = A081604(a(n)) = A000523(n+1). - Reinhard Zumkeller, May 20 2005
A077267(a(n)) = 0. - Reinhard Zumkeller, Mar 02 2008
a(1)=1, a(n+1) = f(a(n)+1,a(n)+1) where f(x,y) = if x<3 and x<>0 then y, else if x mod 3 = 0 then f(y+1,y+1), else f(floor(x/3),y). - Reinhard Zumkeller, Mar 02 2008
a(2*n) = a(2*n-1)+1, n>0. - Zak Seidov, Jul 27 2009
A212193(a(n)) = 0. - Reinhard Zumkeller, May 04 2012
a(2*n+1) = 3*a(n)+1. - Robert Israel, Aug 05 2015
G.f.: x/(1-x)^2 + Sum_{m >= 1} 3^(m-1)*x^(2^(m+1)-1)/((1-x^(2^m))*(1-x)). - Robert Israel, Aug 04 2015
A065361(a(n)) = n. - Rémy Sigrist, Feb 06 2023
Sum_{n>=1} 1/a(n) = 3.4977362637842652509313189236131190039368413460747606236619907531632476445332666030262441154353753276457... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Apr 14 2025

A060109 Numbers in Morse code, with 1 for a dot, 2 for a dash and 0 between digits/letters.

Original entry on oeis.org

22222, 12222, 11222, 11122, 11112, 11111, 21111, 22111, 22211, 22221, 12222022222, 12222012222, 12222011222, 12222011122, 12222011112, 12222011111, 12222021111, 12222022111, 12222022211, 12222022221, 11222022222, 11222012222, 11222011222, 11222011122, 11222011112, 11222011111
Offset: 0

Views

Author

Henry Bottomley, Feb 28 2001

Keywords

Examples

			a(10) = 12222022222 since 1 is ".----" and 0 is "-----".
		

Crossrefs

Cf. A059852 (Morse code for letters), A008777 (number of dots and dashes).
Cf. A060110 (these base-3 numbers converted to decimal), A321332 (duration of the code for n).

Programs

  • Haskell
    import Data.List (inits, tails)
    a060109 n = if n == 0 then 22222 else read (conv n) :: Integer where
       conv 0 = []
       conv x = conv x' ++ mCode !! d where (x', d) = divMod x 10
       mCode = map ('0' :) (mc ++ (reverse $ init $ tail $ map reverse mc))
       mc = zipWith (++) (inits "111111") (tails "22222")
    -- Reinhard Zumkeller, Feb 20 2015
    
  • Mathematica
    With[{a = Association@ Array[# -> If[# < 6, PadRight[ConstantArray[1, #], 5, 2], PadRight[ConstantArray[2, # - 5], 5, 1]] &, 10, 0]}, Array[FromDigits@ Flatten@ Riffle[Map[Lookup[a, #] &, IntegerDigits[#]], 0] &, 25]] (* Michael De Vlieger, Nov 02 2020 *)
  • PARI
    apply( {A060109(n)=if(n>9,self()(n\10)*10^6)+fromdigits([1+(abs(k-n%10)>2)|k<-[3..7]])}, [0..39]) \\ M. F. Hasler, Jun 22 2020

Formula

a(n) A007089(A060110(n)) = a(floor(n/10))*10^6 + a(n%10) for n > 9 and a(n) = 33333 - a(n-5) for n%10 > 4, where % is the modulo (remainder) operator. - M. F. Hasler, Jun 22 2020

A008777 Number of dots and dashes used when representing n-th letter in Morse code.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of digits of A059852 written in base 3.

Crossrefs

Cf. A059852 (Morse code for letters A-Z, read in base 3).

Programs

Formula

a(n) = floor(log_3(A059852(n))) + 1. - M. F. Hasler, Jun 22 2020

A060110 Numbers in Morse code, with 1 for a dot, 2 for a dash and 0 between digits/letters and then converted from base 3 to base 10.

Original entry on oeis.org

242, 161, 134, 125, 122, 121, 202, 229, 238, 241, 117611, 117530, 117503, 117494, 117491, 117490, 117571, 117598, 117607, 117610, 97928, 97847, 97820, 97811, 97808, 97807, 97888, 97915, 97924, 97927, 91367, 91286, 91259, 91250, 91247
Offset: 0

Views

Author

Henry Bottomley, Feb 28 2001

Keywords

Comments

The mentioned base 3 representation of the terms (digits 0, 1 and 2) is given in A060109. - M. F. Hasler, Jun 22 2020

Examples

			a(10) = 12222022222[base 3] = 117611[base 10] since 1 is ".----" and 0 is "-----".
		

Crossrefs

Programs

  • Haskell
    a060110 = t . a060109 where
       t 0 = 0
       t n = if n == 0 then 0 else 3 * t n' + d  where (n', d) = divMod n 10
    -- Reinhard Zumkeller, Feb 20 2015
    
  • PARI
    apply( {A060110(n)=if(n>9, self()(n\10)*3^6)+fromdigits([1+(abs(k-n%10)>2)|k<-[3..7]],3)}, [0..39]) \\ M. F. Hasler, Jun 23 2020

Formula

A007089(a(n)) = A060109(n). - Reinhard Zumkeller, Feb 20 2015

A105386 Morse code alphabet where "." = 0 and "-" = 1, binary converted to decimal.

Original entry on oeis.org

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

Views

Author

Bryan Jacobs (bryanjj(AT)gmail.com), Apr 02 2005

Keywords

Comments

Hamming weight A000120(a(n)) gives number of dashes in the Morse code of the n-th letter. A008777 allows us to know how many leading zeros a term should have. A059852 is a better (unambiguous) variant. - M. F. Hasler, Jun 23 2020

Examples

			a(3) = 'C' = "-.-." -> 1010 (binary) = 10.
		

Crossrefs

Cf. A105387, A059852 (Morse alphabet), A000120 (binary weight), A008777 (number of dots and dashes in Morse code for n-th letter).

Programs

Extensions

Name and crossrefs edited by M. F. Hasler, Jun 23 2020

A105387 Morse code alphabet where "-" = 0 and "." = 1, binary converted to decimal.

Original entry on oeis.org

2, 7, 5, 3, 1, 13, 1, 15, 3, 8, 2, 11, 0, 1, 0, 9, 2, 5, 7, 0, 6, 14, 4, 6, 4, 3
Offset: 1

Views

Author

Bryan Jacobs (bryanjj(AT)gmail.com), Apr 02 2005

Keywords

Comments

Hamming weight A000120(a(n)) gives number of dashes in the Morse code of the n-th letter. A008777 allows us to know how many leading zeros a term should have. A059852 is a better (unambiguous) variant. - M. F. Hasler, Jun 23 2020

Examples

			a(3) = 'C' = "-.-." -> 0101 (binary) = 5.
		

Crossrefs

Cf. A105386, A059852 (Morse alphabet), A000120 (binary weight), A008777 (number of dots and dashes in Morse code for n-th letter).

Programs

Extensions

Name and crossrefs edited by M. F. Hasler, Jun 23 2020
Showing 1-6 of 6 results.