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

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

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

A238104 Sum of digits in periodic part of decimal expansion of 1/prime(n).

Original entry on oeis.org

0, 3, 0, 27, 9, 27, 72, 81, 99, 126, 54, 9, 18, 90, 207, 63, 261, 270, 144, 126, 36, 54, 171, 198, 432, 18, 153, 225, 486, 504, 189, 585, 36, 207, 666, 306, 351, 360, 747, 207, 801, 810, 369, 864, 441, 405, 135, 999, 486, 1026, 1044, 18, 135, 225, 1152, 1179, 1206, 18, 324, 126, 621, 657, 675, 612, 1404, 351
Offset: 1

Views

Author

Kozhukhov Vlad, Dec 04 2013

Keywords

Comments

Digit-sum of A060283(n).

Examples

			Prime(6) = 13, 1/13 = 0.076923076923076923076923..., the periodic part of which is 076923, whose digits add to 27 = a(6).
Since prime(n) must either divide or be coprime to 10, decimal expansions of prime(n) must either terminate or be purely recurrent, respectively. The only primes that divide 10 are prime(1) and prime(3), thus a(1) and a(3) = 0 as they have terminating decimal expansions. - _Michael De Vlieger_, May 20 2017
		

Crossrefs

Programs

  • Mathematica
    Table[Function[p, If[Divisible[10, p], 0, Total[RealDigits[1/p][[1, 1]]]]]@ Prime@ n, {n, 66}] (* Michael De Vlieger, May 20 2017 *)
  • PARI
    forprime(i=1,1e2,print1(sumdigits((10^iferr(znorder(Mod(10,i)),E,0)-1)/i)", ")) \\ Lear Young, Mar 01 2014

Formula

a(n) = A007953(A060283(n)). - Michel Marcus, Mar 02 2014

Extensions

Edited by David Applegate, Mar 01 2014

A060370 Ratios (p-1)/d, where p is a prime and d is the number of digits of the periodic part of the decimal expansion of 1/p.

Original entry on oeis.org

1, 2, 4, 1, 5, 2, 1, 1, 1, 1, 2, 12, 8, 2, 1, 4, 1, 1, 2, 2, 9, 6, 2, 2, 1, 25, 3, 2, 1, 1, 3, 1, 17, 3, 1, 2, 2, 2, 1, 4, 1, 1, 2, 1, 2, 2, 7, 1, 2, 1, 1, 34, 8, 5, 1, 1, 1, 54, 4, 10, 2, 2, 2, 2, 1, 4, 3, 1, 2, 3, 11, 2, 1, 2, 1, 1, 1, 4, 2, 2, 1, 3, 2, 1, 2
Offset: 1

Views

Author

Klaus Brockhaus, Apr 01 2001

Keywords

Comments

The sequence of 2nd, 4th and following terms coincides with A006556, which gives the "number of different cycles of digits in the decimal expansions of 1/p, 2/p, ..., (p-1)/p where p = n-th prime different from 2 or 5".

Examples

			a(13) = 40/5 = 8, since 41 is the 13th prime and the periodic part of 1/41 = 0.02439024390... consists of 5 digits.
		

Crossrefs

Programs

  • Mathematica
    Join[{1, 2, 4}, Table[p = Prime[n]; (p - 1)/Length[RealDigits[1/p, 10][[1, 1]]], {n, 4, 100}]] (* T. D. Noe, Oct 04 2012 *)
  • Python
    from sympy import prime, n_order
    def A060370(n): return 1 if n == 1 or n == 3 else n_order(10, prime(n))
    print([(prime(n)-1)//A060370(n) for n in range(1,86)]) # Karl-Heinz Hofmann, Mar 16 2022

Formula

a(n) = (b(n)-1)/c(n), where b(n) and c(n) are the n-th terms of A000040 and A048595 respectively.

A086999 Periodic part of decimal expansion of 1/p for those primes having a periodic part of even length.

Original entry on oeis.org

142857, 90, 769230, 5882352941176470, 526315789473684210, 4347826086956521739130, 3448275862068965517241379310, 2127659574468085106382978723404255319148936170
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 29 2003

Keywords

Comments

A087001(n)=floor(a(n)/10^A087000(n)), A087002(n)=a(n) mod 10^A087000(n);
A087001(n) + A087002(n) = 10^A087000(n) - 1;
a(n) = A087001(n)*10^A087000(n) + A087002(n).

Examples

			p=73: a(11)=A060283(21)=13698630 -> [1369][8630] ->
A087001(11)=1369, A087002(11)=8630, A087001(11)+A087002(11)=1369+8630=9999.
		

References

  • H. Rademacher and O. Toeplitz, Von Zahlen und Figuren (Springer 1930, reprinted 1968), ch. 19, Die periodischen Dezimalbrueche.

Crossrefs

A235589 The periodic part of the decimal expansion of m/(m+1), for those m/(m+1) that have pure periods.

Original entry on oeis.org

6, 857142, 8, 90, 923076, 9411764705882352, 947368421052631578, 952380, 9565217391304347826086, 962, 9655172413793103448275862068, 967741935483870, 96, 972, 974358, 97560, 976744186046511627906, 9787234042553191489361702127659574468085106382, 979591836734693877551020408163265306122448
Offset: 1

Views

Author

Bill McEachen, Jan 12 2014

Keywords

Comments

A companion sequence stemming from the some of the elements excluded by A156703. The sequence is highly volatile and infinite...as with A156703 the subset elements are encountered in numerical order. a(n) will start with the digit 9 for n>4 I believe. Entries can grow quite large very quickly. Each entry will be encountered once, and they will end in an even digit.
The number of digits of a(n) is given by A002329. - Michel Marcus, Aug 19 2015

Examples

			1/2=0.5 non-repeating, so exclude from sequence.
2/3=0.6 repeating, so a(1)=6.
5/6=0.833 (repeating) but has "8" prefix ahead of repeating "3" so exclude from sequence (decimal expansion not purely periodic)
6/7=0.857142 repeating so a(2)=857142.
		

Crossrefs

Subsequence of A259299.

Programs

  • Mathematica
    FromDigits@ Flatten@ First@ RealDigits[(# - 1)/#] & /@ Select[Range@ 120, CoprimeQ[#, 10] &] //Rest (* Michael De Vlieger, Aug 18 2015 *)

Formula

a(n) = the periodic part of the decimal expansion of (A045572(n+1)-1) / A045572(n+1). - Doug Bell, Aug 17 2015

Extensions

Missing terms added by Ralf Stephan, Jan 19 2014
Incorrect terms 916, 94 removed and two more terms added by Michael De Vlieger, Aug 18 2015

A382638 Numbers k for which the repeating part with leading 0's of 1/k in decimal is a palindrome and longer than one digit.

Original entry on oeis.org

1616, 14208, 16160, 17472, 142080, 161600, 174720, 454656, 511488, 838656, 1363968, 1420800, 1578125, 1616000, 1747200, 1818624, 1900992, 4091904, 4265625, 4546560, 4734375, 5114880, 8183808, 8386560, 13639680, 14208000, 15781250, 16160000, 17472000, 18186240, 19009920
Offset: 1

Views

Author

Jean-Marc Rebert, Apr 01 2025

Keywords

Examples

			1616 is a term, because 1/1616 = 0.0006188118811881188118811881188118811881... = 0.0006(1881), where the repeating period 1881 is a palindrome longer than a single digit.
511488 is a term, because 1/511488 = 1.955080080080080080080080080080080080... E-6 = 1.955(080) E-6, where the repeating period O80 is a palindrome longer than a single digit.
11 is not a term, because 1/11 = 0.09090909090909090909090909090909090909... = 0,(09), where the repeating period 09 is not a palindrome .
101 is not a term, because 1/101 = 0.0099009900990099009900990099009900990099 = 0,(0099), where the repeating period 0099 is not a palindrome.
Term 4091904 is itself a palindrome. - _Bert Dobbelaere_, Apr 27 2025
		

Crossrefs

Cf. A382176 (in golden ratio base).

Programs

  • Mathematica
    p[{t_List}]:=t; p[t_List]:={}; p[{, t_List}]:=t; Select[ Range@ 20000, (r = p@ RealDigits[1/#][[1]]; Length@ r > 1 && r == Reverse@ r) &] (* Giovanni Resta, Apr 23 2025 *)
  • Python
    from itertools import count, islice
    from sympy import multiplicity, n_order
    def A382638_gen(startvalue=1): # generator of terms >= startvalue
        for k in count(max(startvalue,1)):
            m2, m5 = multiplicity(2,k), multiplicity(5,k)
            r = max(m2,m5)
            b, m = 10**r, 10**(t:=n_order(10,c) if (c:=(k>>m2)//5**m5)>1 else 1)-1
            s = str(m*b//k-b//k*m).zfill(t)
            if len(s)>1 and s[:(l:=len(s)+1>>1)]==s[:-l-1:-1]:
                yield k
    A382638_list = list(islice(A382638_gen(),4)) # Chai Wah Wu, Apr 22 2025

Extensions

More terms from Bert Dobbelaere, Apr 27 2025
Showing 1-10 of 10 results.