login
A053314
a(n) contains n digits '1' or '4' and is divisible by 2^n.
1
4, 44, 144, 4144, 14144, 414144, 1414144, 41414144, 441414144, 1441414144, 11441414144, 411441414144, 4411441414144, 44411441414144, 444411441414144, 1444411441414144, 41444411441414144, 441444411441414144, 1441444411441414144, 41441444411441414144
OFFSET
1,1
LINKS
FORMULA
a(n+1) = a(n) + 10^n * (4 - 3*(a(n)/2^n 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 1.
MAPLE
A[1]:= 4:
for n from 2 to 100 do
if A[n-1] mod 2^n = 0 then A[n]:= A[n-1]+4*10^(n-1)
else A[n]:= A[n-1]+10^(n-1)
fi
od:
seq(A[i], i=1..100); # Robert Israel, Oct 27 2019
MATHEMATICA
nxt[{n_, a_}]:={n+1, If[Divisible[a, 2^(n+1)], 4*10^IntegerLength[a]+ a, 10^IntegerLength[ a]+a]}; NestList[nxt, {1, 4}, 20][[All, 2]] (* Harvey P. Dale, Oct 30 2022 *)
PROG
(PARI) A053314_first(n)=my(t); vector(n, k, t += 4^!(t%2^k)*10^(k-1)) \\ M. F. Hasler, Feb 02 2026
CROSSREFS
Cf. A023401, A050621, A050622, A035014 (same for digits 3 & 4), A053312-A053338 (digits 1,2 through 6,9) and A053376-A053380 (1,8 through 8,9).
Sequence in context: A200456 A292454 A292734 * A051223 A330651 A366516
KEYWORD
base,nonn
AUTHOR
Henry Bottomley, Mar 06 2000
EXTENSIONS
Formula corrected by Robert Israel, Oct 27 2019
STATUS
approved