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.

Previous Showing 11-14 of 14 results.

A340806 a(n) = Sum_{k=1..n-1} (k^n mod n).

Original entry on oeis.org

0, 1, 3, 2, 10, 13, 21, 4, 27, 45, 55, 38, 78, 77, 105, 8, 136, 93, 171, 146, 210, 209, 253, 172, 250, 325, 243, 294, 406, 365, 465, 16, 528, 561, 595, 402, 666, 665, 741, 372, 820, 673, 903, 726, 945, 897, 1081, 536, 1029, 1125, 1275, 1170, 1378, 765, 1485
Offset: 1

Views

Author

Sebastian Karlsson, Jan 22 2021

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> add(k&^n mod n, k=1..n-1):
    seq(a(n), n=1..55);  # Alois P. Heinz, Feb 13 2021
  • PARI
    a(n) = sum(k=1, n-1, lift(Mod(k, n)^n)); \\ Michel Marcus, Jan 22 2021
  • Python
    def a(n):
        return sum([pow(k,n,n) for k in range(1, n)])
    for n in range(1, 56):
        print(a(n), end=', ')
    

Formula

a(n) = n*A010848(n)/2, if n is odd.
a(n) = n*(n-1)/2, if n is both odd and squarefree.
a(p^e) = (1/2)*(p-1)*p^(2*e-1), if p is an odd prime.
a(2^e) = 2^(e-1).

A349099 a(n) is the permanent of the n X n matrix M(n) defined as M(n)[i,j] = i*j (mod n + 1).

Original entry on oeis.org

1, 1, 5, 32, 1074, 12600, 1525292, 34078720, 4072850100, 263459065600, 106809546673488, 2254519427530752, 3172225081523720416, 210351382651302645760, 45654014718074873700000, 11122845097194072534155264, 18156837198112938091803999360, 795289872611524024920215715840
Offset: 0

Views

Author

Stefano Spezia, Mar 25 2022

Keywords

Comments

Det(M(n)) = 0 iff n = 4 or n > 5.
Rank(M(n)) = A088922(n+1).
Tr(M(n)) = A048153(n+1).

Examples

			See A352620 for the examples of matrix M(n).
		

Crossrefs

Programs

  • Maple
    a:= n-> `if`(n=0, 1, LinearAlgebra[Permanent](
             Matrix(n, (i, j)-> (i*j) mod (n+1)))):
    seq(a(n), n=0..16);  # Alois P. Heinz, Mar 25 2022
  • Mathematica
    Join[{1},Table[Permanent[Table[Mod[j*Table[i, {i, n}], n+1], {j, n}]], {n, 17}]]
  • PARI
    a(n) = matpermanent(matrix(n,n,i,j,(i*j)%(n+1))); \\ Michel Marcus, Mar 26 2022

A165186 a(n) = Sum_{k=1..n} (k*(n-k) mod n).

Original entry on oeis.org

0, 1, 4, 6, 10, 17, 28, 36, 30, 45, 66, 82, 78, 105, 140, 136, 136, 141, 190, 230, 238, 253, 322, 380, 250, 325, 360, 434, 406, 505, 558, 592, 572, 561, 700, 678, 666, 741, 910, 980, 820, 917, 946, 1122, 1050, 1173, 1316, 1432, 1078, 1125, 1394, 1430, 1378, 1449
Offset: 1

Views

Author

Wouter Meeussen, Sep 06 2009

Keywords

Comments

Comment from Max Alekseyev, Nov 22 2009: For a prime p==3 (mod 4), a(p) = p*h(-p) + p*(p-1)/2 where h(-p) is the class number (listed in A002143). For example, h(-19)=1 and a(19) = 19*1 + 19*18/2 = 190.

Crossrefs

Programs

  • Mathematica
    Table[Sum[Mod[k (n-k),n],{k,n}],{n,100}]

A380790 Length of the n-th Golomb ruler constructed by the Paul Erdős and Pál Turán formula.

Original entry on oeis.org

20, 110, 308, 1254, 2106, 4760, 6650, 11822, 23954, 29202, 49950, 68060, 78518, 102460, 147446, 203432, 225090, 298418, 354858, 386316, 489484, 568052, 700964, 907920, 1025150, 1086856, 1218944, 1289034, 1436456, 2039620, 2238790, 2561900, 2675472, 3296774, 3430418
Offset: 2

Views

Author

Darío Clavijo, Feb 03 2025

Keywords

Comments

In October of 1941 Paul Erdős and Pál Turán found that a Golomb ruler could be constructed for every odd prime p.
Such a ruler has the property that the mark or notches are defined by: notch(k) = 2pk + (k^2 mod p) for k in {0..p-1}, with p=A000040(n).
Empirical observation: a(n) satisfies p^3-p^2 <= a(n)/p^3 <= 0.9999.
Except for n=2, a(n) is divisible by p.
Also partial sums of A217793.

Examples

			 n | p  | Golomb ruler notches                             | a(n)
---+----+--------------------------------------------------+-------
 2 | 3  | 0, 7,  13                                        | 20
 3 | 5  | 0, 11, 24, 34, 41                                | 110
 4 | 7  | 0, 15, 32, 44, 58, 74,  85                       | 308
 5 | 11 | 0, 23, 48, 75, 93, 113, 135, 159, 185, 202, 221  | 1254
		

Crossrefs

Programs

  • PARI
    a(n)= if(n==2, return(20));  my(p=prime(n)); if(bitand(p, 3)==1, return((p*(p-1)*(2*p+1))/2)); if(bitand(p, 3)==3, return((p*(p-1)*(2*p+1))/2 - p * qfbclassno(-p)));
  • Python
    from sympy import prime
    from math import isqrt
    def a(n):
      p = prime(n)
      if p & 3 == 1: return (p*(p-1)*(2*p+1))//2
      m = isqrt(p-1)
      return (p-1) * p**2 + (m*(m+1)*(2*m+1))//6 + sum(pow(k,2,p) for k in range(m+1,p))
    print([a(n) for n in range(2, 37) ])
    

Formula

a(n) = Sum_{k=0..p-1} (2*k*p + k^2 mod p), where p is the n-th prime.
a(n) = (p-1)*p^2 + 1 + Sum_{k=2..p-1} (k^2 mod p), where p is the n-th prime.
a(n) = (p-1)*p^2 + A000330(m) + Sum_{k=m+1..p-1} (k^2 mod p), where m = floor(sqrt(p-1)) and p is the n-th prime.
a(n) = (p-1)*p^2 + p*(p-1)*(p+1)/12 - 2*p*(Sum_{k=1..(p-1)/2} floor(k^2/p)), where p is the n-th prime.
a(n) = A100104(A000040(n)) + A048153(A000040(n)) - 1.
a(n) = A100104(A000040(n)) + A076409(n).
a(n) = A160378(A000040(n)), iif A000040(n) = 1 (mod 4).
a(n) = A160378(A000040(n)) - A000040(n)*A355879(n), iif A000040(n) = 3 (mod 4).
a(n) < A000040(n)^3.
a(n) > A000040(n)^3 - A000040(n)^2.
a(n) = 0 mod A000040(n) for n >= 3.
a(n) = Sum_{k=0..A000040(n)-1} A217793(n - 1, k).
a(n) = A135177(n) + A127921(n) - 2*p*(Sum_{k=1..(p-1)/2} floor(k^2/p)), where p = A000040(n).
Previous Showing 11-14 of 14 results.