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.

Showing 1-5 of 5 results.

A036275 The periodic part of the decimal expansion of 1/n. Any initial 0's are to be placed at end of cycle.

Original entry on oeis.org

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
Offset: 1

Views

Author

Keywords

Comments

a(n) = 0 iff n = 2^i*5^j (A003592). - Jon Perry, Nov 19 2014
a(n) = n iff n = 3 or 6 (see De Koninck & Mercier reference). - Bernard Schott, Dec 02 2020

Examples

			1/28 = .03571428571428571428571428571428571428571... and digit-cycle is 571428, so a(28)=571428.
		

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.

Crossrefs

Programs

  • 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 *)

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

A048595 Alternative start to A002371, which is the main entry for this sequence.

Original entry on oeis.org

1, 1, 1, 6, 2, 6, 16, 18, 22, 28, 15, 3, 5, 21, 46, 13, 58, 60, 33, 35, 8, 13, 41, 44, 96, 4, 34, 53, 108, 112, 42, 130, 8, 46, 148, 75, 78, 81, 166, 43, 178, 180, 95, 192, 98, 99, 30, 222, 113, 228, 232, 7, 30, 50, 256, 262, 268, 5, 69, 28, 141, 146, 153, 155, 312, 79, 110
Offset: 1

Views

Author

Keywords

Comments

This sequence also gives the number of digits of the periodic part of the decimal expansion of n/(n-th prime). The periodic part of 1/(n-th prime) (cf. A060283) is in general different from the periodic part of n/(n-th prime) (cf. A060251), but their lengths are equal. - Klaus Brockhaus, Apr 01 2001

Crossrefs

A060284 Periodic part of decimal expansion of 1/n (leading 0's omitted).

Original entry on oeis.org

0, 0, 3, 0, 0, 6, 142857, 0, 1, 0, 9, 3, 76923, 714285, 6, 0, 588235294117647, 5, 52631578947368421, 0, 47619, 45, 434782608695652173913, 6, 0, 384615, 37, 571428, 344827586206896551724137931, 3, 32258064516129, 0, 3, 2941176470588235, 285714, 7, 27, 263157894736842105
Offset: 1

Views

Author

N. J. A. Sloane, Mar 30 2001

Keywords

Examples

			1/11 = .09090909..., so a(11) = 9.
		

Crossrefs

Extensions

More terms from Klaus Brockhaus and Jason Earls, Mar 30 2001
Offset corrected by R. J. Mathar, Jun 26 2010
B-file extended and a(168) and a(184) corrected by Ray Chandler, Jun 27 2017

A060283 Periodic part of decimal expansion of reciprocal of n-th prime (leading 0's moved to end).

Original entry on oeis.org

0, 3, 0, 142857, 90, 769230, 5882352941176470, 526315789473684210, 4347826086956521739130, 3448275862068965517241379310, 322580645161290, 270, 24390, 232558139534883720930, 2127659574468085106382978723404255319148936170
Offset: 1

Views

Author

N. J. A. Sloane, Mar 30 2001

Keywords

Examples

			1/11 = .09090909..., so a(5) = 90.
		

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[FindTransientRepeat[RealDigits[1/p,10,100][[1]],2][[2]]],{p,Prime[Range[20]]}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 10 2021 *)
  • PARI
    a(n)=t=iferr(znorder(Mod(10,n)),E,0);d=(10^t-1)/n;s=t-#Str(d);if(s,d*10^s,d)
    forprime(i=1,1e2,print1(a(i)", ")) \\ Lear Young, Mar 01 2014

Formula

A060283 = A036275 o A000040, i.e., a(n) = A036275(A000040(n)). - M. F. Hasler, Dec 28 2015

Extensions

More terms from Klaus Brockhaus, Mar 30 2001

A060282 Periodic part of decimal expansion of reciprocal of n-th prime (leading 0's omitted).

Original entry on oeis.org

0, 3, 0, 142857, 9, 76923, 588235294117647, 52631578947368421, 434782608695652173913, 344827586206896551724137931, 32258064516129, 27, 2439, 23255813953488372093, 212765957446808510638297872340425531914893617
Offset: 1

Views

Author

N. J. A. Sloane, Mar 30 2001

Keywords

Examples

			1/7 = 0.142857142..., so a(4) = 142857.
1/11 = 0.09090909..., so a(5) = 9.
		

Crossrefs

Programs

  • Mathematica
    primePer[1] = primePer[3] = 0; primePer[n_] := FromDigits[(d = RealDigits[1/Prime[n]])[[1, 1]]] * 10^d[[2]]; Array[ primePer, 15] (* Amiram Eldar, Apr 28 2020 *)
  • PARI
    f(n)=if(n<4,n==2,znorder(Mod(10, prime(n)))) \\ A002371
    for(n=1,100,print1(floor(10^f(n)/prime(n)),","))

Formula

a(n) = floor(10^A002371(n)/prime(n)).
a(n) = 0 if and only if n = 1 or 3, corresponding to the primes 2 and 5, which are factors of 10. - Alonso del Arte, Apr 03 2020
ceiling(log_10(a(n))) = prime(n) - 1 if prime(n) is a full reptend prime (A001913). - Alonso del Arte, Apr 14 2020

Extensions

More terms from Klaus Brockhaus, Mar 30 2001
Showing 1-5 of 5 results.