OFFSET
1,3
COMMENTS
a(n) = n iff n = 3 or 6 (see De Koninck & Mercier reference). - Bernard Schott, Dec 02 2020
REFERENCES
Jean-Marie De Koninck & Armel Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problème 347 pp. 50 and 205, Ellipses, Paris, 2004.
LINKS
Philippe Guglielmetti, Table of n, a(n) for n = 1..1001 (first 500 terms from T. D. Noe)
EXAMPLE
1/28 = .03571428571428571428571428571428571428571... and digit-cycle is 571428, so a(28)=571428.
MAPLE
isCycl := proc(n) local ifa, i ; if n <= 2 then RETURN(false) ; fi ; ifa := ifactors(n)[2] ; for i from 1 to nops(ifa) do if op(1, op(i, ifa)) <> 2 and op(1, op(i, ifa)) <> 5 then RETURN(true) ; fi ; od ; RETURN(false) ; end: A036275 := proc(n) local ifa, sh, lpow, mpow, r ; if not isCycl(n) then RETURN(0) ; else lpow:=1 ; while true do for mpow from lpow-1 to 0 by -1 do if (10^lpow-10^mpow) mod n =0 then r := (10^lpow-10^mpow)/n ; r := r mod (10^(lpow-mpow)-1) ; while r*10 < 10^(lpow-mpow) do r := 10*r ; od ; RETURN(r) ; fi ; od ; lpow := lpow+1 ; od ; fi ; end: for n from 1 to 60 do printf("%d %d ", n, A036275(n)) ; od ; # R. J. Mathar, Oct 19 2006
MATHEMATICA
fc[n_]:=Block[{q=RealDigits[1/n][[1, -1]]}, If[IntegerQ[q], 0, While[First[q]==0, q=RotateLeft[q]]; FromDigits[q]]];
Table[fc[n], {n, 36}] (* Ray Chandler, Nov 19 2014, corrected Jun 27 2017 *)
Table[FromDigits[FindTransientRepeat[RealDigits[1/n, 10, 120][[1]], 3] [[2]]], {n, 40}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 12 2019 *)
CROSSREFS
KEYWORD
base,nonn,easy,nice
AUTHOR
EXTENSIONS
Corrected and extended by N. J. A. Sloane
Corrected a(92), a(208), a(248), a(328), a(352) and a(488) which missed a trailing zero (see the table). - Philippe Guglielmetti, Jun 20 2017
STATUS
approved