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-4 of 4 results.

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

Original entry on oeis.org

3, 4, 7, 8, 16, 16, 157, 157, 16957, 19231, 80942, 82372, 82372, 9624266, 19607227, 118867612, 4968215191, 31090893772, 118903377091, 187341482252, 1784664085208, 12330789708022, 68016245854132, 68016245854132, 10065964847743822, 74887595879692807, 1825207861455319267, 98403562254816509476, 283462437415903129597, 2126598918934702375802
Offset: 1

Views

Author

Charlie Neder, Jun 03 2019

Keywords

Comments

0, 1, and 2 satisfy this condition for all p, so this sequence starts at 3. The growth of this sequence is much more irregular than that of the companion sequence A306582.

Examples

			   a(n) modulo 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, ...
  ===== ==================================================
      3        1, 0, 2, 4,  8, 10, 14, 16, 20, 26, 28, ...
      4        0, 2, 1, 3,  7,  9, 13, 15, 19, 25, 27, ...
      7        1, 2, 3, 0,  4,  6, 10, 12, 16, 22, 24, ...
      8        0, 1, 2, 6,  3,  5,  9, 11, 15, 21, 23, ...
     16        0, 2, 4, 5,  6, 10,  1,  3,  7, 13, 15, ...
    157        1, 2, 3, 4,  8, 12, 13, 14,  4, 17, 29, ...
  16957        1, 2, 3, 4,  5,  8,  9, 10, 17,  8,  0, ...
  19231        1, 2, 4, 5,  8,  9, 13, 16, 20, 25, 20, ...
  80942        0, 1, 3, 6,  7,  9, 12, 17, 18, 26, 30, ...
		

Crossrefs

Cf. A306582.

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=3); while(!isok(k, n), k++); k;} \\ Michel Marcus, Jun 04 2019
    
  • Python
    from sympy import prime
    def A306612(n):
        plist, x = [prime(i) for i in range(1,n+1)], 3
        rlist = [-x % p for p in plist]
        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(19) from Daniel Suteu, Jun 04 2019
a(20)-a(25) from Giovanni Resta, Jun 16 2019
a(26)-a(27) from Bert Dobbelaere, Jun 22 2019
a(28)-a(30) from Bert Dobbelaere, Sep 04 2019

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

A327408 Smallest integer > 0 so that its remainders modulo the first n primes are less than half their respective moduli.

Original entry on oeis.org

2, 4, 6, 10, 16, 16, 70, 136, 210, 210, 442, 786, 786, 786, 6450, 53110, 53110, 247690, 303810, 303810, 813450, 3443146, 5889382, 9327220, 10068256, 63916062, 63916062, 63916062, 285847290, 285847290, 285847290, 285847290, 370793956, 370793956, 370793956, 370793956
Offset: 1

Views

Author

Bert Dobbelaere, Sep 07 2019

Keywords

Examples

			a(6) = 16.
16 mod 2 = 0 < 2/2
16 mod 3 = 1 < 3/2
16 mod 5 = 1 < 5/2
16 mod 7 = 2 < 7/2
16 mod 11 = 5 < 11/2
16 mod 13 = 3 < 13/2
16 is the smallest integer > 0 satisfying these inequalities for the first 6 primes.
		

Crossrefs

Companion sequence of A327409.

Programs

  • PARI
    isok(k, vp) = {for (i=1, #vp, if ((k % vp[i]) >= vp[i]/2, return (0));); return (1);}
    a(n) = {my(k=1, vp = primes(n)); while (!isok(k, vp), k++); k;} \\ Michel Marcus, Sep 08 2019

A327409 Smallest integer > 0 so that its remainders modulo the first n primes are at least half their respective moduli.

Original entry on oeis.org

1, 5, 23, 53, 53, 293, 503, 713, 1439, 1439, 16673, 16673, 16673, 16673, 16673, 16673, 16673, 298583, 728153, 728153, 728153, 19420253, 19420253, 66663659, 207178199, 384974819, 384974819, 384974819, 546086693, 546086693, 8504041103, 22060162703, 60826761629, 60826761629
Offset: 1

Views

Author

Bert Dobbelaere, Sep 07 2019

Keywords

Examples

			a(6) = 293.
293 mod 2 = 1 >= 2/2
293 mod 3 = 2 >= 3/2
293 mod 5 = 3 >= 5/2
293 mod 7 = 6 >= 7/2
293 mod 11 = 7 >= 11/2
293 mod 13 = 7 >= 13/2
293 is the smallest integer > 0 satisfying these inequalities for the first 6 primes.
		

Crossrefs

Companion sequence of A327408.

Programs

  • PARI
    isok(k, vp) = {for (i=1, #vp, if ((k % vp[i]) < vp[i]/2, return (0));); return (1);}
    a(n) = {my(k=1, vp = primes(n)); while (!isok(k, vp), k++); k;} \\ Michel Marcus, Sep 08 2019
Showing 1-4 of 4 results.