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.

A053318 a(n) contains n digits (either '2' or '7') and is divisible by 2^n.

This page as a plain text file.
%I A053318 #10 Jul 14 2025 13:40:23
%S A053318 2,72,272,2272,22272,222272,7222272,27222272,727222272,2727222272,
%T A053318 72727222272,772727222272,7772727222272,77772727222272,
%U A053318 277772727222272,2277772727222272,72277772727222272,272277772727222272
%N A053318 a(n) contains n digits (either '2' or '7') and is divisible by 2^n.
%H A053318 Robert Israel, <a href="/A053318/b053318.txt">Table of n, a(n) for n = 1..999</a>
%F A053318 a(n) = a(n-1) + 10^(n-1)*(2 + 5*(a(n-1)/2^(n-1) mod 2)), i.e., a(n) ends with a(n-1); if a(n-1) is divisible by 2^n then a(n) begins with a 2, if not then a(n) begins with a 7.
%p A053318 A[1]:= 2:
%p A053318 for n from 2 to 100 do
%p A053318    if A[n-1] mod 2^n = 0 then A[n]:= A[n-1]+2*10^(n-1)
%p A053318    else A[n]:= A[n-1]+7*10^(n-1)
%p A053318      fi
%p A053318 od:
%p A053318 seq(A[i],i=1..100); # _Robert Israel_, Oct 27 2019
%t A053318 Table[Select[FromDigits/@Tuples[{2,7},n],Mod[#,2^n]==0&],{n,18}]//Flatten (* _Harvey P. Dale_, Jul 14 2025 *)
%Y A053318 Cf. A023399, A050621, A050622, A035014.
%K A053318 base,nonn
%O A053318 1,1
%A A053318 _Henry Bottomley_, Mar 06 2000
%E A053318 Formula corrected by _Robert Israel_, Oct 27 2019