A064235 The smallest power of 3 that is greater than or equal to n.
1, 3, 3, 9, 9, 9, 9, 9, 9, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81
Offset: 1
Keywords
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Wikipedia, Lucas's theorem
Crossrefs
Programs
-
Haskell
import Data.List (transpose) a064235 n = genericIndex a064235_list (n - 1) a064235_list = 1 : zs where zs = 3 : 3 : (map (* 3) $ concat $ transpose [zs, zs, zs]) -- Reinhard Zumkeller, Sep 02 2015
-
Maple
A064235 := proc(n) ceil(log(n)/log(3)) ; 3^% ; end proc: # R. J. Mathar, Nov 06 2011
-
Mathematica
nn=100;With[{p3=3^Range[0,Ceiling[Log[3,nn]]]},Flatten[Table[Select[ p3, #>=n&, 1],{n,nn}]]] (* Harvey P. Dale, Mar 14 2013 *)
-
Python
from gmpy2 import digits def A064235(n): return 3**len(digits(n-1,3)) if n>1 else 1 # Chai Wah Wu, Oct 21 2024
Formula
a(n) = 3 ^ A080342(n). - Reinhard Zumkeller, Sep 02 2015
Sum_{n>=1} 1/a(n)^2 = 4/3. - Amiram Eldar, Aug 16 2022
Extensions
More terms from James Sellers, Sep 26 2001
Comments