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.

Previous Showing 11-20 of 39 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

A121341 Number of decimal places before 1/n either recurs or terminates.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 6, 3, 1, 1, 2, 3, 6, 7, 2, 4, 16, 2, 18, 2, 6, 3, 22, 4, 2, 7, 3, 8, 28, 2, 15, 5, 2, 17, 7, 3, 3, 19, 6, 3, 5, 7, 21, 4, 2, 23, 46, 5, 42, 2, 16, 8, 13, 4, 3, 9, 18, 29, 58, 3, 60, 16, 6, 6, 7, 3, 33, 18, 22, 7, 35, 4, 8, 4, 3, 20, 6, 7, 13, 4, 9, 6, 41, 8, 17, 22, 28, 5, 44, 2, 6
Offset: 1

Views

Author

Anthony C Robin, Aug 29 2006

Keywords

Comments

In this sequence, the repeating decimals (e.g., 1/7) are treated differently from nonrepeating decimals (e.g., 1/5). If they are treated the same, then a(2)=2, a(4)=3, a(5)=2, a(8)=4, a(10)=2, ... and we obtain A054710. The two sequence differ only for n = 2^j * 5^k.

Examples

			1/592 = 0.0016891891891... starts with 4 decimals (0016, zeros counted) and has period 3 (digits 891) to yield a(592) = 4 + 3 = 7.
		

Crossrefs

A007732 is the length of the periods and serves as a lower bound. Cf. A061075.

Programs

  • Mathematica
    a[n_] := Max[IntegerExponent[n, 2], IntegerExponent[n, 5]] + Length[RealDigits[1/n][[1, -1]]];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jul 20 2022 *)

Formula

a(n) = A051628(n) + A051626(n). - Sean A. Irvine, Apr 13 2022

Extensions

More terms from T. D. Noe, Aug 30 2006
Additional comments from R. J. Mathar, Aug 30 2006

A246004 The duodecimal period of 1/n, or 0 if 1/n terminates.

Original entry on oeis.org

0, 0, 0, 0, 4, 0, 6, 0, 0, 4, 1, 0, 2, 6, 4, 0, 16, 0, 6, 4, 6, 1, 11, 0, 20, 2, 0, 6, 4, 4, 30, 0, 1, 16, 12, 0, 9, 6, 2, 4, 40, 6, 42, 1, 4, 11, 23, 0, 42, 20, 16, 2, 52, 0, 4, 6, 6, 4, 29, 4, 15, 30, 6, 0, 4, 1, 66, 16, 11, 12, 35, 0, 36, 9, 20, 6, 6, 2, 26, 4, 0, 40, 41, 6, 16, 42, 4, 1, 8, 4, 6, 11, 30, 23, 12, 0, 16, 42, 1, 20, 100, 16, 102, 2, 12, 52, 53, 0, 54, 4, 9, 6, 112
Offset: 1

Views

Author

Eric Chen, Nov 13 2014

Keywords

Examples

			1/10 = 0.1249724972497... has period 4 in duodecimal, so a(10) = 4.
1/23 = 0.0631694842106316948421... has period 11 in duodecimal, so a(23) = 11.
		

Crossrefs

Cf. A007732, A051626 (decimal versions).
Cf. A246489.

Programs

A298982 a(n) is the least k for which the most significant decimal digits of k/n (disregarding any leading zeros) are n, or 0 if no such k exists.

Original entry on oeis.org

0, 0, 1, 0, 0, 4, 5, 7, 0, 1, 0, 0, 0, 2, 0, 0, 3, 0, 0, 4, 0, 5, 0, 0, 0, 7, 0, 8, 0, 9, 0, 0, 11, 0, 0, 13, 14, 0, 0, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 33, 34, 35, 36, 0, 39, 4, 41, 0, 44, 45, 0, 48, 49, 51, 52, 54, 55, 0, 58, 6, 61, 63, 64, 66, 68, 69, 71, 73, 74, 76, 78, 8, 81, 83, 85, 87, 89, 91, 93, 95, 97, 0, 1
Offset: 1

Views

Author

Keywords

Comments

By decimal digits we mean those of the fractional part of k/n. Otherwise said, we require floor(10^m*k/n) = n for some k < n and m.
Indices of 0's are listed in A298981, indices of the other terms are listed in A298980.
It appears that the asymptotic density of 0's is slightly below 45%: The number of 0's among a(1..10^k) is (5, 42, 461, 4553, 45423, 451315, 4506142, 45017570, ...). Is there a simple estimate for the exact value? - M. F. Hasler, Feb 01 2018
There may be no asymptotic density: the fraction of 0's fluctuates too much. See the linked plot.

Examples

			a(1) = 0 since there does not exist any k such that k/1 has a decimal digit which begins with 1 (cf. comment).
a(6) = 4 since 4/6 = 0.666... and its decimal digit begins with 6.
a(28) = 8 since 8/28 = 0.28571428571428... even though 1/28 = 0.0357142857142857... has "28" as a subsequence.
		

Crossrefs

Programs

  • Maple
    f:= proc (n) local m, k;
      for m from ceil(log[10](n^2)) by -1 to 1 do
         k := ceil(n^2/10^m);
         if n <= k then return 0 end if;
         if k < n*(n+1)/10^m then return k end if
      end do;
      0
    end proc:
    map(f, [$1..200]); # Robert Israel, Feb 09 2018
  • Mathematica
    f = Compile[{{n, _Integer}}, Block[{k = 1, il = IntegerLength@ n}, While[m = 10^il*k/n; While[ IntegerLength@ Floor@ m < il, m *= 10]; k < n && Floor[m] != n, k++]; If[k < n, k, 0]]]; Array[f, 100]
  • PARI
    A298982(n,k=(n^2-1)\10^(logint(n,10)+1)+1)={k*10^(logint((n^2-(n>1))\k, 10)+1)\n==n && return(k\10^valuation(k,10))} \\ M. F. Hasler, Feb 01 2018

A250211 Square array read by antidiagonals: A(m,n) = multiplicative order of m mod n, or 0 if m and n are not coprime.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 1, 2, 1, 1, 0, 0, 0, 1, 1, 1, 1, 2, 4, 1, 1, 0, 2, 0, 4, 0, 1, 1, 1, 0, 1, 2, 0, 3, 1, 1, 0, 1, 0, 0, 0, 6, 0, 1, 1, 1, 2, 2, 1, 2, 3, 2, 6, 1, 1, 0, 0, 0, 4, 0, 6, 0, 0, 0, 1, 1, 1, 1, 1, 4, 1, 2, 2, 3, 4, 10, 1, 1, 0, 2, 0, 2, 0, 0, 0, 6, 0, 5, 0, 1, 1, 1, 0, 2, 0, 0, 1, 2, 0, 0, 5, 0, 12, 1
Offset: 1

Views

Author

Eric Chen, Dec 29 2014

Keywords

Comments

Read by antidiagonals:
m\n 1 2 3 4 5 6 7 8 9 10 11 12 13
1 1 1 1 1 1 1 1 1 1 1 1 1 1
2 1 0 2 0 4 0 3 0 6 0 10 0 12
3 1 1 0 2 4 0 6 2 0 4 5 0 3
4 1 0 1 0 2 0 3 0 3 0 5 0 6
5 1 1 2 1 0 2 6 2 6 0 5 2 4
6 1 0 0 0 1 0 2 0 0 0 10 0 12
7 1 1 1 2 4 1 0 2 3 4 10 2 12
8 1 0 2 0 4 0 1 0 2 0 10 0 4
9 1 1 0 1 2 0 3 1 0 2 5 0 3
10 1 0 1 0 0 0 6 0 1 0 2 0 6
11 1 1 2 2 1 2 3 2 6 1 0 2 12
12 1 0 0 0 4 0 6 0 0 0 1 0 2
13 1 1 1 1 4 1 2 2 3 4 10 1 0
etc.
A(m,n) = Least k>0 such that m^k=1 (mod n), or 0 if no such k exists.
It is easy to prove that column n has period n.
A(1,n) = 1, A(m,1) =1.
If A(m,n) differs from 0, it is period length of 1/n in base m.
The maximum number in column n is psi(n) (A002322(n)), and all numbers in column n (except 0) divide psi(n), and all factors of psi(n) are in column n.
Except the first row, every row contains all natural numbers.

Examples

			A(3,7) = 6 because:
3^0 = 1 (mod 7)
3^1 = 3 (mod 7)
3^2 = 2 (mod 7)
3^3 = 6 (mod 7)
3^4 = 4 (mod 7)
3^5 = 5 (mod 7)
3^6 = 1 (mod 7)
...
And the period is 6, so A(3,7) = 6.
		

Crossrefs

Programs

  • Maple
    f:= proc(m,n)
      if igcd(m,n) <> 1 then 0
      elif n=1 then 1
      else numtheory:-order(m,n)
      fi
    end proc:
    seq(seq(f(t-j,j),j=1..t-1),t=2..65); # Robert Israel, Dec 30 2014
  • Mathematica
    a250211[m_, n_] = If[GCD[m, n] == 1, MultiplicativeOrder[m, n], 0]
    Table[a250211[t-j, j], {t, 2, 65}, {j, 1, t-1}]

A284601 Numbers k such that the decimal representation of 1/k does not terminate and has odd period.

Original entry on oeis.org

3, 6, 9, 12, 15, 18, 24, 27, 30, 31, 36, 37, 41, 43, 45, 48, 53, 54, 60, 62, 67, 71, 72, 74, 75, 79, 81, 82, 83, 86, 90, 93, 96, 106, 107, 108, 111, 120, 123, 124, 129, 134, 135, 142, 144, 148, 150, 151, 155, 158, 159, 162, 163, 164, 166, 172, 173, 180, 185, 186, 191, 192, 199, 201, 205, 212, 213, 214, 215
Offset: 1

Views

Author

Ilya Gutkovskiy, Mar 30 2017

Keywords

Comments

From Robert G. Wilson v, Apr 02 2017: (Start)
If k is in the sequence, then so are 2k and 5k.
The complement of A284602.
Primitives: 3, 9, 27, 31, 37, 41, 43, 53, 67, 71, 79, 81, 83, 93, 107, 111, 123, ..., .
(End)
From Robert Israel, Apr 03 2017: (Start)
Numbers of the form 2^j * 5^k * m where m > 1, gcd(m,10)=1 and the multiplicative order of 10 (mod m) is odd.
Complement of A003592 in the multiplicative semigroup generated by A186635, i.e., numbers whose prime factors are in A186635 with at least one prime factor not 2 or 5. (End)

Examples

			27 is in the sequence because 1/27 = 0.0370(370)... period is 3, 3 is odd.
2 and 5 are not in the sequence because 1/2 = 0.5 and 1/5 = 0.2 are terminating expansions. See also comments in A051626 and A284602.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local m;
      m:= n/2^padic:-ordp(n,2);
      m:= m/5^padic:-ordp(m,5);
      m > 1 and numtheory:-order(10,m)::odd
    end proc:
    select(filter, [$1..1000]); # Robert Israel, Apr 03 2017
  • Mathematica
    Select[Range[215], Mod[Length[RealDigits[1/#][[1, -1]]], 2] == 1 & ]

A298980 Numbers n such that there exists an integer k < n for which the significant decimal digits of k/n (i.e., neglecting leading zeros) are those of n.

Original entry on oeis.org

3, 6, 7, 8, 10, 14, 17, 20, 22, 26, 28, 30, 33, 36, 37, 40, 41, 42, 50, 57, 58, 59, 60, 62, 63, 64, 66, 67, 69, 70, 71, 72, 73, 74, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 100, 114, 118, 122, 126, 130, 134, 141, 148, 158, 161, 164, 167, 170, 173, 176, 184, 187
Offset: 1

Views

Author

Keywords

Comments

Otherwise said, floor(10^m*k/n) = n for some k and m.
Also, numbers n which have n as a subsequence in the decimal expansion of k/n, 0 < k < n.
Initially it appears that if n is present so is 10n and 11n. These two statements are false. 14 is present but 140 is not. 1/140 = 0.00714285... 17 is present but 187 is not.
However if there is a k between 0 and n so that gcd(k,n) = r > 1 and k/r is used to show that n/r is a term, then so is n. As an example, 33 is a term since 11/33 = 1/3 and 3 is a term. See the first example.
The density of numbers in this sequence appears to increase to above 55% near n ~ 10^9. See A298981 for the complement and A298982 for the k-values.

Examples

			3 is a term since 1/3 = 0.3333... and its fractional part begins with 3;
6 is a term since 10/6 = 1.666... and its fractional part begins with 6;
7 is a term since 5/7 = 0.714285... and its fractional part begins with 7;
8 is a term since 7/8 = 0.87500... and its fractional part begins with 8;
10 is a term since 1/10 = 0.1000... and its fractional part begins with 10;
14 is a term since 2/14 = 0.142857... and its fractional part begins with 14;
17 is a term since 3/17 = 0.17647058823... and its fractional part begins with 17; etc.
		

Crossrefs

Inspired by and equal to the range (= sorted terms) of A298232.
Complement of A298981.

Programs

  • Mathematica
    fQ = Compile[{{n, _Integer}}, Block[{k = 1, il = IntegerLength@ n}, While[m = 10^il*k/n; While[ IntegerLength@ Floor@ m < il, m *= 10]; k < n && Floor[m] != n, k++]; k < n]]; Select[Range@200, fQ]
  • PARI
    is_A298980(n,k=(n^2-1)\10^(logint(n,10)+1)+1)={k*10^(logint((n^2-(n>1))\k,10)+1)\n==n} \\ Or use A298982 to get the k-value if n is in this sequence or 0 otherwise. \\ M. F. Hasler, Feb 01 2018

A298981 Numbers m such that there does not exist an integer k < m for which the initial decimal digits of k/m are m.

Original entry on oeis.org

1, 2, 4, 5, 9, 11, 12, 13, 15, 16, 18, 19, 21, 23, 24, 25, 27, 29, 31, 32, 34, 35, 38, 39, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54, 55, 56, 61, 65, 68, 75, 99, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 115, 116, 117, 119, 120, 121, 123, 124, 125, 127, 128, 129, 131, 132, 133, 135, 136, 137, 138, 139
Offset: 1

Views

Author

Keywords

Comments

Inspired by A298232.

Examples

			2 is in the sequence since there is no k such that k/2 would result in a decimal number which begins with 2, i.e., 0.2000. Instead, the decimal number for odd k's begin with 0.5.
		

Crossrefs

Programs

  • Mathematica
    fQ = Compile[{{n, _Integer}}, Block[{k = 1, il = IntegerLength@ n}, While[m = 10^il*k/n; While[ IntegerLength@ Floor@ m < il, m *= 10]; k < n && Floor[m] != n, k++]; k == n]]; Select[Range@140, fQ]
  • PARI
    is_A298981(n)=!A298982(n)

Formula

Complement of A298980.

A000976 Period of 1/n! in base 10.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 6, 6, 18, 18, 18, 54, 54, 378, 1134, 1134, 9072, 81648, 81648, 81648, 1714608, 18860688, 18860688, 56582064, 56582064, 735566832, 19860304464, 139022131248, 139022131248, 417066393744, 2085331968720, 2085331968720, 68815954967760
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Join[{0, 0}, Table[num = n!/(2^IntegerExponent[n!, 2] * 5^IntegerExponent[n!, 5]); MultiplicativeOrder[10, num], {n, 3, 30}]] (* T. D. Noe, Jun 21 2012 *)
  • PARI
    a(n) = if(n <= 2, return(0)); znorder(Mod(10,n!/2^val(n,2)/5^val(n,5)))
    val(n, p) = my(r=0); while(n, r+=n\=p); r \\ David A. Corneth, Jan 11 2023

Formula

a(n) = k where k is the smallest integer >= 1 such that 10^k == 1 (mod n!/(2^A011371(n)*5^A027868(n))) where A011371(n) is the highest power of 2 dividing n! and A027868(n) is the largest k such that 5^k | n!. - C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 16 2004, corrected by David A. Corneth, Jan 11 2023
a(n) = order(10, n!/(2^s*5^t)) where 2^s is largest power of 2 dividing n! and 5^t is largest power of 5 dividing n!. - Sean A. Irvine, Sep 29 2011
a(n) = A051626(A000142(n)). - Michel Marcus, Jan 12 2023

Extensions

One more term from Sean A. Irvine, Sep 28 2011

A132726 Triangle read by rows: T(n,k) = length of period in decimal representation of k/n, 1<=k<=n.

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, 6, 6, 6, 6, 6, 6, 0, 6, 6, 6, 6, 6, 6, 0
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 27 2007

Keywords

Comments

T(n,1) = A051626(n); T(n,n) = 0;
T(n,k) = T(1,k/A050873(n,k));
T(n,k) = T(n,A132740(k)), 1<=k<=n;
T(A003592(n),k) = 0, 1<=k<=A003592(n).
Previous Showing 11-20 of 39 results. Next