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

A199117 Integer values of A048153(n)/n in the order they appear in A048153.

Original entry on oeis.org

0, 2, 2, 4, 6, 8, 8, 8, 10, 14, 12, 14, 18, 20, 20, 18, 20, 26, 22, 26, 30, 32, 32, 28, 36, 36, 34, 38, 42, 44, 42, 38, 48, 50, 46, 50, 54, 56, 52, 48, 54, 60, 58, 60, 64, 68, 66, 60, 72, 74, 68, 70, 78, 76, 80, 72, 78, 86, 76, 84, 90, 92
Offset: 1

Views

Author

Zak Seidov, Nov 03 2011

Keywords

Comments

Not all even integers are here, first absent values are 16, 24, 40, 62, 88, 94, 100, 106, 112, 130, 142, 144, 154, 164, 172, 180.

Crossrefs

Formula

a(n) = A048153(m)/m, m = A007310(n).

Extensions

Offset corrected by Georg Fischer, Sep 01 2021

A199330 Squares in A048153.

Original entry on oeis.org

0, 1, 484, 1156, 2116, 4900, 16900, 30625, 41209, 765625, 12027024, 45346756, 94303521, 1188939361, 2144430864, 3475809936, 6168531600, 26159180644, 211618400400, 483560298225, 999898002601, 1722945012100, 3559421809449, 15912878919025, 19806300482329, 50911350177961
Offset: 1

Views

Author

Zak Seidov, Nov 05 2011

Keywords

Comments

Corresponding values of square roots are 0, 1, 22, 34, 46, 70, 130, 175, 203, 875, 3468, 6734, 9711, 34481, 46308, 58956, 78540, 161738, 460020, 695385, 999949, 1312610, 1886643, 3989095, 4450427, 7135219.

Crossrefs

Intersection of A000290 and A048153.
Cf. A199551.

Formula

a(n) = A048153(A199551(n)). - Amiram Eldar, Apr 08 2025

Extensions

a(17)-a(20) from Charles R Greathouse IV, Nov 04 2011
Offset corrected and a(21)-a(26) added by Amiram Eldar, Apr 08 2025

A199551 Positions of squares in A048153.

Original entry on oeis.org

1, 2, 33, 51, 69, 105, 195, 250, 294, 1250, 4913, 9583, 13778, 48778, 65603, 83521, 111265, 228939, 651695, 984150, 1414562, 1857848, 2668626, 5643110, 6295726, 10091354
Offset: 1

Views

Author

Zak Seidov, Nov 08 2011

Keywords

Crossrefs

Formula

A048153(a(n)) = A199330(n).

Extensions

a(21)-a(26) from Amiram Eldar, Apr 08 2025

A060036 Triangular array T read by rows: T(n,k) = k^2 mod n, for k = 1,2,...,n-1, n = 2,3,...

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Mar 17 2001

Keywords

Comments

T(n,k) = A048152(n-1,k), 1 <= k < n; T(2*n-1,n-1) = A123684(n-1) = A225126(n-1). - Reinhard Zumkeller, Apr 29 2013

Examples

			The triangle T(n,k) begins:
n\k 1 2 3 4 5 6 7 8 9 10 11 ...
-------------------------------
2:  1
3:  1 1
4:  1 0 1
5:  1 4 4 1
6:  1 4 3 4 1
7:  1 4 2 2 4 1
6:  1 4 1 0 1 4 1
9:  1 4 0 7 7 0 4 1
10: 1 4 9 6 5 6 9 4 1
11: 1 4 9 5 3 3 5 9 4  1
12: 1 4 9 4 1 0 1 4 9  4  1
...  reformatted by - _Wolfdieter Lang_, Dec 17 2018
		

Crossrefs

Cf. A048153 (row sums).

Programs

  • Haskell
    a060036 n k = a060036_tabl !! (n-2) !! (k-1)
    a060036_row n = a060036_tabl !! (n-2)
    a060036_tabl = map init $ tail a048152_tabl
    -- Reinhard Zumkeller, Apr 29 2013
  • Mathematica
    Flatten[Table[PowerMod[k,2,n],{n,2,20},{k,n-1}]] (* Harvey P. Dale, Feb 27 2012 *)
  • PARI
    { n=1; for (m=2, 46, for (k=1, m-1, write("b060036.txt", n++, " ", k^2 % m)); ) } \\ Harry J. Smith, Jul 01 2009
    

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Mar 20 2001

A215573 a(n) = n*(n+1)*(2n+1)/6 modulo n.

Original entry on oeis.org

0, 1, 2, 2, 0, 1, 0, 4, 6, 5, 0, 2, 0, 7, 10, 8, 0, 3, 0, 10, 14, 11, 0, 4, 0, 13, 18, 14, 0, 5, 0, 16, 22, 17, 0, 6, 0, 19, 26, 20, 0, 7, 0, 22, 30, 23, 0, 8, 0, 25, 34, 26, 0, 9, 0, 28, 38, 29, 0, 10, 0, 31, 42, 32, 0, 11, 0, 34, 46, 35, 0, 12, 0, 37, 50, 38
Offset: 1

Views

Author

Zak Seidov, Aug 16 2012

Keywords

Comments

a(n) = 0 for n = 6k +- 1, that is, A007310 (numbers congruent to 1 or 5 mod 6).
Graph consists of 4 linear patterns.

Crossrefs

Programs

  • Maple
    seq(modp(n*(n+1)*(2*n+1)/6,n),n=1..100); # Muniru A Asiru, Feb 07 2019
  • Mathematica
    Table[Mod[(n(n+1)(2n+1))/6,n],{n,80}] (* or *) LinearRecurrence[{0,0,0,0,0,2,0,0,0,0,0,-1},{0,1,2,2,0,1,0,4,6,5,0,2},80] (* Harvey P. Dale, Aug 25 2023 *)
  • PARI
    a(n)=n*(n+1)*(2*n+1)/6 % n; \\ Michel Marcus, Oct 19 2013
    
  • PARI
    concat(0, Vec(x^2*(1 + 2*x + 2*x^2 + x^4 + 2*x^6 + 2*x^7 + x^8) / ((1 - x)^2*(1 + x)^2*(1 - x + x^2)^2*(1 + x + x^2)^2) + O(x^80))) \\ Colin Barker, Feb 07 2019
    
  • Python
    def A215573(n): return n*(n-1)*((n<<1)-1)//6%n # Chai Wah Wu, Jun 03 2024

Formula

a(n) = A000330(n) mod n.
From Colin Barker, Feb 07 2019: (Start)
G.f.: x^2*(1 + 2*x + 2*x^2 + x^4 + 2*x^6 + 2*x^7 + x^8) / ((1 - x)^2*(1 + x)^2*(1 - x + x^2)^2*(1 + x + x^2)^2).
a(n) = 2*a(n-6) - a(n-12) for n>12. (End)
a(6*n) = n, a(6*n+1) = 0, a(6*n+2) = 3*n+1, a(6*n+3) = 4*n+2, a(6*n+4) = 3*n+2, a(6*n+5) = 0. - Philippe Deléham, Mar 05 2023
a(n) = A048153(n) mod n. - Alois P. Heinz, Jun 03 2024
a(n) = A000330(n-1) mod n. - Chai Wah Wu, Jun 03 2024
Sum_{k=1..n} a(k) ~ (11/72) * n^2. - Amiram Eldar, Apr 05 2025

A373749 Triangle read by rows: T(n, k) = MOD(k^2, n) where MOD(a, n) = a if n = 0 and otherwise a - n*floor(a/n). (Quadratic residue.)

Original entry on oeis.org

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

Views

Author

Peter Luschny, Jun 23 2024

Keywords

Comments

The definition of the binary operation MOD in the name follows CMath (Graham et al.) and Bach & Shallit. This is important because some CAS unfortunately do not follow this definition and throw a 'division by zero' error if n = 0.
Row n reduced to a set is the set of the quadratic residues mod n.

Examples

			Triangle starts:
  [0] 0;
  [1] 0, 0;
  [2] 0, 1, 0;
  [3] 0, 1, 1, 0;
  [4] 0, 1, 0, 1, 0;
  [5] 0, 1, 4, 4, 1, 0;
  [6] 0, 1, 4, 3, 4, 1, 0;
  [7] 0, 1, 4, 2, 2, 4, 1, 0;
  [8] 0, 1, 4, 1, 0, 1, 4, 1, 0;
  [9] 0, 1, 4, 0, 7, 7, 0, 4, 1, 0;
 [10] 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0;
		

References

  • Eric Bach and Jeffrey Shallit, Algorithmic Number Theory, p. 21.
  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics, Addison-Wesley, 2nd ed., pp. 81f.

Crossrefs

Variants: A048152, A096008.
Cf. A048153 (row sums), A373750 (middle terms).

Programs

  • Julia
    Mod(n, k) = k == 0 ? n : mod(n, k)
    T(n, k) = Mod(k^2, n)
    for n in 0:10
        [T(n, k) for k in 0:n] |> println
    end
    
  • Maple
    REM := (n, k) -> ifelse(k = 0, n, irem(n, k)):
    T := n -> local k; seq(REM(k^2, n), k = 0..n):
    seq(T(n), n = 0..12);
  • Mathematica
    MOD[n_, k_] := If[k == 0, n, Mod[n, k]];
    Table[MOD[k^2, n], {n, 0, 10}, {k, 0, n}]
  • SageMath
    def A373749(n, k): return mod(k^2, n)
    for n in range(11): print([A373749(n, k) for k in range(n + 1)])

A230366 a(n) = Sum_{k=1..floor(n/2)} (k^2 mod n).

Original entry on oeis.org

0, 1, 1, 1, 5, 8, 7, 6, 12, 25, 22, 19, 39, 42, 35, 28, 68, 69, 76, 65, 91, 110, 92, 74, 125, 169, 144, 147, 203, 190, 186, 152, 242, 289, 245, 201, 333, 342, 286, 270, 410, 413, 430, 363, 420, 460, 423, 340, 490, 575, 578, 585, 689, 666, 605, 546, 760, 841
Offset: 1

Views

Author

Jon Perry, Oct 17 2013

Keywords

Comments

a(26) and a(27) are both squares. Conjecture: the number of n such that a(n) and a(n+1) are both squares is infinite.
a(p = prime) == 0 (mod p) for p > 3.

Crossrefs

Cf. A048153.

Programs

  • JavaScript
    for (i=1;i<50;i++) {
    c=0;
    for (j=1;j<=i/2;j++) c+=(j*j)%i;
    document.write(c+", ");
    }
    
  • Mathematica
    Table[Sum[Mod[k^2, n], {k, Floor[n/2]}], {n, 100}] (* T. D. Noe, Oct 22 2013 *)
    Table[Sum[PowerMod[k,2,n],{k,Floor[n/2]}],{n,100}] (* Harvey P. Dale, Jul 03 2022 *)
  • PARI
    a(n)=sum(i=1,floor(n/2),(i*i)%n) \\ Ralf Stephan, Oct 19 2013
    
  • Python
    def A230366(n): return sum(k**2%n for k in range(1,(n>>1)+1)) # Chai Wah Wu, Jun 02 2024

A231589 a(n) = sum_{k=1..(n-1)/2} (k^2 mod n).

Original entry on oeis.org

0, 0, 1, 1, 5, 5, 7, 6, 12, 20, 22, 19, 39, 35, 35, 28, 68, 60, 76, 65, 91, 99, 92, 74, 125, 156, 144, 147, 203, 175, 186, 152, 242, 272, 245, 201, 333, 323, 286, 270, 410, 392, 430, 363, 420, 437, 423, 340, 490, 550, 578, 585, 689, 639, 605, 546, 760, 812
Offset: 1

Views

Author

Michel Marcus, Nov 11 2013

Keywords

Comments

This expression occurred to S. A. Shirali while demonstrating a result concerning A081115 and A228432. This led him to investigate integers n such that a(n) = n*(n-1)/4, a(n) = floor(n/4), or a(n) = n*(n-1)/4 - n.

Crossrefs

Programs

  • Mathematica
    Table[Sum[PowerMod[k,2,n],{k,(n-1)/2}],{n,60}] (* Harvey P. Dale, Jan 30 2016 *)
  • PARI
    a(n) = sum(k=1, (n-1)\2, k^2 % n);

A352620 Irregular triangle read by rows which are rows of successive n X n matrices M(n) with entries M(n)[i,j] = i*j mod n+1.

Original entry on oeis.org

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

Views

Author

Luca Onnis, Mar 24 2022

Keywords

Comments

Each matrix represents all possible products between the elements of Z_(n+1), where Z_k is the ring of integers mod k.
Those matrices are symmetric.
The first row is equal to the first column which is equal to 1,2,...,n.

Examples

			Matrices begin:
  n=1:  1,
  n=2:  1, 2,
        2, 1,
  n=3:  1, 2, 3,
        2, 0, 2,
        3, 2, 1,
  n=4:  1, 2, 3, 4,
        2, 4, 1, 3,
        3, 1, 4, 2,
        4, 3, 2, 1;
For example, the 6 X 6 matrix generated by Z_7 is the following:
  1 2 3 4 5 6
  2 4 6 1 3 5
  3 6 2 5 1 4
  4 1 5 2 6 3
  5 3 1 6 4 2
  6 5 4 3 2 1
The trace of this matrix is 14 = A048153(7).
		

Crossrefs

Cf. A048153 (traces), A349099 (permanents), A160255 (sum entries), A088922 (ranks).
Cf. A074930.

Programs

  • Mathematica
    Flatten[Table[Table[Mod[k*Table[i, {i, 1, p - 1}], p], {k, 1, p - 1}], {p, 1, 10}]]

A228587 Sum of the squares (modulo n) of the odd numbers less than n.

Original entry on oeis.org

0, 1, 1, 2, 5, 5, 7, 4, 12, 25, 22, 22, 39, 49, 35, 40, 68, 69, 76, 50, 91, 77, 92, 44, 125, 169, 144, 182, 203, 205, 186, 208, 242, 289, 245, 210, 333, 285, 286, 180, 410, 413, 430, 374, 420, 529, 423, 376, 490, 625, 578, 546, 689, 585, 605, 476, 760, 841, 767, 710
Offset: 1

Views

Author

R. J. Mathar, Aug 27 2013

Keywords

Comments

Sum over the odd-numbered columns in row n of A048152.

Crossrefs

Cf. A000447.

Programs

  • Maple
    A228587 := proc(n)
            local a,o ;
            a := 0 ;
            for o from 1 to n-1 by 2 do
                    a := a+ modp(o^2,n) ;
            end do:
            a ;
    end proc:

Formula

a(n) = sum_{k=1,3,5,...,n-1} (k^2 mod n).
a(n) <= A048153(n).
A187468(n) = a(2^n).
Showing 1-10 of 14 results. Next