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

A341805 Numbers k such that (product of first k primes)-1 is divisible by the (k+1)-th prime.

Original entry on oeis.org

0, 2, 4, 9823712
Offset: 1

Views

Author

Jeppe Stig Nielsen, Feb 20 2021

Keywords

Examples

			4 is a member because 2*3*5*7-1 (product of first 4 primes, minus one) is divisible by the 5th prime, 11.
9823712 is a member because 2*3*5*...*176078267-1 is divisible by 176078293, where 176078267 is the 9823712th prime.
		

Crossrefs

Programs

  • PARI
    isok(k) = ((vecprod(primes(k)) - 1) % prime(k+1)) == 0; \\ Michel Marcus, Mar 03 2021

Formula

a(n) = A000720(A341804(n)) - 1.

A343404 For any number n with representation (d_w, ..., d_1) in primorial base, a(n) is the least number m such that m mod prime(k) = d_k for k = 1..w (where prime(k) denotes the k-th prime number).

Original entry on oeis.org

0, 1, 4, 1, 2, 5, 6, 21, 16, 1, 26, 11, 12, 27, 22, 7, 2, 17, 18, 3, 28, 13, 8, 23, 24, 9, 4, 19, 14, 29, 120, 15, 190, 85, 50, 155, 36, 141, 106, 1, 176, 71, 162, 57, 22, 127, 92, 197, 78, 183, 148, 43, 8, 113, 204, 99, 64, 169, 134, 29, 30, 135, 100, 205
Offset: 0

Views

Author

Rémy Sigrist, Apr 14 2021

Keywords

Comments

Leading zeros in primorial base expansions are ignored.
The Chinese remainder theorem ensures that this sequence is well defined and provides a way to compute it.

Examples

			For n = 42 :
- the expansion of 42 in primary base is "1200",
- so a(42) mod 2 = 0 => a(42) = 2*t for some t >= 0,
     a(42) mod 3 = 0 => a(42) = 6*u for some u >= 0,
     a(42) mod 5 = 2 => a(42) = 12 + 30*v for some v >= 0,
     a(42) mod 7 = 1 => a(42) = 162 + 210*w for some w >= 0,
- we choose w=0 so as to minimize the value,
- hence a(42) = 162.
		

Crossrefs

Cf. A002110, A079276, A143293, A235168, A343405 (fixed points).

Programs

  • PARI
    a(n) = { my (v=Mod(0,1)); forprime (p=2, oo, if (n==0, return (lift(v)), v=chinese(v, Mod(n, p)); n\=p)) }

Formula

a(n) = 1 iff n belongs to A143293.
a(n) = n iff n belongs to A343405.
a(n) < A002110(k) for any n < A002110(k) and k >= 0.
a(A002110(k)) = A079276(k+1) * A002110(k) for any k >= 0.

A240673 Triangle read by rows: T(n, k) = v(n, k)*((1/v(n, k)) mod prime(k)), where v(n, k) = (Product_{j=1..n} prime(j))/prime(k), n >= 1, 1 <= k <= n.

Original entry on oeis.org

1, 3, 4, 15, 10, 6, 105, 70, 126, 120, 1155, 1540, 1386, 330, 210, 15015, 20020, 6006, 25740, 16380, 6930, 255255, 170170, 306306, 145860, 46410, 157080, 450450, 4849845, 3233230, 3879876, 8314020, 6172530, 3730650, 9129120, 9189180
Offset: 1

Views

Author

Michel Marcus, Apr 10 2014

Keywords

Comments

These coefficients have the following property: for any number j in 0..primorial(n)-1, j = Sum_{i=1..n} T(n,k)*(j mod prime(i)) mod primorial(n). For example, with the first 3 primes (2, 3, and 5) and j=47, j is [47 mod 2, 47 mod 3, 47 mod 5] = [1, 2, 2], and 15*1 + 10*2 + 6*2 = 15 + 20 + 12 = 47.

Examples

			Triangle starts:
     1;
     3,    4;
    15,   10,    6;
   105,   70,  126,  120;
  1155, 1540, 1386,  330,  210;
		

Crossrefs

Cf. A000040 (primes), A002110 (primorials), A070826 (first column), A079276.

Programs

  • Maple
    T := proc(n, k)
    v := mul(ithprime(j), j=1..n)/ithprime(k);
    v * ((1/v) mod ithprime(k)) end:
    seq(print(seq(T(n,k), k=1..n)), n=1..7); # Peter Luschny, Apr 12 2014
  • Mathematica
    lift[Rational[1, n_], p_] := Module[{m}, m /. Solve[n*m == 1, m, Modulus -> p][[1]]]; lift[1, 2] = 1;
    v[n_, k_] := Product[Prime[j], {j, 1, n}]/Prime[k];
    T[n_, k_] := v[n, k]*lift[1/v[n, k], Prime[k]];
    Table[T[n, k], {n, 1, 8}, {k, 1, n}] // Flatten (* Jean-François Alcover, Nov 30 2017 *)
  • PARI
    T(n, k) = {my(val = prod(j=1, n, prime(j))/prime(k)); val * lift(1/Mod(val, prime(k)));}

Formula

T(n, k) = v(n, k) * ((1/v(n, k)) mod prime(k)), where v(n, k) = Product_{j=1..n} prime(j)/prime(k).
T(n, n) = A002110(n-1) * A079276(n). - Peter Luschny, Apr 12 2014
Showing 1-3 of 3 results.