Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A036275
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A036275 First digit-cycle of decimal expansion of 1/n. Any initial 0's are to be placed at end of cycle. +0
8
0, 0, 3, 0, 0, 6, 142857, 0, 1, 0, 90, 3, 769230, 714285, 6, 0, 5882352941176470, 5, 526315789473684210, 0, 476190, 45, 4347826086956521739130, 6, 0, 384615, 370, 571428, 3448275862068965517241379310, 3, 322580645161290, 0, 30, 2941176470588235, 285714, 7 (list; graph; listen)
OFFSET

1,3

LINKS

Index entries for sequences related to decimal expansion of 1/n

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 (mathar(AT)strw.leidenuniv.nl), Oct 19 2006

MATHEMATICA

r[x_]:=RealDigits[1/x]; w[x_]:=First[r[x]]; f[x_]:=First[w[x]]; l[x_]:=Last[w[x]]; z[x_]:=Last[r[x]];

c[x_] := Which[IntegerQ[l[x]], 0, IntegerQ[f[x]]==False, FromDigits[f[x]], True, FromDigits[l[x]]]; Table[c[i], {i, 1, 36}] (from Hans Havermann, Oct 19 2006)

fc[n_] := Block[{q}, q = Last[First[RealDigits[1/n]]]; If[IntegerQ[q], q = {}]; FromDigits[q]]; Table[fc[n], {n, 40}] (*Chandler*)

CROSSREFS

Cf. A007732, A051626, A036275, A002371, A048595, A006883, A007498, A007615, A040017, A051627.

See also A060282, A060283, A060251.

Sequence in context: A135028 A110620 A060284 this_sequence A131436 A046765 A046777

Adjacent sequences: A036272 A036273 A036274 this_sequence A036276 A036277 A036278

KEYWORD

base,nonn,easy,nice

AUTHOR

Floor van Lamoen (fvlamoen(AT)hotmail.com)

EXTENSIONS

Corrected and extended by N. J. A. Sloane (njas(AT)research.att.com).

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 23 17:09 EST 2009. Contains 167438 sequences.


AT&T Labs Research