OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..500
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):
seq(a(n), n=0..24); # Alois P. Heinz, Jan 04 2023
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
def A325057(n):
....global cache ; cache = {}
....return f(1, 0, n)
CROSSREFS
KEYWORD
nonn
AUTHOR
Bert Dobbelaere, Sep 04 2019
EXTENSIONS
Name edited and a(0)=1 prepended by Alois P. Heinz, Jan 04 2023
STATUS
approved