|
|
A325057
|
|
Number of positive integers k <= prime(n)# so that (k mod p_1) < (k mod p_2) < ... < (k mod p_n).
|
|
3
|
|
|
1, 2, 3, 7, 19, 94, 381, 2217, 10248, 64082, 572741, 3590815, 33731134, 291308123, 1896596488, 14675287694, 147847569839, 1642854121867, 12717640104203, 134707566446733, 1285768348848054, 9334472487460317, 97284913917125312, 922382339920122509, 10370484766702974615
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
|
|
LINKS
|
|
|
EXAMPLE
|
a(3) = 7:
Solutions for k that have increasing remainders modulo the first 3 primes:
k modulo 2 3 5
=====================
22 0 < 1 < 2
28 0 < 1 < 3
4 0 < 1 < 4
8 0 < 2 < 3
14 0 < 2 < 4
23 1 < 2 < 3
29 1 < 2 < 4
|
|
MAPLE
|
b:= proc(n, i) option remember; `if`(n=0, 1,
add(b(n-1, j-1), j=1..min(i, ithprime(n))))
end:
a:= n-> b(n, infinity):
|
|
PROG
|
(Python)
from sympy import prime
def f(k, r, n):
....if k==n: return prime(k)-r
....global cache ; args = (k, r)
....if args in cache: return cache[args]
....rv = f(k+1, r+1, n)
....if r < (prime(k)-1): rv += f(k, r+1, n)
....cache[args]=rv ; return rv
....global cache ; cache = {}
....return f(1, 0, n)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|