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

A070516 Duplicate of A070435.

Original entry on oeis.org

0, 1, 4, 9, 4, 1, 0, 1, 4, 9, 4, 1, 0, 1, 4, 9, 4, 1, 0, 1, 4, 9, 4, 1, 0, 1, 4, 9, 4, 1, 0, 1, 4, 9, 4, 1, 0, 1, 4, 9, 4, 1, 0, 1, 4, 9, 4, 1, 0, 1, 4, 9, 4, 1, 0, 1, 4, 9, 4, 1, 0, 1, 4, 9, 4, 1, 0, 1, 4, 9, 4, 1, 0, 1, 4, 9, 4, 1, 0, 1, 4, 9, 4, 1, 0, 1, 4, 9, 4, 1, 0, 1, 4, 9, 4, 1, 0, 1, 4, 9, 4
Offset: 0

Views

Author

N. J. A. Sloane, May 13 2002

Keywords

Comments

n^4 mod 12 == A070435 n^2 mod 12 and both have the nice symmetrical cycle {0, 1, 4, 9, 4, 1, 0}. Also, A070597 n^5 mod 12 == A070474 n^3 mod 12 and both have the nice anti-symmetrical cycle {0, 1, 8, 3, 4, 5, 0, 7, 8, 9, 4, 11, 0}: a(i) + a(14-i) = 0 mod 12. - Zak Seidov, Feb 18 2006

Crossrefs

Programs

A008959 Final digit of squares: a(n) = n^2 mod 10.

Original entry on oeis.org

0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0
Offset: 0

Views

Author

N. J. A. Sloane, Mar 15 1996

Keywords

Comments

a(m*n) = a(m)*a(n) mod 10; a(5*n+k) = a(5*n-k) for k <= 5*n. - Reinhard Zumkeller, Apr 24 2009
a(n) = n^6 mod 10. - Zerinvary Lajos, Nov 06 2009
a(n) = A002015(n) mod 10 = A174452(n) mod 10. - Reinhard Zumkeller, Mar 21 2010
Decimal expansion of 166285490/1111111111. - Alexander R. Povolotsky, Mar 09 2013

Crossrefs

Programs

Formula

Periodic with period 10. - Franklin T. Adams-Watters, Mar 13 2006
a(n) = 4.5 - (1 + 5^(1/2))*cos(Pi*n/5) + (-1 - 3/5*5^(1/2))*cos(2*Pi*n/5) + (5^(1/2) - 1)*cos(3*Pi*n/5) + (-1 + 3/5*5^(1/2))*cos(4*Pi*n/5) - 0.5*(-1)^n. - Richard Choulet, Dec 12 2008
a(n) = A010879(A000290(n)). - Reinhard Zumkeller, Jan 04 2009
G.f.: (x^9+4*x^8+9*x^7+6*x^6+5*x^5+6*x^4+9*x^3+4*x^2+x)/(-x^10+1). - Colin Barker, Aug 14 2012
a(n) = n^2 - 10*floor(n^2/10). - Wesley Ivan Hurt, Jun 12 2013
a(n) = (n - 5*A002266(n + 2))^2 + 5*(5*A002266(n + 2) mod 2). - Wesley Ivan Hurt, Jun 06 2014
a(n) = A033569(n+3) mod 10. - Wesley Ivan Hurt, Dec 06 2014
a(n) = n^k mod 10; for k > 0 where k mod 4 = 2. - Doug Bell, Jun 15 2015

A070431 a(n) = n^2 mod 6.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, May 12 2002

Keywords

Comments

a(m*n) = a(m)*a(n) mod 6; a(3*n+k) = a(3*n-k) for k <= 3*n. - Reinhard Zumkeller, Apr 24 2009
Equivalently n^6 mod 6. - Zerinvary Lajos, Nov 06 2009
Equivalently: n^(2*m + 4) mod 6; n^(2*m + 2) mod 6. - G. C. Greubel, Apr 01 2016

Crossrefs

Programs

Formula

G.f.: -x*(1+4*x+3*x^2+4*x^3+x^4)/((x-1)*(1+x)*(1+x+x^2)*(x^2-x+1)). - R. J. Mathar, Jul 23 2009
a(n) = a(n-6). - Reinhard Zumkeller, Apr 24 2009
From G. C. Greubel, Apr 01 2016: (Start)
a(6*m) = 0.
a(2*n) = 4*A011655(n).
a(n) = (1/6)*(13 + 3*(-1)^n - 12*cos(n*Pi/3) - 4*cos(2*n*Pi/3)).
G.f.: (x +4*x^2 +3*x^3 + 4*x^4 +x^5)/(1 - x^6). (End)

A048152 Triangular array T read by rows: T(n,k) = k^2 mod n, for 1 <= k <= n, n >= 1.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			Rows:
  0;
  1, 0;
  1, 1, 0;
  1, 0, 1, 0;
  1, 4, 4, 1, 0;
  1, 4, 3, 4, 1, 0;
		

Crossrefs

Cf. A060036.
Cf. A225126 (central terms).
Cf. A070430 (row 5), A070431 (row 6), A053879 (row 7), A070432 (row 8), A008959 (row 10), A070435 (row 12), A070438 (row 15), A070422 (row 20).
Cf. A046071 (in ascending order, without zeros and duplicates).
Cf. A063987 (for primes, in ascending order, without zeros and duplicates).

Programs

  • Haskell
    a048152 n k = a048152_tabl !! (n-1) !! (k-1)
    a048152_row n = a048152_tabl !! (n-1)
    a048152_tabl = zipWith (map . flip mod) [1..] a133819_tabl
    -- Reinhard Zumkeller, Apr 29 2013
  • Mathematica
    Flatten[Table[PowerMod[k,2,n],{n,15},{k,n}]] (* Harvey P. Dale, Jun 20 2011 *)

Formula

T(n,k) = A133819(n,k) mod n, k = 1..n. - Reinhard Zumkeller, Apr 29 2013
T(n,k) = (T(n,k-1) + (2k+1)) mod n. - Andrés Ventas, Apr 06 2021

A070442 a(n) = n^2 mod 20.

Original entry on oeis.org

0, 1, 4, 9, 16, 5, 16, 9, 4, 1, 0, 1, 4, 9, 16, 5, 16, 9, 4, 1, 0, 1, 4, 9, 16, 5, 16, 9, 4, 1, 0, 1, 4, 9, 16, 5, 16, 9, 4, 1, 0, 1, 4, 9, 16, 5, 16, 9, 4, 1, 0, 1, 4, 9, 16, 5, 16, 9, 4, 1, 0, 1, 4, 9, 16, 5, 16, 9, 4, 1, 0, 1, 4, 9, 16, 5, 16, 9, 4, 1, 0, 1, 4, 9, 16, 5, 16, 9, 4, 1, 0, 1, 4, 9, 16
Offset: 0

Views

Author

N. J. A. Sloane, May 12 2002

Keywords

Comments

Also, n^6 mod 20.
Equivalently n^10 mod 20. - Zerinvary Lajos, Oct 31 2009

Crossrefs

Programs

Formula

From Reinhard Zumkeller, Apr 24 2009: (Start)
a(m*n) = a(m)*a(n) mod 20.
a(5*n+k) = a(5*n-k) for k <= 5*n.
a(n+10) = a(n). (End)
G.f. -x*(1+4*x+9*x^2+16*x^3+5*x^4+16*x^5+9*x^6+4*x^7+x^8) / ( (x-1) *(1+x) *(x^4+x^3+x^2+x+1) *(x^4-x^3+x^2-x+1) ). - R. J. Mathar, Aug 27 2013

A070438 a(n) = n^2 mod 15.

Original entry on oeis.org

0, 1, 4, 9, 1, 10, 6, 4, 4, 6, 10, 1, 9, 4, 1, 0, 1, 4, 9, 1, 10, 6, 4, 4, 6, 10, 1, 9, 4, 1, 0, 1, 4, 9, 1, 10, 6, 4, 4, 6, 10, 1, 9, 4, 1, 0, 1, 4, 9, 1, 10, 6, 4, 4, 6, 10, 1, 9, 4, 1, 0, 1, 4, 9, 1, 10, 6, 4, 4, 6, 10, 1, 9, 4, 1, 0, 1, 4, 9, 1, 10, 6, 4, 4, 6, 10, 1, 9, 4, 1, 0, 1, 4, 9, 1, 10, 6
Offset: 0

Views

Author

N. J. A. Sloane, May 12 2002

Keywords

Comments

Equivalently, n^6 mod 15. - Ray Chandler, Dec 27 2023

Crossrefs

Programs

Formula

From Reinhard Zumkeller, Apr 24 2009: (Start)
a(m*n) = a(m)*a(n) mod 15.
a(15*n+7+k) = a(15*n+8-k) for k <= 15*n+7.
a(15*n+k) = a(15*n-k) for k <= 15*n.
a(n+15) = a(n). (End)
From R. J. Mathar, Mar 14 2011: (Start)
a(n) = a(n-15).
G.f.: -x*(1+x) *(x^12+3*x^11+6*x^10-5*x^9+15*x^8-9*x^7+13*x^6-9*x^5+15*x^4-5*x^3+6*x^2+3*x+1) / ( (x-1) *(1+x^4+x^3+x^2+x) *(1+x+x^2) *(1-x+x^3-x^4+x^5-x^7+x^8) ). (End)
G.f.: (x^14 +4*x^13 +9*x^12 +x^11 +10*x^10 +6*x^9 +4*x^8 +4*x^7 +6*x^6 +10*x^5 +x^4 +9*x^3 +4*x^2 +x)/(-x^15 +1). - Colin Barker, Aug 14 2012

A070452 a(n) = n^2 mod 30.

Original entry on oeis.org

0, 1, 4, 9, 16, 25, 6, 19, 4, 21, 10, 1, 24, 19, 16, 15, 16, 19, 24, 1, 10, 21, 4, 19, 6, 25, 16, 9, 4, 1, 0, 1, 4, 9, 16, 25, 6, 19, 4, 21, 10, 1, 24, 19, 16, 15, 16, 19, 24, 1, 10, 21, 4, 19, 6, 25, 16, 9, 4, 1, 0, 1, 4, 9, 16, 25, 6, 19, 4, 21, 10, 1, 24, 19, 16, 15, 16, 19, 24, 1
Offset: 0

Views

Author

N. J. A. Sloane, May 12 2002

Keywords

Comments

Equivalently, n^6 mod 30. - Ray Chandler, Dec 27 2023

Crossrefs

Programs

  • Mathematica
    Table[Mod[n^2,30],{n,0,200}] (* Vladimir Joseph Stephan Orlovsky, Apr 27 2011 *)
    LinearRecurrence[{-1, 0, 1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1},{0, 1, 4, 9, 16, 25, 6, 19, 4, 21, 10, 1, 24, 19, 16, 15, 16, 19, 24, 1, 10, 21, 4, 19, 6, 25, 16, 9},80] (* Ray Chandler, Aug 26 2015 *)
    PowerMod[Range[0,80],6,30] (* or *) PadRight[{},80,{0,1,4,9,16,25,6,19,4,21,10,1,24,19,16,15,16,19,24,1,10,21,4,19,6,25,16,9,4,1}] (* Harvey P. Dale, Jul 10 2023 *)
  • PARI
    a(n)=n^2%30 \\ Charles R Greathouse IV, Oct 07 2015
  • Sage
    [power_mod(n,2,30)for n in range(0, 75)] # Zerinvary Lajos, Nov 03 2009
    

Formula

From Reinhard Zumkeller, Apr 24 2009: (Start)
a(m*n) = a(m)*a(n) mod 30.
a(15*n+k) = a(15*n-k) for k<=15*n.
a(n+30) = a(n). (End)
a(n)= -a(n-1) +a(n-3) +a(n-4) -a(n-6) -a(n-7) +a(n-9) +a(n-10) -a(n-12) -a(n-13) +a(n-15) +a(n-16) -a(n-18) -a(n-19) +a(n-21) +a(n-22) -a(n-24) -a(n-25) +a(n-27) +a(n-28). - R. J. Mathar, Jul 23 2009

A260686 Period 6 zigzag sequence, repeat [0, 1, 2, 3, 2, 1].

Original entry on oeis.org

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

Views

Author

Wesley Ivan Hurt, Nov 15 2015

Keywords

Comments

Decimal expansion of 37/3003. - Elmo R. Oliveira, Mar 06 2024

Crossrefs

Period k zigzag sequences: A000035 (k=2), A007877 (k=4), this sequence (k=6), A266313 (k=8), A271751 (k=10), A271832 (k=12), A279313 (k=14), A279319 (k=16), A158289 (k=18).

Programs

  • Magma
    [1+(1-(-1)^n)/2-(-1)^Floor((n+1)/3): n in [0..100]]; // Bruno Berselli, Nov 16 2015
    
  • Magma
    &cat[[0,1,2,3,2,1]: n in [0..15]]; // Vincenzo Librandi, Nov 17 2015
  • Maple
    A260686:=n->[0, 1, 2, 3, 2, 1][(n mod 6)+1]: seq(A260686(n), n=0..100);
  • Mathematica
    CoefficientList[Series[(x + x^2 + x^3)/(1 - x + x^3 - x^4), {x, 0, 100}], x]
    Table[1 + (1 - (-1)^n)/2 - (-1)^Floor[(n + 1)/3], {n, 0, 100}] (* Bruno Berselli, Nov 16 2015 *)
    PadRight[{}, 120, {0, 1, 2, 3, 2, 1}] (* Vincenzo Librandi, Nov 17 2015 *)
  • PARI
    concat(0, Vec((x+x^2+x^3)/(1-x+x^3-x^4) + O(x^100))) \\ Altug Alkan, Nov 15 2015
    

Formula

G.f.: x*(1 + x + x^2) / (1 - x + x^3 - x^4).
a(n) = a(n-1) - a(n-3) + a(n-4) for n > 3.
a(n) = Sum_{i=1..n} (-1)^floor((i-1)/3) for n > 0.
a(n+1) = a(n) + A130151(n).
a(2n) = 2*A011655(n), a(2n+1) = A109007(n+2).
a(n) = 1 + (1 - (-1)^n)/2 - (-1)^floor((n+1)/3). - Bruno Berselli, Nov 16 2015
a(n) = sin(n*Pi/6)^2*(11+4*cos(n*Pi/3)+2*cos(2*n*Pi/3))/3. - Wesley Ivan Hurt, Jun 17 2016
a(n) = a(n-6) for n >= 6. - Wesley Ivan Hurt, Sep 07 2022
a(n) = sqrt(n^2 mod 12) = sqrt(A070435(n)). - Nicolas Bělohoubek, May 24 2024

A159852 n^2 mod 60.

Original entry on oeis.org

0, 1, 4, 9, 16, 25, 36, 49, 4, 21, 40, 1, 24, 49, 16, 45, 16, 49, 24, 1, 40, 21, 4, 49, 36, 25, 16, 9, 4, 1, 0, 1, 4, 9, 16, 25, 36, 49, 4, 21, 40, 1, 24, 49, 16, 45, 16, 49, 24, 1, 40, 21, 4, 49, 36, 25, 16, 9, 4, 1, 0, 1, 4, 9, 16, 25, 36, 49, 4, 21, 40, 1, 24, 49, 16, 45, 16, 49, 24, 1
Offset: 0

Views

Author

Reinhard Zumkeller, Apr 24 2009

Keywords

Comments

Periodic with period 30: a(n+30) = a(n);
a(15*n+k) = a(15*n-k) for k<=15*n;
a(m*n) = a(m)*a(n) mod 60;
A010421 gives the range of this sequence.

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},{0, 1, 4, 9, 16, 25, 36, 49, 4, 21, 40, 1, 24, 49, 16, 45, 16, 49, 24, 1, 40, 21, 4, 49, 36, 25, 16, 9, 4, 1},80] (* Ray Chandler, Aug 26 2015 *)
    PowerMod[Range[0,80],2,60] (* or *) PadRight[{},80,{0,1,4,9,16,25,36,49,4,21,40,1,24,49,16,45,16,49,24,1,40,21,4,49,36,25,16,9,4,1}] (* Harvey P. Dale, Jun 19 2018 *)
  • PARI
    a(n)=n^2%60 \\ Charles R Greathouse IV, May 09 2013

A186646 Every fourth term of the sequence of natural numbers 1,2,3,4,... is halved.

Original entry on oeis.org

1, 2, 3, 2, 5, 6, 7, 4, 9, 10, 11, 6, 13, 14, 15, 8, 17, 18, 19, 10, 21, 22, 23, 12, 25, 26, 27, 14, 29, 30, 31, 16, 33, 34, 35, 18, 37, 38, 39, 20, 41, 42, 43, 22, 45, 46, 47, 24, 49, 50, 51, 26, 53, 54, 55, 28, 57, 58, 59, 30, 61, 62, 63, 32, 65, 66, 67, 34, 69, 70, 71, 36, 73, 74, 75, 38, 77, 78, 79, 40, 81, 82, 83, 42, 85, 86, 87, 44, 89, 90, 91, 46, 93, 94, 95, 48, 97, 98, 99
Offset: 1

Views

Author

R. J. Mathar, Feb 25 2011

Keywords

Comments

a(n) is the length of the period of the sequence k^2 mod n, k=1,2,3,4,..., i.e., the length of the period of A000035 (n=2), A011655 (n=3), A000035 (n=4), A070430 (n=5), A070431 (n=6), A053879 (n=7), A070432 (n=8), A070433 (n=9), A008959 (n=10), A070434 (n=11), A070435 (n=12) etc.
From Franklin T. Adams-Watters, Feb 24 2011: (Start)
Clearly if gcd(n,m) = 1, a(nm) = lcm(a(n),a(m)), so it suffices to establish this for prime powers.
If p is a prime, the period must divide p, but k^2 mod p is not constant, so a(p) = p.
a(p^e), e > 1, must be divisible by a(p^(e-1)), and must divide p^e. If p != 2, (p^(e-1)+1)^2 = p^(2e-2)+2p^(e-1)+1 == 2p^(e-1)+1 (mod p^2), so a(p^e) != p^(e-1); it must then be e.
By inspection, a(4) = 2 and a(8) = 4.
This leaves a(2^e), e > 3. But then (2^(e-2)+1)^2 = 2^(2e-4)+2^(e-1)+1 == 2^(e-1)+1 (mod 2^e), so a(n) > 2^(e-2). On the other hand, (2^(e-1)+c)^2 = 2^(2e-2)+c2^e+c^2 == c^2 (mod 2^e). Hence the period is 2^(e-1). (End)

Crossrefs

Cf. A000224 (size of the set of moduli of k^2 mod n), A019554, A060819, A061037, A090129, A142705, A164115, A283971.

Programs

  • Maple
    A186646 := proc(n) if n mod 4 = 0 then n/2 ; else n ; end if; end proc ;
  • Mathematica
    Flatten[Table[{n,n+1,n+2,(n+3)/2},{n,1,101,4}]] (* or *) LinearRecurrence[ {0,0,0,2,0,0,0,-1},{1,2,3,2,5,6,7,4},100] (* Harvey P. Dale, May 30 2014 *)
    Table[n (7 - (-1)^n - 2 Cos[n Pi/2])/8, {n, 100}] (* Federico Provvedi , Jan 02 2018 *)
  • PARI
    a(n)=if(n%4,n,n/2) \\ Charles R Greathouse IV, Oct 16 2015
    
  • Python
    def A186646(n): return n if n&3 else n>>1 # Chai Wah Wu, Jan 10 2023

Formula

a(n) = 2*a(n-4) - a(n-8).
a(4n) = 2n; a(4n+1) = 4n+1; a(4n+2) = 4n+2; a(4n+3) = 4n+3.
a(n) = n/A164115(n).
G.f.: x*(1 + 2*x + 3*x^2 + 2*x^3 + 3*x^4 + 2*x^5 + x^6) / ( (x-1)^2*(1+x)^2*(x^2+1)^2 ).
Dirichlet g.f.: (1-2/4^s)*zeta(s-1).
A019554(n) | a(n). - Charles R Greathouse IV, Feb 24 2011
a(n) = n*(7 - (-1)^n - (-i)^n - i^n)/8, with i=sqrt(-1). - Bruno Berselli, Feb 25 2011
Multiplicative with a(p^e)=2^e if p=2 and e<=1; a(p^e)=2^(e-1) if p=2 and e>=2; a(p^e)=p^e otherwise. - David W. Wilson, Feb 26 2011
a(n) * A060819(n+2) = A142705(n+1) = A061037(2n+2). - Paul Curtz, Mar 02 2011
a(n) = n - (n/2)*floor(((n-1) mod 4)/3). - Gary Detlefs, Apr 14 2013
a(2^n) = A090129(n+1). - R. J. Mathar, Oct 09 2014
a(n) = n*(7 - (-1)^n - 2*cos(n*Pi/2))/8. - Federico Provvedi, Jan 02 2018
E.g.f.: (1/4)*x*(4*cosh(x) + sin(x) + 3*sinh(x)). - Stefano Spezia, Jan 26 2020
Sum_{k=1..n} a(k) ~ (7/16) * n^2. - Amiram Eldar, Nov 28 2022
Showing 1-10 of 15 results. Next