%I #41 Apr 22 2023 12:12:14
%S 0,5,2,6,3,1,5,7,8,9,4,7,3,6,8,4,2,1,0,5,2,6,3,1,5,7,8,9,4,7,3,6,8,4,
%T 2,1,0,5,2,6,3,1,5,7,8,9,4,7,3,6,8,4,2,1,0,5,2,6,3,1,5,7,8,9,4,7,3,6,
%U 8,4,2,1,0,5,2,6,3,1,5,7,8,9,4,7,3,6,8,4,2,1,0,5,2,6,3,1,5,7,8
%N Decimal expansion of 1/19.
%C The 18-digit cycle 1, 0, 5, 2, 6, 3, 1, 5, 7, 8, 9, 4, 7, 3, 6, 8, 4, 2 in this sequence and the others based on nineteenths gives the successive digits of the smallest integer which is doubled, quadrupled and octupled when the last three digits in turn are moved from the right hand end to the left hand end. For example, 842105263157894736 is eight times 105263157894736842. - _Ian Duff_, Jan 07 2009, Jan 12 2009
%C The magic square that uses the decimals of 1/19 is fully magic. 383 has the same property (see A021387). For other such primes see A072359. - _Michel Marcus_, Sep 02 2015
%C Since 19 is prime and the cycle of its reciprocal's base 10 digits is 19 - 1 long, 19 is a full reptend prime (A001913). - _Alonso del Arte_, Mar 21 2020
%D Martin Gardner, Cyclic numbers, Mathematical Circus, Chapter 10, p. 172, of the 1992 Mathematical Association of America edition.
%D GCHQ, The GCHQ Puzzle Book, Penguin, 2016. See page 92.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Prime_reciprocal_magic_square">Prime reciprocal magic square</a>
%H <a href="/index/Rec#order_10">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,0,0,0,0,0,-1,1).
%F G.f.: -x*(x^8 + x^7 + 2*x^6 + 4*x^5 - 2*x^4 - 3*x^3 + 4*x^2 - 3*x + 5)/((x - 1)*(x + 1)*(x^2 - x + 1)*(x^6 - x^3 + 1)). - _Colin Barker_, Aug 15 2012
%t Prepend[First@ RealDigits[N[1/19, 120]], 0] (* _Michael De Vlieger_, Sep 02 2015 *)
%t LinearRecurrence[{1,0,0,0,0,0,0,0,-1,1},{0,5,2,6,3,1,5,7,8,9},100] (* or *) PadRight[{},100,{0,5,2,6,3,1,5,7,8,9,4,7,3,6,8,4,2,1}] (* _Harvey P. Dale_, Jan 23 2021 *)
%o (PARI) default(realprecision,2000);1/19.0 \\ _Anders Hellström_, Sep 02 2015
%o (Scala) def longDivRecip(n: Int, places: Int = 100): List[Int] = {
%o val pow10 = Math.pow(10, Math.ceil(Math.log10(Math.abs(n)))).toInt
%o val digits = new scala.collection.mutable.ListBuffer[Int]()
%o var quotient = pow10; var remainder = 0
%o while (digits.size < places) {
%o remainder = quotient % n; quotient /= n; digits += quotient
%o quotient = remainder * 10
%o }
%o digits.toList
%o }
%o 0 :: longDivRecip(19) // _Alonso del Arte_, Mar 20 2020
%Y Cf. A021387, A072359.
%K nonn,cons,easy
%O 0,2
%A _N. J. A. Sloane_.