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.

A064235 The smallest power of 3 that is greater than or equal to n.

This page as a plain text file.
%I A064235 #41 Jul 05 2025 18:44:05
%S A064235 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,
%T A064235 27,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,
%U A064235 81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81
%N A064235 The smallest power of 3 that is greater than or equal to n.
%C A064235 Let A_n be the upper triangular matrix in the group GL(n,3) of invertible n X n matrices over GF(3) that has zero entries below the diagonal and 1 elsewhere. For example for n=4 the matrix is / 1,1,1,1 / 0,1,1,1 / 0,0,1,1 / 0,0,0,1 /. a(n) is the order of this matrix as an element of GL(n,3).
%C A064235 For n>1 a(n) is the smallest integer such that gcd(a(n),2^a(n)+1) >= n. - _Benoit Cloitre_, Apr 21 2002
%C A064235 From _Jianing Song_, Jul 05 2025: (Start)
%C A064235 a(n+1) is the period of {binomial(N,n) mod 3: N in Z}. For the general result, see A349593.
%C A064235 Since the modulus (3) is a prime, the remainder of binomial(N,n) is given by Lucas's theorem. (End)
%H A064235 Reinhard Zumkeller, <a href="/A064235/b064235.txt">Table of n, a(n) for n = 1..10000</a>
%H A064235 Wikipedia, <a href="https://en.wikipedia.org/wiki/Lucas%27s_theorem">Lucas's theorem</a>
%F A064235 a(n) = 3 ^ A080342(n). - _Reinhard Zumkeller_, Sep 02 2015
%F A064235 Sum_{n>=1} 1/a(n)^2 = 4/3. - _Amiram Eldar_, Aug 16 2022
%p A064235 A064235 := proc(n)
%p A064235         ceil(log(n)/log(3)) ;
%p A064235         3^% ;
%p A064235 end proc: # _R. J. Mathar_, Nov 06 2011
%t A064235 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 *)
%o A064235 (Haskell)
%o A064235 import Data.List (transpose)
%o A064235 a064235 n = genericIndex a064235_list (n - 1)
%o A064235 a064235_list = 1 : zs where
%o A064235    zs = 3 : 3 : (map (* 3) $ concat $ transpose [zs, zs, zs])
%o A064235 -- _Reinhard Zumkeller_, Sep 02 2015
%o A064235 (Python)
%o A064235 from gmpy2 import digits
%o A064235 def A064235(n): return 3**len(digits(n-1,3)) if n>1 else 1 # _Chai Wah Wu_, Oct 21 2024
%Y A064235 Cf. A062383.
%Y A064235 Cf. A132171, A080342, A000244.
%Y A064235 With offset 0, column 3 of A349593. A062383, A385552, A385553, and A385554 are respectively columns 2, 5, 6, and 10.
%K A064235 nonn
%O A064235 1,2
%A A064235 Dan Fux (dan.fux(AT)OpenGaia.com or danfux(AT)OpenGaia.com), Sep 22 2001
%E A064235 More terms from _James Sellers_, Sep 26 2001