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.

A371035 a(n) = A086330(prime(n)).

Original entry on oeis.org

0, 2, 7, 18, 43, 73, 113, 159, 203, 334, 496, 706, 863, 874, 1097, 1124, 1560, 2033, 2073, 2409, 2462, 3336, 3345, 3634, 3958, 4657, 5198, 5284, 5186, 6096, 7801, 8594, 9270, 9167, 10659, 10578, 12375, 12227, 13221, 13769, 15958, 16458, 18820, 17919, 18722
Offset: 1

Views

Author

Alexandre Herrera, Apr 10 2024

Keywords

Comments

The sequence sometimes decreases, as for example at a(29) = 5186 < 5284 = a(28).

Examples

			For n = 3, a(n) = A086330(prime(3)) = A086330(5) = (2! mod 5) + (3! mod 5) + (4! mod 5) = 2 + 1 + 4 = 7.
		

Crossrefs

Programs

  • PARI
    a(n) = my(p=prime(n)); sum(m=2, p, m! % p); \\ Michel Marcus, Apr 11 2024
  • Python
    from sympy import isprime
    l = []
    for i in range(2,185):
        if isprime(i):
            sum = 0
            reminder = 1
            for j in range(2, i):
                reminder = (reminder * j) % i
                sum += reminder
            l.append(sum)
    print(l)
    
  • Python
    from sympy import prime
    def A371035(n):
        a, c, p = 0, 1, prime(n)
        for m in range(2,p):
            c = c*m%p
            a += c
        return a # Chai Wah Wu, Apr 16 2024