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

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A319651 Largest number having in its ternary representation the same number of 0's, 1's and 2's as n. 8
0, 1, 2, 3, 4, 7, 6, 7, 8, 9, 12, 21, 12, 13, 22, 21, 22, 25, 18, 21, 24, 21, 22, 25, 24, 25, 26, 27, 36, 63, 36, 39, 66, 63, 66, 75, 36, 39, 66, 39, 40, 67, 66, 67, 76, 63, 66, 75, 66, 67, 76, 75, 76, 79, 54, 63, 72, 63, 66, 75, 72, 75, 78, 63, 66, 75, 66, 67, 76, 75, 76 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

LINKS

Seiichi Manyama, Table of n, a(n) for n = 0..6560

PROG

(Ruby)

def A(k, n)

  (0..n).map{|i| i.to_s(k).split('').sort.reverse.join.to_i(k)}

end

p A(3, 100)

(PARI) a(n) = fromdigits(vecsort(digits(n, 3), , 4), 3); \\ Michel Marcus, Sep 25 2018

(Python)

from gmpy2 import digits

def A319651(n):

    return int(''.join(sorted(digits(n, 3), reverse=True)), 3) # Chai Wah Wu, Sep 26 2018

CROSSREFS

Base b: A073138 (b=2), this sequence (b=3), A004186 (b=10).

Cf. A038574.

Sequence in context: A132075 A265364 A265363 * A340632 A074846 A120225

Adjacent sequences:  A319648 A319649 A319650 * A319652 A319653 A319654

KEYWORD

nonn,base,look

AUTHOR

Seiichi Manyama, Sep 25 2018

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 December 8 20:37 EST 2021. Contains 349596 sequences. (Running on oeis4.)