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

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

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

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, May 12 2002

Keywords

Comments

Equivalently n^6 mod 5. - Zerinvary Lajos, Nov 06 2009

Crossrefs

Programs

Formula

From R. J. Mathar, Apr 20 2010: (Start)
a(n) = a(n-5).
G.f.: -x*(1+x)*(x^2+3*x+1) / ( (x-1)*(1+x+x^2+x^3+x^4) ). (End)

A070434 a(n) = n^2 mod 11.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, May 12 2002

Keywords

Crossrefs

Programs

Formula

From R. J. Mathar, Apr 20 2010: (Start)
a(n) = a(n-11).
G.f.: ( -x*(1+x)*(x^8+3*x^7+6*x^6-x^5+4*x^4-x^3+6*x^2+3*x+1) ) / ( (x-1)*(1+x+x^2+x^3+x^4+x^5+x^6+x^7+x^8+x^9+x^10) ). (End)
a(n) = A010880(n^2). - Michel Marcus, Mar 24 2016

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

A174452 a(n) = n^2 mod 1000.

Original entry on oeis.org

0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961, 24, 89, 156, 225, 296, 369, 444, 521, 600, 681, 764, 849, 936, 25, 116, 209, 304, 401, 500, 601, 704, 809, 916, 25
Offset: 0

Views

Author

Reinhard Zumkeller, Mar 21 2010

Keywords

Comments

a(n) = A000290(n) for n < 32, but a(32) = 24;
A008959(n) = a(n) mod 10; A002015(n) = a(n) mod 100;
periodic with period 500: a(n+500)=a(n) and a(250*n+k)=a(250*n-k) for k <= 250*n;
a(n) = (n mod 1000)^2 mod 1000;
a(m*n) = a(m)*a(n) mod 1000;
A122986 gives the range of this sequence;
a(n) = n for n = 0, 1, and 376.

Examples

			Some calculations for n=982451653, to be realized by hand:
a(n) = (53^2 + 200*6*3) mod 1000 = 6409 mod 1000 = 409;
a(n) = (653^2) mod 1000 = 426409 mod 1000 = 409;
a(n) = a(n mod 500) = a(153) = 409;
a(n) = 965211250482432409 mod 1000 = 409.
		

Crossrefs

Programs

Formula

a(n) = ((n mod 100)^2 + 200 * (floor(n/100) mod 10) * (n mod 10)) mod 1000.

A002015 a(n) = n^2 reduced mod 100.

Original entry on oeis.org

0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 0, 21, 44, 69, 96, 25, 56, 89, 24, 61, 0, 41, 84, 29, 76, 25, 76, 29, 84, 41, 0, 61, 24, 89, 56, 25, 96, 69, 44, 21, 0, 81, 64, 49, 36, 25, 16, 9, 4, 1, 0, 1, 4, 9, 16, 25, 36, 49, 64, 81
Offset: 0

Views

Author

Keywords

Comments

Periodic with period 50: (0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 0, 21, 44, 69, 96, 25, 56, 89, 24, 61, 0, 41, 84, 29, 76, 25, 76, 29, 84, 41, 0, 61, 24, 89, 56, 25, 96, 69, 44, 21, 0, 81, 64, 49, 36, 25, 16, 9, 4, 1) and next term is 0. The period is symmetrical about the "midpoint" 25. - Zak Seidov, Oct 26 2009
A010461 gives the range of this sequence. - Reinhard Zumkeller, Mar 21 2010

Crossrefs

Programs

Formula

From Reinhard Zumkeller, Mar 21 2010: (Start)
a(n) = (n mod 10) * ((n mod 10) + 20 * ((n\10) mod 10)) mod 100.
a(n) = A174452(n) mod 100; A008959(n) = a(n) mod 10;
a(m*n) = a(m)*a(n) mod 100;
a(n) = (n mod 100)^2 mod 100;
a(n) = n for n = 0, 1, and 25. (End)

Extensions

Definition rephrased at the suggestion of Zak Seidov, Oct 26 2009

A109753 n^3 mod 8; the periodic sequence {0,1,0,3,0,5,0,7}.

Original entry on oeis.org

0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0, 1, 0, 3, 0, 5, 0, 7, 0
Offset: 0

Views

Author

Bruce Corrigan (scentman(AT)myfamily.com), Aug 11 2005

Keywords

Crossrefs

Cf. n mod 8 = A010877; n^2 mod 8 = A070432.

Programs

Formula

G.f. = (x+3x^3+5x^5+7x^7)/(1-x^8)
Showing 1-7 of 7 results.