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.

A151752 a(n) is the unique n-digit number with all digits odd that is divisible by 5^n.

This page as a plain text file.
%I A151752 #33 Sep 08 2022 08:45:38
%S A151752 5,75,375,9375,59375,359375,3359375,93359375,193359375,3193359375,
%T A151752 73193359375,773193359375,3773193359375,73773193359375,
%U A151752 773773193359375,5773773193359375,15773773193359375,515773773193359375,7515773773193359375,97515773773193359375
%N A151752 a(n) is the unique n-digit number with all digits odd that is divisible by 5^n.
%C A151752 Another way to phrase the proof of uniqueness: after we take the last n-1 digits to be the previous number in the sequence, all odd possibilities for the first digit give different remainders mod 5. By the pigeonhole principle, exactly one of them generates the required number. - _Tanya Khovanova_, Jun 18 2009
%H A151752 Alois P. Heinz, <a href="/A151752/b151752.txt">Table of n, a(n) for n = 1..300</a>
%H A151752 33rd USAMO 2003, <a href="https://artofproblemsolving.com/wiki/index.php/2003_USAMO_Problems/Problem_1"> Problem 1 </a>
%H A151752 <a href="/index/O#Olympiads">Index to sequences related to Olympiads</a>.
%F A151752 a(n) = d(n)*10^(n-1) + a(n-1), where d(n), the leading digit of a(n), is one of the odd digits 1, 3, 5, 7, or 9 (forming the complete set of residues modulo 5) and is uniquely defined by the congruence: d(n) == (-a(n-1) / 10^(n-1)) (mod 5). - _Max Alekseyev_
%p A151752 a:= proc(n) option remember; local k, l;
%p A151752       if n=1 then 5
%p A151752     else l:= a(n-1);
%p A151752          for k from 1 to 9 by 2
%p A151752            while (parse(cat(k, l)) mod 5^n)<>0 do od;
%p A151752          parse(cat(k, l))
%p A151752       fi
%p A151752     end:
%p A151752 seq(a(n), n=1..30); # _Alois P. Heinz_, Jun 18 2009
%t A151752 nxt[n_]:=Module[{x=FromDigits/@(Prepend[IntegerDigits[n],# ]&/@{1,3,5,7,9}),l},l=IntegerLength[n]+1;First[Select[x,Mod[ #,5^l]==0&]]]; NestList[nxt, 5, 25] (* _Harvey P. Dale_, Jul 06 2009 *)
%o A151752 (Magma) v:=[5];
%o A151752 for i in [2..20] do
%o A151752     for s in [1, 3, 5, 7, 9] do
%o A151752          v[i]:=s*10^(i-1)+v[i-1];
%o A151752            if v[i] mod 5^i eq 0 then
%o A151752                  break;
%o A151752            end if;
%o A151752     end for;
%o A151752 end for;
%o A151752 v; // _Marius A. Burtea_, Mar 18 2019
%Y A151752 Cf. A151753, A151754.
%K A151752 nonn,base
%O A151752 1,1
%A A151752 _David W. Wilson_, Jun 16 2009
%E A151752 More terms from _Max Alekseyev_, Jun 17 2009
%E A151752 Further terms from _Alois P. Heinz_, Jun 18 2009
%E A151752 More terms from _Harvey P. Dale_, Jul 06 2009