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

A317058 a(n) is the smallest composite k such that 1^(k-1) + 2^(k-1) + ... + n^(k-1) == n (mod k).

Original entry on oeis.org

4, 341, 473, 4, 4, 133, 497, 4, 4, 15, 9, 4, 4, 143, 35, 4, 4, 51, 57, 4, 4, 77, 253, 4, 4, 65, 9, 4, 4, 115, 155, 4, 4, 187, 35, 4, 4, 9, 247, 4, 4, 287, 2051, 4, 4, 15, 33, 4, 4, 35, 85, 4, 4, 9, 9, 4, 4, 551, 1711, 4, 4, 713, 21, 4, 4, 55, 77, 4, 4, 35, 35, 4
Offset: 1

Views

Author

Thomas Ordowski, Jul 26 2018

Keywords

Comments

According to the Agoh-Giuga conjecture, a(n) <> n+1.
a(n) = 4 if and only if n == {0, 1} (mod 4).

Crossrefs

Programs

  • Mathematica
    a[n_] := Block[{k = 4}, While[PrimeQ[k] || Mod[Sum[PowerMod[j, k-1, k], {j, n}], k] != Mod[n, k], k++]; k]; Array[a, 72] (* Giovanni Resta, Jul 26 2018 *)
  • PARI
    a(n) = forcomposite(k=1,, if (sum(j=1,n, Mod(j,k)^(k-1)) == n, return (k));); \\ Michel Marcus, Jul 26 2018
    
  • Python
    from sympy import isprime
    def g(n,p,q): # compute (-n + sum_{k=1,n} k^p)  mod q
        c = (-n) % q
        for k in range(1,n+1):
            c = (c+pow(k,p,q)) % q
        return c
    def A317058(n):
        k = 2
        while isprime(k) or g(n,k-1,k):
            k += 1
        return k # Chai Wah Wu, Jul 30 2018

Extensions

More terms from Giovanni Resta, Jul 26 2018

A133906 Least number m such that binomial(n+m, m) mod m = 1.

Original entry on oeis.org

2, 3, 5, 2, 2, 7, 9, 2, 2, 3, 3, 2, 2, 17, 17, 2, 2, 3, 3, 2, 2, 23, 25, 2, 2, 4, 3, 2, 2, 31, 37, 2, 2, 8, 8, 2, 2, 3, 41, 2, 2, 4, 4, 2, 2, 3, 3, 2, 2, 5, 5, 2, 2, 3, 3, 2, 2, 4, 4, 2, 2, 67, 3, 2, 2, 44, 44, 2, 2, 16, 16, 2, 2, 3, 4, 2, 2, 5, 5, 2, 2, 3, 3, 2, 2, 89, 9, 2, 2, 3, 3, 2, 2, 97, 97, 2, 2, 7
Offset: 1

Views

Author

Hieronymus Fischer, Oct 20 2007

Keywords

Examples

			a(1)=2, since binomial(1+2, 2) mod 2 = 3 mod 2 = 1 and 2 is the minimal number with this property.
a(7)=9 because of binomial(7+9, 9) = 11440 = 1271*9 + 1, but binomial(7+k, k) mod k <> 1 for all numbers < 9.
		

Crossrefs

Programs

  • Mathematica
    Table[Block[{m = 1}, While[Mod[Binomial[n + m, m], m] != 1, m++]; m], {n, 98}] (* Michael De Vlieger, Jul 30 2018 *)
  • PARI
    a(n) = {my(m = 1, ok = 0); until (ok, if (binomial(n+m, m) % m == 1, ok = 1, m++);); return (m);} \\ Michel Marcus, Jul 15 2013

A317358 a(n) is the smallest number k > 1 such that 1^(k-1) + 2^(k-1) + ... + n^(k-1) == n (mod k).

Original entry on oeis.org

2, 3, 5, 2, 2, 7, 11, 2, 2, 3, 3, 2, 2, 17, 17, 2, 2, 3, 3, 2, 2, 23, 29, 2, 2, 5, 3, 2, 2, 31, 37, 2, 2, 37, 35, 2, 2, 3, 41, 2, 2, 43, 47, 2, 2, 3, 3, 2, 2, 5, 5, 2, 2, 3, 3, 2, 2, 59, 61, 2, 2, 67, 3, 2, 2, 55, 71, 2, 2, 35, 35, 2, 2, 3, 5, 2, 2, 5, 5, 2, 2
Offset: 1

Views

Author

Thomas Ordowski, Jul 26 2018

Keywords

Comments

a(n) = 2 if and only if n == {0, 1} (mod 4).
a(n) <= A151800(n).
A133906(n) <= a(n) <= A133907(n).
The sequence is unbounded.
Numbers n such that a(n-1) = n are 2, 3, 7, 23, 31, 43, 59, 139, 283, ...
By the Agoh-Giuga conjecture, if a(n-1) = n, then n is a prime.
It seems that if a(n) > n, then a(n) is a prime (the next prime after n).
If a(n) = n, then n is in A121707. These numbers are 35, 143, 187, 215, ...
Conjecture: all composite terms of the sequence are A121707.

Crossrefs

Programs

  • Mathematica
    a[n_] := Block[{k=2}, While[Mod[Sum[PowerMod[j, k-1, k], {j, n}], k] != Mod[n, k], k++]; k]; Array[a, 81] (* Giovanni Resta, Jul 29 2018 *)
  • PARI
    a(n) = for(k=2,oo, if (sum(j=1,n, Mod(j,k)^(k-1)) == n, return (k));); \\ Michel Marcus, Jul 26 2018
    
  • Python
    def g(n,p,q): # compute (-n + sum_{k=1,n} k^p)  mod q
        c = (-n) % q
        for k in range(1,n+1):
            c = (c+pow(k,p,q)) % q
        return c
    def A317358(n):
        k = 2
        while g(n,k-1,k):
            k += 1
        return k # Chai Wah Wu, Jul 30 2018

Extensions

More terms from Michel Marcus, Jul 26 2018
Showing 1-3 of 3 results.