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)).

This page as a plain text file.
%I A371035 #48 Apr 17 2024 02:20:39
%S A371035 0,2,7,18,43,73,113,159,203,334,496,706,863,874,1097,1124,1560,2033,
%T A371035 2073,2409,2462,3336,3345,3634,3958,4657,5198,5284,5186,6096,7801,
%U A371035 8594,9270,9167,10659,10578,12375,12227,13221,13769,15958,16458,18820,17919,18722
%N A371035 a(n) = A086330(prime(n)).
%C A371035 The sequence sometimes decreases, as for example at a(29) = 5186 < 5284 = a(28).
%e A371035 For n = 3, a(n) = A086330(prime(3)) = A086330(5) = (2! mod 5) + (3! mod 5) + (4! mod 5) = 2 + 1 + 4 = 7.
%o A371035 (Python)
%o A371035 from sympy import isprime
%o A371035 l = []
%o A371035 for i in range(2,185):
%o A371035     if isprime(i):
%o A371035         sum = 0
%o A371035         reminder = 1
%o A371035         for j in range(2, i):
%o A371035             reminder = (reminder * j) % i
%o A371035             sum += reminder
%o A371035         l.append(sum)
%o A371035 print(l)
%o A371035 (Python)
%o A371035 from sympy import prime
%o A371035 def A371035(n):
%o A371035     a, c, p = 0, 1, prime(n)
%o A371035     for m in range(2,p):
%o A371035         c = c*m%p
%o A371035         a += c
%o A371035     return a # _Chai Wah Wu_, Apr 16 2024
%o A371035 (PARI) a(n) = my(p=prime(n)); sum(m=2, p, m! % p); \\ _Michel Marcus_, Apr 11 2024
%Y A371035 Cf. A086330, A000040.
%K A371035 easy,nonn
%O A371035 1,2
%A A371035 _Alexandre Herrera_, Apr 10 2024