OFFSET
1,2
COMMENTS
If you repeatedly base 64 encode a string, starting with a single character, the length of the string at step n is 4*a(n). - Christian Perfect, Jan 06 2016
LINKS
Robert Israel, Table of n, a(n) for n = 1..7994
MAPLE
A[1]:= 1:
for n from 2 to 100 do A[n]:= ceil(4/3*A[n-1]) od:
seq(A[i], i=1..100); # Robert Israel, Aug 17 2017
MATHEMATICA
a[1] = 1; a[n_] := a[n] = Ceiling[4 a[n - 1]/3]; Table[a@ n, {n, 45}] (* Michael De Vlieger, Jan 06 2016 *)
PROG
(PARI) a(n) = if (n==1, 1, ceil(a(n-1)*4/3)) \\ Michel Marcus, Aug 01 2013
(Magma) [n eq 1 select 1 else Ceiling(Self(n-1)*4/3): n in [1..50]]; // Vincenzo Librandi, Aug 17 2017
(Python)
from fractions import Fraction
from functools import lru_cache
@lru_cache(maxsize=None)
def A087192(n): return int(Fraction(4*A087192(n-1), 3).__ceil__()) if n>1 else 1 # Chai Wah Wu, Sep 07 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Aug 24 2003
STATUS
approved