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.

Showing 1-2 of 2 results.

A306582 a(n) is the least integer k such that the remainder of k modulo p is strictly increasing over the first n primes.

Original entry on oeis.org

0, 2, 4, 34, 52, 194, 502, 1138, 4042, 5794, 5794, 62488, 798298, 5314448, 41592688, 483815692, 483815692, 5037219688, 18517814158, 18517814158, 19566774820732, 55249201504132, 1257253598786974, 6743244322196288, 24165921989926702, 24165921989926702, 5346711077171356252, 47449991406350138602, 278545375679341352084, 5604477496256287791854
Offset: 1

Views

Author

Charlie Neder, Jun 03 2019

Keywords

Comments

If "strictly increasing" is replaced with "nondecreasing", this sequence becomes A000004.
Trivially, a(n) <= A002110(n)-2. Equality only holds for n = 0.

Examples

			  a(n) modulo 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, ...
  ==== ==================================================
     0        0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0, ...
     2        0, 2, 2, 2,  2,  2,  2,  2,  2,  2,  2, ...
     4        0, 1, 4, 4,  4,  4,  4,  4,  4,  4,  4, ...
    34        0, 1, 4, 6,  1,  8,  0, 15, 11,  5,  3, ...
    52        0, 1, 2, 3,  8,  0,  1, 14,  6, 23, 21, ...
   194        0, 2, 4, 5,  7, 12,  7,  4, 10, 20,  8, ...
   502        0, 1, 2, 5,  7,  8,  9,  8, 19,  9,  6, ...
  1138        0, 1, 3, 4,  5,  7, 16, 17, 11,  7, 22, ...
  4042        0, 1, 2, 3,  5, 12, 13, 14, 17, 11, 12, ...
  5794        0, 1, 4, 5,  8,  9, 14, 18, 21, 23, 28, ...
		

Crossrefs

Programs

  • PARI
    isok(k, n) = {my(last = -1, cur); for (i=1, n, cur = k % prime(i); if (cur <= last, return (0)); last = cur;); return (1);}
    a(n) = {my(k=0); while(!isok(k, n), k++); k;} \\ Michel Marcus, Jun 04 2019
    
  • Python
    from sympy import prime
    def A306582(n):
        plist, rlist, x = [prime(i) for i in range(1,n+1)], [0]*n, 0
        while True:
            for i in range(n-1):
                if rlist[i] >= rlist[i+1]:
                    break
            else:
                return x
            for i in range(n):
                rlist[i] = (rlist[i] + 1) % plist[i]
            x += 1 # Chai Wah Wu, Jun 15 2019

Extensions

a(16)-a(20) from Daniel Suteu, Jun 03 2019
a(21)-a(23) from Giovanni Resta, Jun 16 2019
a(24)-a(27) from Bert Dobbelaere, Jun 22 2019
a(28)-a(30) from Bert Dobbelaere, Sep 05 2019

A354621 Number of n-tuples (p_1, p_2, ..., p_n) of positive integers such that p_{i-1} <= p_i <= prime(i).

Original entry on oeis.org

1, 2, 5, 19, 85, 586, 3583, 28568, 195449, 1666786, 18757980, 161386953, 1897428757, 20910643255, 186584844271, 1896239913403, 23753305611756, 322385257985845, 3291722491175736, 43011227141438328, 517673545204963277, 5056620552149902641, 65366993167319822971
Offset: 0

Views

Author

Alois P. Heinz, Jul 08 2022

Keywords

Comments

The number of n-tuples of primes with p_{i-1} <= p_i <= prime(i) give A000108.

Examples

			a(0) = 1: ( ).
a(1) = 2: (1), (2).
a(2) = 5: (1,1), (1,2), (1,3), (2,2), (2,3).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1,
          add(b(n-1, j), j=1..min(i, ithprime(n))))
        end:
    a:= n-> b(n, infinity):
    seq(a(n), n=0..23);
    # second Maple program:
    a:= proc(n) option remember; `if`(n=0, 1, -add(a(j)*
          (-1)^(n-j)*binomial(ithprime(j+1), n-j), j=0..n-1))
        end:
    seq(a(n), n=0..23);
  • Mathematica
    a[n_] := a[n] = If[n == 0, 1, -Sum[a[j]*(-1)^(n - j)* Binomial[Prime[j + 1], n - j], {j, 0, n - 1}]];
    Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Dec 28 2022, after second Maple program *)

Formula

a(n) = Sum_{j=0..n-1} a(j)*(-1)^(n+1-j)*binomial(prime(j+1),n-j) with a(0) = 1.
Sum_{n>=0} a(n)*x^n * (1-x)^prime(n+1) = 1.
Showing 1-2 of 2 results.