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
Conjecture: There is a constant k (with a value of about 1.557296798) such that, for all n, 0<k*(4/3)^n-a(n)<2. This conjecture has been verified for all n up to 10^6. - Clive Tooth, Dec 24 2025
From Jianing Song, Dec 28 2025: (Start)
The conjecture above is correct. In fact, the constant k is (3/4)*A390321.
In general, let {f_n}_{n>=0} be the sequence defined by f_{n+1} = alpha*f_n + e_n, where alpha > 1, a <= e_n <= b, then f_n = (f_0 + e_0/alpha + ... + e_{n-1}/alpha^n)*alpha^n = c*alpha^n - (e_n/alpha + e_{n+1}/alpha^2 + ...), where c = f_0 + Sum_{n>=0} e_n/alpha^{n+1}. We conclude that c*alpha^n - b/(alpha - 1) <= f_n <= c*alpha^n - a/(alpha - 1).
Here alpha = 4/3, a = 0, and b = 2/3, so we conclude that c*(4/3)^n - 2 < a(n+1) = f_n < c*(4/3)^n for some constant c, since we have neither e_n = 0 for all sufficiently large n nor e_n = 2/3 for all sufficiently large n. (End)
LINKS
Robert Israel, Table of n, a(n) for n = 1..7994
FORMULA
a(n) = A390254(n-1) - 1. - Jianing Song, Dec 28 2025
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
