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-5 of 5 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

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

A306613 First differences of A063990 (amicable numbers arranged in increasing order).

Original entry on oeis.org

64, 900, 26, 1410, 304, 2096, 544, 668, 136, 4376, 112, 1429, 2310, 2701, 1120, 44604, 3908, 64, 103, 2520, 1530, 4939, 3666, 7883, 1097, 11755, 21780, 103, 784, 1003, 15660, 1849, 646, 10866, 15554, 3126, 4416, 64, 4512, 4520, 11356, 5720, 988, 77108, 28080, 10930
Offset: 1

Views

Author

Conor Coons, Feb 28 2019

Keywords

Comments

a(n) is the difference between the n-th and (n+1)-th amicable numbers when ordered by increasing value.
For 1 <= k <= 8, a(2k-1) is the difference between the larger and the smaller terms of the k-th amicable pair, and for 1 <= k <= 8, a(2k) is the difference between the smaller term of the (k+1)-th pair and the larger term of the k-th pair. Beginning with the 9th pair (63020,76084), the pairs ordered by their first element are no longer adjacent. - Bernard Schott, Mar 09 2019

Examples

			a(2) = amicable(3) - amicable(2) = 1184 - 284 = 900.
From _Bernard Schott_, Mar 10 2019: (Start)
a(1) = 284 - 220 = 64 is the difference between the larger and the smaller terms of the first amicable pair.
a(4) = 2620 - 1210 = 1410 is the difference between the smaller term of the third amicable pair and the larger term of the second amicable pair. (End)
		

Crossrefs

Cf. A063990 (amicable numbers), A306612.
Cf. A066539 (difference between larger and smaller terms of n-th amicable pair).
Cf. A139228 (first differences of perfect numbers).

Programs

  • MATLAB
    clear
    clc
    A = zeros(100000,1);
    parfor n = 1:1:100000
         f = find(rem(n, 1:floor(sqrt(n))) == 0);
         f = unique([1, n, f, fix(n./f)]);
         A(n) = sum(f) - n;
    end
    D = [];
    d = 1;
    for a = 1:1:100000
        for b = 1:1:100000
            if A(a) == b && A(b) == a && a~=b
                D(d) = a;
                d = d+1;
            end
        end
    end
    D
    difference = diff(D)

Formula

a(n) = A063990(n+1) - A063990(n). - Michel Marcus, Apr 08 2019

Extensions

More terms from Michel Marcus, Mar 09 2019
Showing 1-5 of 5 results.