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.

A053314 a(n) contains n digits (either '1' or '4') and is divisible by 2^n.

This page as a plain text file.
%I A053314 #11 Oct 30 2022 16:12:24
%S A053314 4,44,144,4144,14144,414144,1414144,41414144,441414144,1441414144,
%T A053314 11441414144,411441414144,4411441414144,44411441414144,
%U A053314 444411441414144,1444411441414144,41444411441414144,441444411441414144
%N A053314 a(n) contains n digits (either '1' or '4') and is divisible by 2^n.
%H A053314 Robert Israel, <a href="/A053314/b053314.txt">Table of n, a(n) for n = 1..999</a>
%F A053314 a(n) = a(n-1) + 10^(n-1)*(4 - 3*(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 1.
%p A053314 A[1]:= 4:
%p A053314 for n from 2 to 100 do
%p A053314    if A[n-1] mod 2^n = 0 then A[n]:= A[n-1]+4*10^(n-1)
%p A053314    else A[n]:= A[n-1]+10^(n-1)
%p A053314 fi
%p A053314 od:
%p A053314 seq(A[i],i=1..100); # _Robert Israel_, Oct 27 2019
%t A053314 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 *)
%Y A053314 Cf. A023401, A050621, A050622, A035014.
%K A053314 base,nonn
%O A053314 1,1
%A A053314 _Henry Bottomley_, Mar 06 2000
%E A053314 Formula corrected by _Robert Israel_, Oct 27 2019