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 11 results. Next

A114205 Write decimal expansion of 1/n as 0.PPP...PQQQ..., where QQQ... is the cyclic part. If the expansion does not terminate, any leading 0's in QQQ... are regarded as being at the end of the PPP...P part. Sequence gives PPP...P, right justified, with leading zeros omitted.

Original entry on oeis.org

5, 0, 25, 2, 1, 0, 125, 0, 1, 0, 8, 0, 0, 0, 625, 0, 0, 0, 5, 0, 0, 0, 41, 4, 0, 0, 3, 0, 0, 0, 3125, 0, 0, 0, 2, 0, 0, 0, 25, 0, 0, 0, 2, 0, 0, 0, 208, 0, 2, 0, 1, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 15625, 0, 0, 0, 1, 0, 0, 0, 13, 0, 0, 1, 1, 0, 0, 0, 125, 0, 0, 0, 1, 0, 0, 0, 11, 0, 0, 0, 10
Offset: 2

Views

Author

N. J. A. Sloane, Oct 17 2006

Keywords

Comments

b(n) = A386406(n) gives the length of P (including leading zeros), c(n) = A036275(n) gives the smallest cycle in QQQ... (including terminating zeros) and d(n) = A051626(n) gives the length of that cycle.
Thus 1/n = 10^(-b(n)) * ( a(n) + c(n)/(10^d(n) - 1) ). When c(n)=d(n)=0, the fraction c(n)/(10^d(n) - 1), which is 0/0, evaluates (by definition) to 0.

Examples

			n .. expansion of 1/n .... a b c d
2 .50000000000000000000... 5 1 0 0
3 .33333333333333333333... 0 0 3 1
4 .25000000000000000000... 25 2 0 0
5 .20000000000000000000... 2 1 0 0
6 .16666666666666666667... 1 1 6 1
7 .14285714285714285714... 0 0 142857 6
8 .12500000000000000000... 125 3 0 0
9 .11111111111111111111... 0 0 1 1
10 .1000000000000000000... 1 1 0 0
11 .0909090909090909090... 0 1 90 2
12 .0833333333333333333... 8 2 3 1
13 .0769230769230769230... 0 1 769230 6
14 .0714285714285714285... 0 1 714285 6
15 .0666666666666666666... 0 1 6 1
16 .0625000000000000000... 625 4 0 0
(Start)
92 .0108695652173913043... 10  3 869...260 22
102 .009803921568627450... 0   2 980...450 16
416 .002403846153846153... 240 5 384615    6
4544 .00022007042253521... 2200 7 704...450 35
(End) - _Ruud H.G. van Tol_, Nov 20 2024
		

Crossrefs

Programs

  • Maple
    A114205 := proc(n) local sh,lpow,mpow,a,b ; lpow:=1 ; while true do for mpow from lpow-1 to 0 by -1 do if (10^lpow-10^mpow) mod n =0 then a := (10^lpow-10^mpow)/n ; sh := 10^(lpow-mpow)-1 ; b := a mod sh ; a := floor(a/sh) ; while b>0 and b*10 < sh+1 do a := 10*a ; b := 10*b ; end ; RETURN(a) ; fi ; od ; lpow := lpow+1 ; od ; end: for n from 2 to 600 do printf("%d %d ",n,A114205(n)) ; od ; # R. J. Mathar, Oct 19 2006
  • Mathematica
    fa[n_] := Block[{p},p = First[RealDigits[1/n]];If[ ! IntegerQ[Last[p]], p =  Join[Most[p],TakeWhile[Last[p],#==0&]]];FromDigits[p]];Table[fa[n], {n, 100}] (* Ray Chandler, Oct 18 2006 *)
  • PARI
    a(n)= my(s=max(valuation(n, 2), valuation(n, 5))); s||return(0); my([p, r]= divrem(10^s, n)); if(r&&(r=n\r)>9, s+=logint(r, 10)); 10^s\n; \\ Ruud H.G. van Tol, Nov 19 2024

Extensions

More terms from Ray Chandler and Hans Havermann, Oct 18 2006
I would also like to get programs that produce this and A114206, A036275, A051626 in Maple.
Edited by Andrei Zabolotskii, Jul 20 2025

A178505 Decimal form of the period of 1/n for n such that gcd(n,10)=1. Leading zeros are suppressed.

Original entry on oeis.org

3, 142857, 1, 9, 76923, 588235294117647, 52631578947368421, 47619, 434782608695652173913, 37, 344827586206896551724137931, 32258064516129, 3, 27, 25641, 2439, 23255813953488372093
Offset: 1

Views

Author

Michel Lagneau, May 29 2010

Keywords

Comments

The numbers n are A045572, and the corresponding periods are A002329.

Examples

			3 is in the sequence because 1/3 = 0.3333...
142857 is in the sequence because 1/7 = 0.142857 142857 ...
1 is in the sequence because 1/9 = 0.1111....
		

Crossrefs

Programs

  • Maple
    with(numtheory): nn:= 100: T:=array(1..nn):k:=1: U:=array(1..nn):k:=1: for n from 2 to 200 do:x:=1/n:for p from 1 to 200 while(irem(10^p,n)<>1 or gcd(n,10)<> 1) do:od: if irem(10^p,n) = 1 and gcd(n,10) = 1 then y:=floor(x*10^p): T[k]:=y: U[k]:=n : k:=k+1:else fi:od:print(T):

Formula

a(n) = A060284(A045572(n+1)). [R. J. Mathar, Jun 26 2010]

Extensions

Name corrected by T. D. Noe, Jul 07 2010

A180340 Numbers with x digits such that the first x multiples are cyclic permutations of the number, leading 0's omitted (or cyclic numbers).

Original entry on oeis.org

142857, 588235294117647, 52631578947368421, 434782608695652173913, 344827586206896551724137931, 212765957446808510638297872340425531914893617, 169491525423728813559322033898305084745762711864406779661
Offset: 1

Views

Author

Ralph Kerchner (daxkerchner(AT)hotmail.com), Aug 28 2010

Keywords

Comments

Periodic part of decimal expansion of 1/A001913(n). The number of digits in each term (including leading zeros), plus one, makes the sequence A001913.

Examples

			142857 is in the sequence because it has 6 digits and the first 6 multiples of 142857 are 142857, 285714, 428571, 571428, 714285, and 857142, all cyclic permutations of the number. Also the first term of A001913 is 7, and 1/7 = 0.142857142857... .
588235294117647 is the next number because 0588235294117647 has 16 digits and the first 16 multiples are cyclic permutations of the number; the second term of A001913 is 17, and 1/17 = 0.05882352941176470588235294117647... .
		

Crossrefs

A006883 starting from the second term of A006883, omitting ending 0's.
The n-th terms of A060284 where n is a member of A001913.

Programs

  • Mathematica
    Map[(10^(# - 1) - 1)/# &, Select[Prime@ Range@ 17, MultiplicativeOrder[10, #] == # - 1 &]] (* Michael De Vlieger, Apr 03 2017 *)

Formula

a(n) = (10^(A001913(n)-1) - 1) / A001913(n).

A259299 The decimal expansion of n/(n+1) until it terminates or repeats, shown without the decimal point.

Original entry on oeis.org

0, 5, 6, 75, 8, 83, 857142, 875, 8, 9, 90, 916, 923076, 9285714, 93, 9375, 9411764705882352, 94, 947368421052631578, 95, 952380, 954, 9565217391304347826086, 9583, 96, 9615384, 962, 96428571, 9655172413793103448275862068, 96, 967741935483870, 96875, 96, 97058823529411764, 9714285, 972, 972
Offset: 0

Views

Author

Doug Bell, Jun 23 2015

Keywords

Comments

The first occurrence of a repeated term where a(n) = a(n+1) is for a(35) and a(36), both of which equal 972. This results from two different repeating decimals with different length repeating periods but the same non-repeating plus repeating digits, namely 35/36 = .972222... = 972 (repeating period of 1) and 36/37 = .972972... = 972 (repeating period of 3).
Other than n = (36,37) the only repeated terms appear to follow one of the following two patterns for the larger value of n:
First pattern: for n >= 111, where all digits of n are 1: 111, 1111, 11111, ... and a(n-1) = a(n) = 990, 9990, 99990, ... with the repeating decimal for ((n-1)/n, n/(n+1)) of (.9909090..., .990990990...), (.9990990990..., .999099909990...), (.9999099909990..., .999909999099990...). Where d is the number of digits in a(n), the repeating period for the decimal values is (d-1, d).
Second pattern: for n >= 10101, where the digits of n alternate between 0 and 1, with a final digit of 1: 10101, 1010101, 101010101, ... and a(n-1) = a(n) = 999900, 9999900, 99999900, ... with the repeating decimal for ((n-1)/n, n/(n+1)) of (.99990099009900..., .999900999900999900...), (.99999009990099900..., .999990099999009999900...), (.99999900999900999900..., .999999009999990099999900...). Where d is the number of digits in a(n), the repeating period for the decimal values is (d-2, d).
Have verified that there are no other repeating terms up to n = 10^6.

Examples

			a(1)=5 (1/2=0.5), a(2)=6 (2/3=0.6666...=6), a(3)=75 (3/4=0.75=75).
		

Crossrefs

Subsequences A156703, A235589.

Programs

  • Mathematica
    Array[FromDigits@ Flatten@ First@ RealDigits[(# - 1)/#] &, 37] (* Michael De Vlieger, Aug 18 2015 *)

A266385 a(n) = floor(10^k/n) where k is the smallest integer such that the whole first period or the whole terminating fractional part of the decimal expansion of 1/n is shifted to appear before the decimal point in 10^k/n.

Original entry on oeis.org

1, 5, 3, 25, 2, 16, 142857, 125, 1, 1, 9, 83, 76923, 714285, 6, 625, 588235294117647, 5, 52631578947368421, 5, 47619, 45, 434782608695652173913, 416, 4, 384615, 37, 3571428, 344827586206896551724137931, 3, 32258064516129, 3125, 3, 2941176470588235, 285714, 27
Offset: 1

Views

Author

M. F. Hasler, Dec 28 2015

Keywords

Comments

The period is given in A051626 (with 0 if 1/n terminates) and A007732 (with 1 if 1/n terminates). The periodic part is given in A060284 (with initial 0's omitted) and A036275 (with initial 0's appended).

Examples

			a(1) = 1 because 1/1 = 1.0 (k = 0),
a(2) = 5 because 1/2 = 0.5 (k = 1),
a(3) = 3 because 1/3 = 0.{3}*, where {...}* means that these digits repeat forever.
a(4) = 25 because 1/4 = 0.25 (k = 2),
a(5) = 2 because 1/5 = 0.2 (k = 1),
a(6) = 16 because 1/6 = 0.1{6}* (k = 2),
a(7) = 142857 because 1/7 = 0.{142857}* (k = 6),
a(8) = 125 because 1/8 = 0.125 (k = 3),
a(9) = 1 because 1/9 = 0.{1}* (k = 1),
a(10) = 1 because 1/10 = 0.1 (k = 1), ...
		

Crossrefs

Formula

a(n) = A060284(n) (mod 10^A051626(n)).

Extensions

Name edited and a(13) onwards from Mohammed Yaseen, Jun 03 2021

A061564 Numbers k such that the repeating part of the decimal expansion of 1/k (omitting leading or trailing zeros) forms a prime number.

Original entry on oeis.org

3, 12, 18, 27, 30, 33, 36, 45, 48, 75, 120, 180, 192, 198, 270, 288, 300, 330, 333, 360, 369, 450, 480, 495, 750, 768, 909, 1152, 1200, 1584, 1800, 1875, 1920, 1980, 1998, 2151, 2304, 2439, 2700, 2880, 2997, 3000, 3072, 3300, 3330, 3333, 3600, 3690, 4500, 4800
Offset: 1

Views

Author

Brian Wallace (wallacebrianedward(AT)yahoo.co.uk), May 18 2001

Keywords

Examples

			1/18 = 0.05555555..., the repeating part is 5, so 18 is in the sequence.
277 is not a term because the repetend of 1/277 is 3610108303249097472924187725631768953068592057761732851985559566787, which is not a prime. - _Barry Smyth_, Mar 31 2022
		

Crossrefs

Extensions

Corrected and extended by Klaus Brockhaus, May 19 2001
More terms from Lior Manor, Nov 26 2001
Incorrect term 277 removed by Barry Smyth, Mar 31 2022
Corrected and extended by Sean A. Irvine, Feb 25 2023

A376088 Positive numbers k such that in the decimal expansion of 1/k a nonzero digit is never followed by a zero.

Original entry on oeis.org

3, 6, 7, 9, 12, 14, 15, 18, 22, 24, 26, 28, 30, 35, 36, 44, 45, 54, 55, 56, 60, 65, 66, 70, 72, 74, 75, 82, 88, 90, 104, 108, 112, 120, 132, 140, 144, 148, 150, 175, 176, 180, 216, 220, 224, 225, 240, 252, 260, 264, 275, 280, 288, 292, 296, 300, 308, 350, 360
Offset: 1

Views

Author

Rémy Sigrist, Sep 09 2024

Keywords

Comments

Or numbers k such that 1/k has only one (infinite) run of (leading) zeros.
Or numbers k such that 1/k has only one infinite run of nonzero digits (considering that reciprocals of terms of A003592 end with 0's).
This sequence is infinite: if m is a term, then 10*m is also a term.

Examples

			The first terms, alongside their reciprocal (with the repeating part between parentheses), are:
  n   a(n)  1/a(n)
  --  ----  ------------
   1     3  0.(3)
   2     6  0.1(6)
   3     7  0.(142857)
   4     9  0.(1)
   5    12  0.08(3)
   6    14  0.0(714285)
   7    15  0.0(6)
   8    18  0.0(5)
   9    22  0.0(45)
  10    24  0.041(6)
  11    26  0.0(384615)
  12    28  0.03(571428)
  13    30  0.0(3)
  14    35  0.0(285714)
  15    36  0.02(7)
		

Crossrefs

Programs

  • PARI
    \\ See Links section.
    (C++) // See Links section.

A193886 Numbers n such that the decimal form of the period of 1/n is semiprime (omit any trailing zeros from the period).

Original entry on oeis.org

6, 11, 15, 24, 54, 60, 66, 81, 96, 110, 111, 123, 135, 144, 150, 165, 216, 225, 240, 303, 352, 375, 384, 396, 477, 528, 540, 600, 660, 666, 711, 717, 738, 792, 810, 813, 960, 1056, 1100, 1110, 1111, 1230, 1350, 1440, 1500, 1536, 1650, 1665, 1728, 1818, 1845, 2043, 2079
Offset: 1

Views

Author

Michel Lagneau, Aug 07 2011

Keywords

Comments

The sequence is infinite: if n is in the sequence, then n*10^m, m = 1,2,... are in the sequence.
The subsequence of semiprimes k such that the decimal form of the period of 1/k is semiprime begins: 6, 15, 111, 123, 303, 717, 813, 1111. - Jonathan Vos Post, Oct 22 2011

Examples

			54 is in the sequence because 1/54 = 0.01851851851851... and 185 = 5*37 is semiprime.
110 is in the sequence because 1/110 = 0.009090909090..., with period "90", and 9 is a semiprime. - _Harvey P. Dale_ and _N. J. A. Sloane_, Sep 07 2020
		

Crossrefs

Programs

  • Mathematica
    Reap[Do[p=RealDigits[1/k][[1,-1]];If[Head[p]===List,While[p[[-1]]==0,p=Most[p]];If[PrimeOmega[FromDigits[p]]==2,Sow[k]]],{k,120}]][[2,1]]

Formula

{ n : A060284(n) in {A001358} }.

Extensions

a(12)-a(53) from Alois P. Heinz, Aug 09 2011

A357756 a(n) is the least k > 0 such that A007953(n*k) equals A007953((n*k)^2), where A007953 is the sum of the digits.

Original entry on oeis.org

1, 1, 5, 3, 25, 2, 3, 27, 62, 1, 1, 5, 15, 27, 128, 3, 31, 17, 1, 1, 5, 9, 9, 2, 75, 4, 18, 7, 64, 5, 3, 16, 56, 3, 85, 17, 5, 27, 5, 9, 25, 9, 45, 13, 27, 1, 1, 27, 66, 54, 2, 9, 9, 18, 22, 1, 32, 15, 25, 135, 3, 18, 8, 3, 28, 9, 3, 43, 47, 72, 27, 8, 25, 126, 27
Offset: 0

Views

Author

Thomas Scheuerle, Oct 12 2022

Keywords

Comments

A task in the German competition "Bundeswettbewerb Mathematik 2021" was to prove that for each positive integer n there exists a k such that A007953(n*k) = A007953((n*k)^2).
One of the proposed proofs uses the argument that numbers of the form m = (10^x-1)*(10^y) will have the desired property A007953(m) = A007953(m^2). Thus we need to prove that we can find for all n a k, x and y such that n*k = (10^x-1)*(10^y). Let n be of the form b*2^c*5^d with b odd and not divisible by 5, then we know that y = max(c, d). From Euler's totient theorem we know that 10^x-1 will be divisible by e if x = A000010(e) where A000010 is Euler's totient function. See the formula section for the corresponding resulting k.
a(n) will never be divisible by 10.
If n is divisible by 3 but not by 9, then a(n) is divisible by 3. - Robert Israel, Oct 13 2022

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
       for k from 1 do if sd(n*k) = sd((n*k)^2) then return k fi od
    end proc:
    map(f, [$1..100]); # Robert Israel, Oct 13 2022
  • PARI
    a(n) = {my(k = 1); while(sumdigits(n*k)!=sumdigits((n*k)^2),k++);k}
    
  • Python
    def sd(n): return sum(map(int, str(n)))
    def a(n):
        k = 1
        while not sd(n*k) == sd((n*k)**2): k += 1
        return k
    print([a(n) for n in range(75)]) # Michael S. Branicky, Oct 13 2022

Formula

a(A058369(n)) = 1.
a(a(n)) <= n.
a(n) <= A132740(n)*A060284(A132740(n))*10^A051628(n)/n.
or a(n) <= (10^A000010(A132740(n))-1)*10^A051628(n)/n.

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 11 results. Next