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

A173394 Positions of powers of 2 in A084680.

Original entry on oeis.org

1, 3, 9, 11, 17, 33, 51, 73, 99, 101, 137, 153, 187, 219, 257, 303, 353, 411, 449, 561, 641, 657, 771, 803, 909, 1059, 1111, 1233, 1241, 1347, 1409, 1507, 1683, 1717, 1923, 2313, 2329, 2409, 2827, 3177, 3333, 3723, 3883, 4041, 4227, 4369, 4521, 4939
Offset: 1

Views

Author

Michel Lagneau, Feb 17 2010

Keywords

Comments

The n where the decimal expansion of 1/n has a period length which is a power of 2.

Examples

			Period of 1/3 = 1. Period of 1/9 = 2. Period of 1/73 = 8. Period of 1/353 = 32.
		

References

  • J. W. L. Glaisher, On circulating decimals, Proc. Camb. Phil. Soc., 3 (1878), 185-206.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, pp. 7-12.

Crossrefs

Cf. A002329.

Programs

  • Maple
    A084680 := proc(n) if gcd(n,10) <> 1 then 0 ; elif n = 1 then 1 ; else numtheory[order](10,n) ; end if; end proc:
    isA000079 := proc(n) if n = 1 then true; elif n >=1 then numtheory[factorset](n) = {2} ; else false; end if; end proc:
    for n from 1 to 5000 do if isA000079(A084680(n)) then printf("%d,",n) ; end if; end do: # R. J. Mathar, Mar 10 2010

Formula

{n: A084680(n) in A000079}.

Extensions

Missing numbers -those where A084680(n)>1000- inserted - R. J. Mathar, Mar 10 2010

A007732 Period of decimal representation of 1/n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 2, 1, 6, 6, 1, 1, 16, 1, 18, 1, 6, 2, 22, 1, 1, 6, 3, 6, 28, 1, 15, 1, 2, 16, 6, 1, 3, 18, 6, 1, 5, 6, 21, 2, 1, 22, 46, 1, 42, 1, 16, 6, 13, 3, 2, 6, 18, 28, 58, 1, 60, 15, 6, 1, 6, 2, 33, 16, 22, 6, 35, 1, 8, 3, 1, 18, 6, 6, 13, 1, 9, 5, 41, 6, 16, 21, 28, 2, 44, 1
Offset: 1

Views

Author

N. J. A. Sloane, Hal Sampson [ hals(AT)easynet.com ]

Keywords

Comments

Appears to be a divisor of A007733*A007736. - Henry Bottomley, Dec 20 2001
Primes p such that a(p) = p-1 are in A001913. - Dmitry Kamenetsky, Nov 13 2008
When 1/n has a finite decimal expansion (namely, when n = 2^a*5^b), a(n) = 1 while A051626(n) = 0. - M. F. Hasler, Dec 14 2015
a(n.n) >= a(n) where n.n is A020338(n). - Davide Rotondo, Jun 13 2024

References

  • J. H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, NY, 1996, pp. 159 etc.

Crossrefs

Programs

  • Maple
    A007732 := proc(n)
        a132740 := 1 ;
        for pe in ifactors(n)[2] do
            if not op(1,pe) in {2,5} then
                a132740 := a132740*op(1,pe)^op(2,pe) ;
            end if;
        end do:
        if a132740 = 1 then
            1 ;
        else
            numtheory[order](10,a132740) ;
        end if;
    end proc:
    seq(A007732(n),n=1..50) ; # R. J. Mathar, May 05 2023
  • Mathematica
    Table[r = n/2^IntegerExponent[n, 2]/5^IntegerExponent[n, 5]; MultiplicativeOrder[10, r], {n, 100}] (* T. D. Noe, Oct 17 2012 *)
  • PARI
    a(n)=znorder(Mod(10,n/2^valuation(n,2)/5^valuation(n,5))) \\ Charles R Greathouse IV, Jan 14 2013
    
  • Python
    from sympy import n_order, multiplicity
    def A007732(n): return n_order(10,n//2**multiplicity(2,n)//5**multiplicity(5,n)) # Chai Wah Wu, Feb 07 2022
  • Sage
    def a(n):
        n = ZZ(n)
        rad = 2**n.valuation(2) * 5**n.valuation(5)
        return Zmod(n // rad)(10).multiplicative_order()
    [a(n) for n in range(1, 20)]
    # F. Chapoton, May 03 2020
    

Formula

Note that if n=r*s where r is a power of 2 and s is odd then a(n)=a(s). Also if n=r*s where r is a power of 5 and s is not divisible by 5 then a(n) = a(s). So we just need a(n) for n not divisible by 2 or 5. This is the smallest number m such that n divides 10^m - 1; m is a divisor of phi(n), where phi = A000010.
phi(n) = n-1 only if n is prime and since a(n) divides phi(n), a(n) can only equal n-1 if n is prime. - Scott Hemphill (hemphill(AT)alumni.caltech.edu), Nov 23 2006
a(n)=a(A132740(n)); a(A132741(n))=a(A003592(n))=1. - Reinhard Zumkeller, Aug 27 2007

Extensions

More terms from James Sellers, Feb 05 2000

A002329 Periods of reciprocals of integers prime to 10.

Original entry on oeis.org

1, 1, 6, 1, 2, 6, 16, 18, 6, 22, 3, 28, 15, 2, 3, 6, 5, 21, 46, 42, 16, 13, 18, 58, 60, 6, 33, 22, 35, 8, 6, 13, 9, 41, 28, 44, 6, 15, 96, 2, 4, 34, 53, 108, 3, 112, 6, 48, 22, 5, 42, 21, 130, 18, 8, 46, 46, 6, 42, 148, 75, 16, 78, 13, 66, 81, 166, 78, 18, 43
Offset: 1

Views

Author

Keywords

Comments

Nonzero terms of A084680.

References

  • J. W. L. Glaisher, On circulating decimals, Proc. Camb. Phil. Soc., 3 (1878), 185-206.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, pp. 7-12.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    Reap[ Do[ If[ CoprimeQ[n, 10], Sow[ MultiplicativeOrder[10, n]]], {n, 1, 150}]][[2, 1]] (* Jean-François Alcover, Nov 07 2012 *)
  • PARI
    do(lim)=my(v=List()); for(n=1, lim, if(gcd(n, 10)==1, listput(v, znorder(Mod(10,n))))); Vec(v) \\ Charles R Greathouse IV, Jun 21 2017

Formula

a(n) = A084680(A045572(n)). - Jianing Song, Jun 15 2021

Extensions

a(1) = 1 inserted by Jinyuan Wang, Jun 14 2021

A276348 a(n) = the smallest number k such that k*n is a number with a string of 1's followed by a string of 0's.

Original entry on oeis.org

10, 5, 370, 25, 2, 185, 158730, 125, 123456790, 1, 10, 925, 85470, 79365, 74, 625, 653594771241830, 61728395, 58479532163742690, 5, 52910, 5, 483091787439613526570, 4625, 4, 42735, 41152263374485596707818930, 396825, 383141762452107279693486590, 37
Offset: 1

Views

Author

Jaroslav Krizek, Aug 30 2016

Keywords

Comments

a(n) = the smallest number k such that k*n is a number from A276349.
a(n) > 0 for all n.

Examples

			For n=3; 3*370 = 1110 (term of A276349).
		

References

  • L. Pick, Dirichletovy šuplíčky. Pokroky matematiky, fyziky & astronomie; 2 (2016), 106-118. (In Czech; The Dirichlet pigeonhole principle)

Crossrefs

Programs

  • Magma
    a:=10; S:=[a]; for n in [2..6] do k:=0; flag:= true; while flag do k+:=1; if [k*n] subset [n: n in [1..10000] | Seqint(Setseq(Set(Sort(Intseq(n))))) eq 10 and Seqint(Sort((Intseq(n)))) eq n] then Append(~S, k); a:=k; flag:=false; end if; end while; end for; S;
  • Maple
    f:= proc(n) local b,c,d,m,q;
        b:= padic:-ordp(n,2); c:= padic:-ordp(n,5); if b+c=0 then d:= 1 else d:= max(b,c) fi; m:= n/2^b/5^c; q:= numtheory:-order(10,9*m);
         2^(d-b)*5^(d-c)*(10^q-1)/(9*m)
    end proc:
    map(f, [$1..100]); # Robert Israel, Aug 30 2016
  • Mathematica
    Table[k = 1; While[! If[Length@ # == 2, Flatten@ Map[Union, #] == {1, 0}, False] &@ Split@ IntegerDigits[k n], k++]; k, {n, 8}] (* Michael De Vlieger, Aug 30 2016 *)

Formula

a(n) = A052983(n)/n.
From Robert Israel, Aug 30 2016: (Start)
Let n = 2^b*5^c*m where GCD(m,10)=1, and q = A084680(9*m).
If b=c=0 let d=1, otherwise d=max(b,c).
Then a(n) = 2^(d-a)*5^(d-b)*(10^q-1)/(9*m). (End)

A084681 Order of 10 modulo 9n [i.e., least m such that 10^m = 1 (mod 9n)] or 0 when no such number exists.

Original entry on oeis.org

1, 0, 3, 0, 0, 0, 6, 0, 9, 0, 2, 0, 6, 0, 0, 0, 16, 0, 18, 0, 6, 0, 22, 0, 0, 0, 27, 0, 28, 0, 15, 0, 6, 0, 0, 0, 3, 0, 6, 0, 5, 0, 21, 0, 0, 0, 46, 0, 42, 0, 48, 0, 13, 0, 0, 0, 18, 0, 58, 0, 60, 0, 18, 0, 0, 0, 33, 0, 66, 0, 35, 0, 8, 0, 0, 0, 6, 0, 13, 0, 81, 0, 41, 0, 0, 0, 84, 0, 44, 0, 6, 0, 15, 0
Offset: 1

Views

Author

Lekraj Beedassy, Jun 30 2003

Keywords

Crossrefs

Programs

  • GAP
    List([1..100],n->OrderMod(10,9*n)); # Muniru A Asiru, Feb 26 2019
  • Maple
    f:= proc(n)
    if igcd(n,10)>1 then 0 else numtheory:-order(10,9*n) fi
    end proc:
    map(f, [$1..100]); # Robert Israel, Feb 22 2019
  • Mathematica
    a[n_] := If[GCD[10, 9n] != 1, 0, MultiplicativeOrder[10, 9n]];
    Array[a, 100] (* Jean-François Alcover, Jul 19 2020 *)
  • PARI
    a(n) = if (gcd(10, 9*n) != 1, 0, znorder(Mod(10, 9*n))); \\ Michel Marcus, Feb 23 2019
    

Formula

From Robert Israel, Feb 22 2019: (Start)
a(n) = A084680(9*n).
If n is not divisible by 3, a(n) = A084680(n).
Otherwise a(n) can be either A084680(n), 3*A084680(n) or 9*A084680(n). (End)

Extensions

More terms from John W. Layman, Oct 09 2003

A087094 a(n) = smallest k such that (10^k-1)/9 == 0 mod prime(n)^2, or 0 if no such k exists.

Original entry on oeis.org

0, 9, 0, 42, 22, 78, 272, 342, 506, 812, 465, 111, 205, 903, 2162, 689, 3422, 3660, 2211, 2485, 584, 1027, 3403, 3916, 9312, 404, 3502, 5671, 11772, 12656, 5334, 17030, 1096, 6394, 22052, 11325, 12246, 13203, 27722, 7439, 31862, 32580, 18145, 37056, 19306
Offset: 1

Views

Author

Ray Chandler, Aug 10 2003

Keywords

Comments

For a given a(n)>0, all of the values of k such that (10^k-1)/9=0 mod prime(n)^2 is given by the sequence a(n)*A000027, i.e. integral multiples of a(n). For example, for n=2, prime(2)=3, a(n)=9, the set of values of k for which (10^k-1)/9=0 mod 3^2 is 9*A000027=9,18,27,36,45,...
The union of the collection of sequences formed from the nonzero terms of a(n)*A000027, gives the values of k for which (10^k-1)/9 is not squarefree, see A046412. All of terms of the sequence a(n) are integer multiples of prime(n) for primes <1000 except for a(93)=486 where prime(93)=487. Conjecture: there are no 0 terms after a(3).
That conjecture is easily proved, for a(n) is just the multiplicative order of 10 modulo (prime(n))^2 for n>3. - Jeppe Stig Nielsen, Dec 28 2015

Examples

			a(2)=9 since 9 is least value of k for which (10^k-1)/9=0 mod 3^2.
		

Crossrefs

Programs

  • Maple
    0,9,0,seq(numtheory:-order(10,ithprime(i)^2), i=4..100); # Robert Israel, Dec 30 2015
  • PARI
    a(n)=p=prime(n);10%p==0 && return(0);for(k=1,p^2,((10^k-1)/9) % p^2 == 0 && return(k));error() \\ Jeppe Stig Nielsen, Dec 28 2015
    
  • PARI
    a(n)=p=prime(n);if(10%p==0, 0, 10%p==1, 9, znorder(Mod(10,p^2))) \\ Jeppe Stig Nielsen, Dec 28 2015

Formula

For n>3, a(n) = A084680(prime(n)^2) = A084680(A001248(n)), Jeppe Stig Nielsen, Dec 28 2015

A216415 a(n) = smallest positive m such that 2n-1 | 10^m-1, or 0 if no such m exists.

Original entry on oeis.org

1, 1, 0, 6, 1, 2, 6, 0, 16, 18, 6, 22, 0, 3, 28, 15, 2, 0, 3, 6, 5, 21, 0, 46, 42, 16, 13, 0, 18, 58, 60, 6, 0, 33, 22, 35, 8, 0, 6, 13, 9, 41, 0, 28, 44, 6, 15, 0, 96, 2, 4, 34, 0, 53, 108, 3, 112, 0, 6, 48, 22, 5, 0, 42, 21, 130, 18, 0, 8, 46, 46, 6, 0, 42, 148, 75, 16, 0, 78, 13, 66, 81, 0, 166, 78, 18, 43, 0, 58, 178, 180, 60, 0, 16, 6, 95, 192, 0, 98, 99
Offset: 1

Views

Author

V. Raman, Sep 07 2012

Keywords

Comments

This is yet another version of the sequences defined in A002329, A007732, A070682, A084680. - N. J. A. Sloane, Sep 08 2012
a(n) gives the multiplicative order of 10 mod (2n-1), if it is finite, or 0 if not defined.

Crossrefs

Programs

  • PARI
    for(i=0,200,i++;if(i%5==0,print1(0","),print1(znorder(Mod(10,i))","))) \\ V. Raman, Nov 22 2012
    
  • PARI
    for(i=0,200,i++;m=0;for(x=1,i,if(((10^x-1))%i==0,m=x;break));print1(m",")) \\ V. Raman, Nov 22 2012

A226477 Table (read by rows) of the natural numbers (in ascending order) whose reciprocals have only periodic decimals of length k.

Original entry on oeis.org

1, 3, 9, 11, 33, 99, 27, 37, 111, 333, 999, 101, 303, 909, 1111, 3333, 9999, 41, 123, 271, 369, 813, 2439, 11111, 33333, 99999, 7, 13, 21, 39, 63, 77, 91, 117, 143, 189, 231, 259, 273, 297, 351, 407, 429, 481, 693, 777, 819, 1001, 1221, 1287, 1443, 2079, 2331, 2457, 2849, 3003, 3367, 3663, 3861, 4329, 5291, 6993, 8547, 9009, 10101, 10989, 12987, 15873, 25641, 27027, 30303, 37037, 47619, 76923, 90909, 111111, 142857, 333333, 999999
Offset: 1

Views

Author

Martin Renner, Jun 08 2013

Keywords

Comments

The k-th row always ends with 10^k - 1 = 99..99 (k times 9).
The number of elements in row k is A059892(k).

Examples

			The table T(k,m), m = 1..A059892(k), begins
  1, 3, 9;
  11, 33, 99;
  27, 37, 111, 333, 999;
  etc.
		

Crossrefs

Programs

  • Maple
    a:=[1,3,9]: S:={1,3,9}: for k from 2 to 6 do T:=numtheory[divisors](10^k-1): a:=[op(a),op(T minus S)]: S:=S union T; od: a;
  • PARI
    Row(n) = my(v=divisors(10^n-1)); select(x->(znorder(Mod(10,x))==n), v) \\ Jianing Song, Jun 15 2021

A178495 Numbers k whose sum of digits equals the period of 1/k.

Original entry on oeis.org

1, 11, 41, 81, 111, 187, 231, 451, 567, 891, 1111, 1197, 1221, 1539, 1717, 1881, 2329, 2877, 3003, 3591, 3813, 4551, 4773, 5643, 6237, 6327, 7371, 8991, 9399, 9449, 10773, 11111, 11583, 13167, 13651, 15561, 16863, 17589, 23331, 24453, 27371, 39501
Offset: 1

Views

Author

Michel Lagneau, May 28 2010

Keywords

Examples

			11 is in the sequence because 1 + 1 = 2 and 1/11 = 0.09 09 09... with period 2.
41 is in the sequence because 4 + 1 = 5 and 1/41 = 0.02439 02439 ... with period 5.
		

References

  • J. W. L. Glaisher, On circulating decimals, Proc. Camb. Phil. Soc., 3 (1878), pp. 185-206.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, pp. 7-12.

Crossrefs

Programs

  • Maple
    with(numtheory): nn:= 2343: T:=array(1..nn): U:=array(1..nn): X:=array(1..nn): Y:=array(1..nn):k:=1:for n from 2 to 999999 do:for p from 1 to 55 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 T[k]:=n : U[k]:=p: k:=k+1:else fi:od: for n from 1 to nn do:p1:= T[n]: l:=length(p1):n0:=p1:s:=0:for m from 1 to l do:q:=n0:u:=irem(q,10):v:=iquo(q,10):n0:=v :s:=s+u:od: X[n]:=s: od: for n from 1 to nn do:if X[n]= U[n] then printf(`%d, `, T[n]):else fi:od:

Formula

{k: A084680(k) = A007953(k)}. - R. J. Mathar, Jun 07 2010

A335012 Number of different remainders when the first n terms of 1, 11, 111, 1111, ... are divided by n.

Original entry on oeis.org

1, 1, 3, 2, 1, 3, 6, 3, 9, 1, 2, 4, 6, 6, 3, 4, 16, 9, 18, 2, 6, 2, 22, 5, 2, 6, 27, 7, 28, 3, 15, 5, 6, 16, 6, 10, 3, 18, 6, 3, 5, 6, 21, 3, 9, 22, 46, 6, 42, 2, 48, 7, 13, 27, 2, 8, 18, 28, 58, 4, 60, 15, 18, 6, 6, 6, 33, 17, 66, 6, 35, 11, 8, 3, 4, 19, 6, 6, 13, 4, 81
Offset: 1

Views

Author

Sen-Peng Eu, May 19 2020

Keywords

Comments

a(n) = n if and only if n is a power of 3.
Conjecture: a(n) = n-1 if and only if n is a long period prime (A006883), that is, n is a prime and the decimal expansion of 1/n has period n-1.
If gcd(n,30) = 1 then a(n) = A084680(n). - Robert Israel, Jun 25 2020

Examples

			a(4) = 2 since when 1, 11, 111, 1111 are divided by 4 the remainders are 1, 3, 3, 3, two different numbers.
a(6) = 3 since when 1, 11, 111, 1111, 11111, 111111 are divided by 6 the remainders are 1, 5, 3, 1, 5, 3, three different numbers.
		

Crossrefs

Programs

  • Maple
    with(ListTools): a := proc (n) return add(10^i, i = 0 .. n-1) end proc: r := proc (n) return seq(`mod`(a(i), n), i = 1 .. n) end proc: seq(nops(MakeUnique([r(n)])), n = 1 .. 243);
    # Simpler:
    f:= n -> nops({seq(((10^i-1)/9) mod n,i=1..n)}):
    map(f, [$1..100]); # Robert Israel, Jun 25 2020
  • Mathematica
    Table[Length@ Union@ Array[Mod[(10^# - 1)/9, n] &, n], {n, 81}] (* Michael De Vlieger, Jun 28 2020 *)
  • PARI
    a(n) = #Set(vector(n, k, (10^k-1)/9) % n); \\ Michel Marcus, Jun 15 2020
Showing 1-10 of 11 results. Next