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-3 of 3 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

A060251 a(n) = periodic part of decimal expansion of n/n-th prime (leading 0's moved to end).

Original entry on oeis.org

0, 6, 0, 571428, 45, 461538, 4117647058823529, 421052631578947368, 3913043478260869565217, 3448275862068965517241379310, 354838709677419, 324, 31707, 325581395348837209302, 3191489361702127659574468085106382978723404255
Offset: 1

Views

Author

Jason Earls, Mar 21 2001

Keywords

Examples

			a(4) = 4/7=.571428571428... so a(4)= 571428.
		

Crossrefs

Extensions

More terms from Klaus Brockhaus, Mar 31 2001
Description clarified by Ray Chandler, Jun 27 2017

A247585 Period of the decimal expansion of 1/p as p runs through the prime numbers of the form n^2+1 (0 by convention for the primes 2 and 5).

Original entry on oeis.org

0, 0, 16, 3, 4, 98, 256, 200, 576, 338, 1296, 200, 1458, 3136, 242, 1369, 7056, 1620, 4418, 12100, 13456, 3600, 15376, 567, 3380, 8978, 10658, 7500, 24336, 25, 5780, 30976, 600, 33856, 41616, 10609, 44100, 50176, 52900, 55696, 14400, 62500, 65536, 33800, 69696, 8100
Offset: 1

Views

Author

Michel Lagneau, Sep 20 2014

Keywords

Comments

Subsequence of A002371 or period of the decimal expansion of 1/A002496(n).
The squares > 0 in the sequence are 4, 16, 25, 256, 576, 1296, 1369, 3136, 3600, 7056, 8100, 10609, ...

Examples

			a(3) = 16 because A002496(3) = 17 and 1/17 = 0. 0588235294117647 0588235294117647 ... has period 16.
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[If[PrimeQ[n^2+1],AppendTo[lst,n^2+1]],{n,1,1000}];Table[Length[RealDigits[1/lst[[m]]][[1,1]]],{m,1,60}]

Formula

a(n) = A002371(A000720(A002496(n))). [Corrected by Georg Fischer, Oct 19 2024]
Showing 1-3 of 3 results.