login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A097585 Binary representation of n if n is prime, otherwise the ternary representation of n. 0
1, 10, 11, 11, 101, 20, 111, 22, 100, 101, 1011, 110, 1101, 112, 120, 121, 10001, 200, 10011, 202, 210, 211, 10111, 220, 221, 222, 1000, 1001, 11101, 1010, 11111, 1012, 1020, 1021, 1022, 1100, 100101, 1102, 1110, 1111, 101001, 1120, 101011, 1122, 1200 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Table of n, a(n) for n=1..45.

EXAMPLE

For n = 7 we have 111 or 7 in base 2. For 8 we have 22 which is 8 in base 3.

MATHEMATICA

Table[If[PrimeQ[n], FromDigits[IntegerDigits[n, 2]], FromDigits[ IntegerDigits[ n, 3]]], {n, 50}] (* Harvey P. Dale, Apr 19 2015 *)

CROSSREFS

Sequence in context: A045988 A008947 A108787 * A063671 A330024 A184992

Adjacent sequences:  A097582 A097583 A097584 * A097586 A097587 A097588

KEYWORD

base,nonn

AUTHOR

Cino Hilliard, Aug 29 2004

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 26 20:34 EDT 2021. Contains 347672 sequences. (Running on oeis4.)