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.

A216664 Odd numbers n such that the decimal expansion of 1/n contains the digit "9" at position (n + 1)/2.

This page as a plain text file.
%I A216664 #23 Mar 04 2022 15:11:45
%S A216664 11,17,19,23,29,47,59,61,73,91,95,97,101,103,109,113,127,131,137,139,
%T A216664 149,167,179,181,189,193,211,223,229,233,251,255,257,263,269,313,325,
%U A216664 331,337,349,353,367,379,383,389,419,421,433,441,457,461,463,477,487,491
%N A216664 Odd numbers n such that the decimal expansion of 1/n contains the digit "9" at position (n + 1)/2.
%C A216664 First nine terms are primes.
%C A216664 This is not a subsequence of A187040: 189 belongs to this sequence but not to A187040.
%H A216664 Arkadiusz Wesolowski, <a href="/A216664/b216664.txt">Table of n, a(n) for n = 1..1000</a>
%H A216664 Wikipedia, <a href="http://en.wikipedia.org/wiki/Midy%27s_theorem">Midy's theorem</a>
%H A216664 <a href="/index/1#1overn">Index entries for sequences related to decimal expansion of 1/n</a>
%e A216664 1/17 = .058823529..., therefore 17 is a term.
%e A216664 1/21 = .04761904761..., therefore 21 is not a term.
%t A216664 lst = {}; Do[l = (n + 1)/2; d = Flatten@RealDigits[1/n, 10, l]; If[Join[Table[0, {-1*Last@d}], Most@d][[l]] == 9, AppendTo[lst, n]], {n, 1, 491, 2}]; lst
%o A216664 (PARI) forstep(n=1, 491, 2, s=(n+1)/2; "\p s"; if(Mod(floor(10^s/n), 10)==9, print1(n, ", "))); \\ _Arkadiusz Wesolowski_, Aug 23 2013
%o A216664 (Python)
%o A216664 from itertools import count, islice
%o A216664 def A216664_gen(startvalue=1): # generator of terms >= startvalue
%o A216664     for n in count(max(startvalue+1-startvalue%2,1),2):
%o A216664         if 10**((n+1)//2)//n % 10 == 9:
%o A216664             yield n
%o A216664 A216664_list = list(islice(A216664_gen(),20)) # _Chai Wah Wu_, Mar 04 2022
%Y A216664 Cf. A187040.
%K A216664 base,nonn
%O A216664 1,1
%A A216664 _Arkadiusz Wesolowski_, Sep 14 2012