Revision 90eb4e74-29c1-4e37-a076-f90a779913d5 - Code Golf Stack Exchange

# [Jelly], 15 [bytes]

 l3Ḟ3*©Ḥạ+⁺_®)»ċ

**[Try it online!][TIO-lzrbfq91]** Or see the [test-suite].

#### How?

 l3Ḟ3*©Ḥạ+⁺_®)»ċ - Link: non-negative integer, N
 ) - for each {I in [1..N] ([] if N==0)}:
 l3 - log base three of {I}
 Ḟ - floor {that}
 3* - three exponentiate {that}
 © - (and copy this to the register)
 Ḥ - double {that}
 ạ - {that} absolute difference {I}
 ⁺ - do this twice:
 + - add {I}
 _® - subtract the value stored in the register
 » - maximum with {N} (vectorises)
 ċ - count occurrences of {N}


[Jelly]: https://github.com/DennisMitchell/jelly
[bytes]: https://github.com/DennisMitchell/jelly/wiki/Code-page

[TIO-lzrbfq91]: https://tio.run/##ASkA1v9qZWxsef//bDPhuJ4zKsKp4bik4bqhK@KBul/CrinCu8SL////MTMzNw "Jelly – Try It Online"

[test-suite]: https://tio.run/##y0rNyan8/z/H@OGOecZah1Y@3LHk4a6F2o8ad8UfWqd5aPeR7v@H2x81rfn/P9pAR8FQR8EIiMyA2FxHwdQYiE2AosbG5rEA "Jelly – Try It Online"

AltStyle によって変換されたページ (->オリジナル) /