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.

A325057 Number of positive integers k <= prime(n)# so that (k mod p_1) < (k mod p_2) < ... < (k mod p_n).

Original entry on oeis.org

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
Offset: 0

Views

Author

Bert Dobbelaere, Sep 04 2019

Keywords

Comments

This sequence emerges during computation of A306582 and A306612.

Examples

			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
		

Crossrefs

Programs

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

Extensions

Name edited and a(0)=1 prepended by Alois P. Heinz, Jan 04 2023