OFFSET
1,1
LINKS
Ray Chandler, Table of n, a(n) for n = 1..1000
FORMULA
a(n)=a(n-1)+10^(n-1)*(4+5*[a(n-1)/2^(n-1) mod 2]) i.e. a(n) ends with a(n-1); if (n-1)-th term is divisible by 2^n then n-th term begins with a 4, if not then n-th term begins with a 9.
MATHEMATICA
nxt[{n_, a_}]:=Module[{fd=If[Mod[a, 2^(n+1)]==0, 4, 9]}, {n+1, fd 10^IntegerLength[a]+a}]; NestList[ nxt, {1, 4}, 20][[;; , 2]] (* Harvey P. Dale, Jul 14 2023 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Henry Bottomley, Mar 06 2000
STATUS
approved