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-8 of 8 results.

A000689 Final decimal digit of 2^n.

Original entry on oeis.org

1, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6
Offset: 0

Views

Author

Keywords

Comments

These are the analogs of the powers of 2 in carryless arithmetic mod 10.
Let G = {2,4,8,6}. Let o be defined as XoY = least significant digit in XY. Then (G,o) is an Abelian group wherein 2 is a generator (also see the first comment under A001148). - K.V.Iyer, Mar 12 2010
This is also the decimal expansion of 227/1818. - Kritsada Moomuang, Dec 21 2021

Examples

			G.f. = 1 + 2*x + 4*x^2 + 8*x^3 + 6*x^4 + 2*x^5 + 4*x^6 + 8*x^7 + 6*x^8 + ...
		

Crossrefs

Programs

  • Haskell
    a000689 n = a000689_list !! n
    a000689_list = 1 : cycle [2,4,8,6]  -- Reinhard Zumkeller, Sep 15 2011
  • Magma
    [2^n mod 10: n in [0..150]]; // Vincenzo Librandi, Apr 12 2011
    
  • Mathematica
    Table[PowerMod[2, n, 10], {n, 0, 200}] (* Vladimir Joseph Stephan Orlovsky, Jun 10 2011 *)
  • PARI
    for(n=0,80, if(n,{x=(n+3)%4+1; print1(10-(4*x^3+47*x-27*x^2)/3,", ")},{print1("1, ")}))
    
  • SageMath
    [power_mod(2,n,10)for n in range(0, 81)] # Zerinvary Lajos, Nov 03 2009
    

Formula

Periodic with period 4.
a(n) = 2^n mod 10.
a(n) = A002081(n) - A002081(n-1), for n > 0.
From R. J. Mathar, Apr 13 2010: (Start)
a(n) = a(n-1) - a(n-2) + a(n-3), n > 3.
G.f.: (x+3*x^2+5*x^3+1)/((1-x) * (1+x^2)). (End)
For n >= 1, a(n) = 10 - (4x^3 + 47x - 27x^2)/3, where x = (n+3) mod 4 + 1.
For n >= 1, a(n) = A070402(n) + 5*floor( ((n-1) mod 4)/2 ).
G.f.: 1 / (1 - 2*x / (1 + 5*x^3 / (1 + x / (1 - 3*x / (1 + 3*x))))). - Michael Somos, May 12 2012
a(n) = 5 + cos((n*Pi)/2) - 3*sin((n*Pi)/2) for n >= 1. - Kritsada Moomuang, Dec 21 2021

A070402 a(n) = 2^n mod 5.

Original entry on oeis.org

1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1
Offset: 0

Views

Author

N. J. A. Sloane, May 12 2002

Keywords

Comments

Periodic with period 4: [1, 2, 4, 3]. - Washington Bomfim, Nov 23 2010

Crossrefs

Cf. A173635.

Programs

  • GAP
    List([0..83],n->PowerMod(2,n,5)); # Muniru A Asiru, Feb 01 2019
  • Magma
    [Modexp(2, n, 5): n in [0..100]]; // Bruno Berselli, Mar 23 2016
    
  • Maple
    A070402 := proc(n) op((n mod 4)+1,[1,2,4,3]) ; end proc: # R. J. Mathar, Feb 05 2011
  • Mathematica
    PadRight[{}, 100, {1, 2, 4, 3}] (* or *) CoefficientList[Series[(1 + 2 x + 4 x^2 + 3 x^3) / (1 - x^4), {x, 0, 100}], x] (* Vincenzo Librandi, Mar 25 2016 *)
    PowerMod[2,Range[0,120],5] (* Harvey P. Dale, Sep 16 2020 *)
  • PARI
    for(n=0, 80, x=n%4; print1(1 + (15*x^2 -5*x -4*x^3)/6, ", ")) \\ Washington Bomfim, Nov 23 2010
    
  • Sage
    [power_mod(2,n,5) for n in range(0, 105)] # Zerinvary Lajos, Jun 08 2009
    

Formula

From R. J. Mathar, Apr 13 2010: (Start)
a(n) = a(n-1) - a(n-2) + a(n-3).
G.f.: (1 + x + 3*x^2) / ((1-x)*(1+x^2)). (End)
From Washington Bomfim, Nov 23 2010: (Start)
a(n) = 1 + (15*r^2 - 5*r - 4*r^3)/6, where r = n mod 4.
a(n) = A000689(n) - 5*floor(((n-1) mod 4)/2) for n>0. (End)
E.g.f.: (1/2)*(5*exp(x) - 3*cos(x) - sin(x)). - G. C. Greubel, Mar 19 2016

A220022 The period with which the powers of n repeat mod 100.

Original entry on oeis.org

1, 1, 20, 20, 10, 1, 5, 4, 20, 10, 1, 10, 20, 20, 10, 2, 5, 20, 4, 10, 1, 5, 20, 20, 2, 1, 1, 20, 20, 10, 1, 10, 4, 20, 10, 2, 5, 20, 20, 10, 1, 5, 20, 4, 10, 1, 5, 20, 20, 2, 1, 2, 20, 20, 10, 2, 5, 4, 20, 10, 1, 5, 20, 20, 10, 1, 5, 20, 4, 10, 1, 10, 20, 20, 2, 2, 1
Offset: 0

Views

Author

V. Raman, Dec 13 2012

Keywords

Comments

a(n) will always be a divisor of Phi(100) = 40.
This sequence is periodic with a period of 100 because n^i mod 100 = (n + 100)^i mod 100.
For the odd numbers n ending in {1, 3, 7, 9} which are coprime to 10, we can expect the powers of n mod 100 to loop back to 1, with the value of n^a(n) mod 100 = 1, but for the other numbers n that are not coprime to 10, they do not loop back to 1.
For the even numbers n ending in {2, 4, 6, 8}, the value of n^a(n) mod 100 will be equal to 76.
For the numbers n that are congruent to 5 (mod 20), the value of n^i mod 100 will be equal to 25, for all i >= 2.
For the numbers n that are congruent to 15 (mod 20), the value of n^a(n) mod 100 will be equal to 25, with n^i mod 100 = 25 for the even values of i and n^i mod 100 = 75 for the odd values of i, for all i >= 2.
For the numbers n ending in 0, i.e., that are congruent to 0 (mod 10), the value of n^i mod 100 will be equal to 0, for all i >= 2.

Examples

			a(2) = 20 since 2^i mod 100, for i = 2..22 = {04, 08, 16, 32, 64, 28, 56, 12, 24, 48, 96, 92, 84, 68, 36, 72, 44, 88, 76, 52, 04}.
a(3) = 20 since 3^i mod 100, for i = 0..20 = {01, 03, 09, 27, 81, 43, 29, 87, 61, 83, 49, 47, 41, 23, 69, 07, 21, 63, 89, 67, 01}.
But a(7) = 4 since 7^i mod 100, for i = 0..4 = {01, 07, 49, 43, 01}.
		

Crossrefs

Cf. A173635 (period with which the powers of n repeat mod 10).

Programs

  • Mathematica
    Flatten[Table[s = Table[PowerMod[n, e, 100], {e, 2, 100}]; Union[Differences[Position[s, s[[1]]]]], {n, 0, 100}]] (* T. D. Noe, Dec 14 2012 *)
  • PARI
    for(n=0, 100, x=(n*n)%100; y=(n*n*n)%100; z=1; while(x!=y, x=(x*n)%100; y=(y*n*n)%100; z++); print1(z", "))

A220468 Number of cyclotomic cosets of n mod 10.

Original entry on oeis.org

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

Views

Author

V. Raman, Jan 03 2013

Keywords

Comments

In other words, number of different cycles mod 10 obtained by repeatedly multiplying by n, with different starting elements. There are four different cycles for n = 3: {1, 3, 9, 7}, {2, 6, 8, 4}, {5}, {0}. By starting with a random number below 10, the numbers obtained by repeatedly multiplying by 3 and then taking modulo 10 repeat through one of these four different cycles.
There are two different cycles for n = 2: {2, 4, 8, 6}, {0}. Note that this does not cover all the positive integers less than 10. The elements 1, 3, 7, 9 belong to the cycle {2, 4, 8, 6} since on starting with them, the numbers obtained by the process of repeatedly multiplying by 2 and then taking modulo 10 repeat through the elements of this cycle. Likewise the element 5 belongs to the cycle {0}. For n coprime to 10, the different cycles will cover all the elements less than 10 and will form different equivalence classes by themselves. For other values of n, the cycles will not cover all the elements less than 10.
This sequence is periodic with period of 10, since x^i == (x + 10)^i mod 10.

Examples

			The following are the different cycles obtained by repeatedly multiplying by n, and then taking mod 10, with different starting elements.
n = 0: {0}.
n = 1: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}.
n = 2: {2, 4, 8, 6}, {0}.
n = 3: {1, 3, 9, 7}, {2, 6, 8, 4}, {5}, {0}.
n = 4: {4, 6}, {2, 8}, {0}.
n = 5: {5}, {0}.
n = 6: {2}, {4}, {6}, {8}, {0}.
n = 7: {1, 7, 9, 3}, {2, 4, 8, 6}, {5}, {0}.
n = 8: {8, 4, 2, 6}, {0}.
n = 9: {1, 9}, {3, 7}, {2, 8}, {4, 6}, {5}, {0}.
		

Crossrefs

Programs

  • Mathematica
    iter[n_] := Table[ FixedPoint[ Union[#, Mod[n*#, 10]] &, {m}], {m, 0, 9}]; classes[n_] := iter[n] //. {a___List, b_List, c___List, d_List, e___List} /; Intersection[b, d] != {} :> {a, Union[b, d], c, e}; a[n_] := Length[classes[n]]; Table[a[n], {n, 0, 89}] (* Jean-François Alcover, Jan 08 2013 *)
  • PARI
    k=10; j=1; for(i=0, 100, m=0; n=vector(k, X, -1); for(l=0, k-1, if(n[((l*i^j)%k)+1]>=0, n[l+1]=n[((l*i^j)%k)+1]; continue, n[l+1]=m; p=l; for(o=1, eulerphi(k), p=(p*i)%k; if(n[p+1]>-1, break); n[p+1]=m); m++)); print1(m", "))
    
  • PARI
    a(n)=[1, 10, 2, 4, 3, 2, 5, 4, 2, 6][n%10+1] \\ Charles R Greathouse IV, Jan 08 2013

Formula

G.f.: -(6*x^9+2*x^8+4*x^7+5*x^6+2*x^5+3*x^4+4*x^3+2*x^2+10*x+1) / (x^10-1). - Colin Barker, Apr 13 2013

A220026 The period with which the powers of n repeat mod 1000000.

Original entry on oeis.org

1, 1, 12500, 50000, 6250, 16, 3125, 5000, 12500, 25000, 1, 50000, 12500, 50000, 6250, 4, 3125, 12500, 2500, 50000, 1, 50000, 12500, 25000, 1250, 8, 625, 50000, 12500, 50000, 1, 6250, 2500, 12500, 6250, 16, 3125, 50000, 12500, 25000, 1, 25000, 12500, 10000, 6250
Offset: 0

Views

Author

V. Raman, Dec 15 2012

Keywords

Comments

a(n) will always be a divisor of Phi(1000000) = 400000.
This sequence is periodic with a period of 1000000 because n^i mod 1000000 = (n + 1000000)^i mod 1000000.
For the odd numbers n ending in {1, 3, 7, 9} which are coprime to 10, we can expect the powers of n mod 1000000 to loop back to 1, with the value of n^a(n) mod 1000000 = 1, but for the other numbers n that are not coprime to 10, they do not loop back to 1.
For the even numbers n ending in {2, 4, 6, 8}, n^a(n) mod 1000000 = 109376.
For the numbers n ending in 5, n^(16*i) mod 1000000 = 890625, for all i >= 1.
For the numbers n ending in 0, n^i mod 1000000 = 0, for all i >= 6.

Examples

			a(2) = 12500 since 2^i mod 1000000 = 2^(i + 12500) mod 1000000, for all i >= 6.
a(3) = 50000 since 3^i mod 1000000 = 3^(i + 50000) mod 1000000, for all i >= 0.
But a(7) = 5000 since 7^i mod 1000000 = 7^(i + 5000) mod 1000000, for all i >= 0.
		

Crossrefs

Cf. A173635 (period with which the powers of n repeat mod 10).
Cf. A220022 (period with which the powers of n repeat mod 100).

Programs

  • Mathematica
    Flatten[Table[s = Table[PowerMod[n, e, 1000000], {e, 2, 1000000}]; Union[Differences[Position[s, s[[5]]]]], {n, 0, 40}]] (* Vincenzo Librandi, Jan 26 2013 *)
  • PARI
    k=1000000; for(n=0, 100, x=(n^6)%k; y=(n^7)%k; z=1; while(x!=y, x=(x*n)%k; y=(y*n*n)%k; z++); print1(z", "))

A220023 The period with which the powers of n repeat mod 1000.

Original entry on oeis.org

1, 1, 100, 100, 50, 2, 25, 20, 100, 50, 1, 50, 100, 100, 50, 2, 25, 100, 20, 50, 1, 50, 100, 100, 10, 1, 5, 100, 100, 50, 1, 50, 20, 100, 50, 2, 25, 100, 100, 50, 1, 25, 100, 20, 50, 2, 25, 100, 100, 10, 1, 10, 100, 100, 50, 2, 25, 4, 100, 50, 1, 50, 100, 100
Offset: 0

Views

Author

V. Raman, Dec 15 2012

Keywords

Comments

a(n) will always be a divisor of Phi(1000) = 400.
This sequence is periodic with a period of 1000 because n^i mod 1000 = (n + 1000)^i mod 1000.
For the odd numbers n ending in {1, 3, 7, 9} which are coprime to 10, we can expect the powers of n mod 1000 to loop back to 1, with the value of n^a(n) mod 1000 = 1, but for the other numbers n that are not coprime to 10, they do not loop back to 1.
For the even numbers n ending in {2, 4, 6, 8}, n^a(n) mod 1000 = 376.
For the numbers n ending in 5, n^(2*i) mod 1000 = 625, for all i >= 2.
For the numbers n ending in 0, n^i mod 1000 = 0, for all i >= 3.

Examples

			a(2) = 100 since 2^i mod 1000 = 2^(i+100) mod 1000, for all i >= 3.
a(3) = 100 since 3^i mod 1000 = 3^(i+100) mod 1000, for all i >= 0.
But a(7) = 20 since 7^i mod 1000 = 7^(i+20) mod 1000, for all i >= 0.
		

Crossrefs

Cf. A173635 (period with which the powers of n repeat mod 10).
Cf. A220022 (period with which the powers of n repeat mod 100).

Programs

  • Mathematica
    Flatten[Table[s=Table[PowerMod[n, e, 1000], {e, 2, 1000}]; Union[Differences[Position[s, s[[2]]]]], {n, 0, 40}]] (* Vincenzo Librandi, Jan 26 2013 *)
  • PARI
    k=1000; for(n=0, 100, x=(n^3)%k; y=(n^4)%k; z=1; while(x!=y, x=(x*n)%k; y=(y*n*n)%k; z++); print1(z", "))

A220024 The period with which the powers of n repeat mod 10000.

Original entry on oeis.org

1, 1, 500, 500, 250, 4, 125, 100, 500, 250, 1, 500, 500, 500, 250, 2, 125, 500, 100, 500, 1, 500, 500, 500, 50, 2, 25, 500, 500, 500, 1, 250, 100, 500, 250, 4, 125, 500, 500, 250, 1, 250, 500, 100, 250, 4, 125, 500, 500, 50, 1, 100, 500, 500, 250, 2, 125, 20
Offset: 0

Views

Author

V. Raman, Dec 15 2012

Keywords

Comments

a(n) will always be a divisor of Phi(10000) = 4000.
This sequence is periodic with a period of 10000 because n^i mod 10000 = (n + 10000)^i mod 10000.
For the odd numbers n ending in {1, 3, 7, 9} which are coprime to 10, we can expect the powers of n mod 10000 to loop back to 1, with the value of n^a(n) mod 10000 = 1, but for the other numbers n that are not coprime to 10, they do not loop back to 1.
For the even numbers n ending in {2, 4, 6, 8}, n^a(n) mod 10000 = 9376.
For the numbers n ending in 5, n^(4*i) mod 10000 = 625, for all i >= 1.
For the numbers n ending in 0, n^i mod 10000 = 0, for all i >= 4.

Examples

			a(2) = 500 since 2^i mod 10000 = 2^(i + 500) mod 10000, for all i >= 4.
a(3) = 500 since 3^i mod 10000 = 3^(i + 500) mod 10000, for all i >= 0.
But a(7) = 100 since 7^i mod 10000 = 7^(i + 100) mod 10000, for all i >= 0.
		

Crossrefs

Cf. A173635 (period with which the powers of n repeat mod 10).
Cf. A220022 (period with which the powers of n repeat mod 100).

Programs

  • Mathematica
    Flatten[Table[s = Table[PowerMod[n, e, 10000], {e, 2, 10000}]; Union[Differences[Position[s, s[[3]]]]], {n, 0, 40}]] (* Vincenzo Librandi, Jan 26 2013 *)
    Table[Length[FindTransientRepeat[PowerMod[n,Range[3000],10000],3] [[2]]],{n,0,60}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 08 2016 *)
  • PARI
    k=10000; for(n=0, 100, x=(n^4)%k; y=(n^5)%k; z=1; while(x!=y, x=(x*n)%k; y=(y*n*n)%k; z++); print1(z", "))

A220025 The period with which the powers of n repeat mod 100000.

Original entry on oeis.org

1, 1, 2500, 5000, 1250, 8, 625, 500, 2500, 2500, 1, 5000, 2500, 5000, 1250, 2, 625, 2500, 500, 5000, 1, 5000, 2500, 2500, 250, 4, 125, 5000, 2500, 5000, 1, 1250, 500, 2500, 1250, 8, 625, 5000, 2500, 2500, 1, 2500, 2500, 1000, 1250, 8, 625, 2500, 2500, 250, 1
Offset: 0

Views

Author

V. Raman, Dec 15 2012

Keywords

Comments

a(n) will always be a divisor of Phi(100000) = 40000.
This sequence is periodic with a period of 100000 because n^i mod 100000 = (n + 100000)^i mod 100000.
For the odd numbers n ending in {1, 3, 7, 9} which are coprime to 10, we can expect the powers of n mod 100000 to loop back to 1, with the value of n^a(n) mod 100000 = 1, but for the other numbers n that are not coprime to 10, they do not loop back to 1.
For the even numbers n ending in {2, 4, 6, 8}, n^a(n) mod 100000 = 9376.
For the numbers n ending in 5, n^(8*i) mod 100000 = 90625, for all i >= 1.
For the numbers n ending in 0, n^i mod 100000 = 0, for all i >= 5.

Examples

			a(2) = 2500 since 2^i mod 100000 = 2^(i + 2500) mod 100000, for all i >= 5.
a(3) = 5000 since 3^i mod 100000 = 3^(i + 5000) mod 100000, for all i >= 0.
But a(7) = 500 since 7^i mod 100000 = 7^(i + 500) mod 100000, for all i >= 0.
		

Crossrefs

Cf. A173635 (period with which the powers of n repeat mod 10).
Cf. A220022 (period with which the powers of n repeat mod 100).

Programs

  • Mathematica
    Flatten[Table[s = Table[PowerMod[n, e, 100000], {e, 2, 100000}]; Union[Differences[Position[s, s[[4]]]]], {n, 0, 40}]] (* Vincenzo Librandi, Jan 26 2013 *)
  • PARI
    k=100000; for(n=0, 100, x=(n^5)%k; y=(n^6)%k; z=1; while(x!=y, x=(x*n)%k; y=(y*n*n)%k; z++); print1(z", "))
Showing 1-8 of 8 results.