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.

A109832 Number d such that (A109833(n)+k*d: 0<=k<=A109831(n)) is an arithmetic progression of primes.

Original entry on oeis.org

1, 2, 2, 4, 6, 6, 8, 6, 6, 14, 18, 12, 12, 18, 12, 18, 24, 30, 34, 30, 6, 12, 42, 30, 30, 30, 18, 48, 30, 30, 30, 66, 36, 48, 24, 30, 12, 54, 42, 78, 54, 60, 42, 48, 60, 104, 72, 30, 66, 60, 66, 30, 60, 30, 12, 6, 30, 120, 90, 60, 60, 78, 60, 102, 90, 90, 138, 108, 36
Offset: 2

Views

Author

Reinhard Zumkeller, Jul 04 2005

Keywords

Comments

a(n) = (A000040(n) - A109833(n)) / A109831(n).

A109833 Smallest prime starting an arithmetic progression meeting also prime(n) and having a maximal number of terms less than prime(n).

Original entry on oeis.org

2, 3, 3, 3, 7, 5, 3, 5, 5, 3, 19, 5, 7, 11, 5, 5, 13, 7, 3, 13, 61, 47, 5, 7, 11, 13, 53, 13, 23, 7, 11, 5, 31, 5, 79, 7, 127, 5, 5, 23, 19, 11, 67, 5, 19, 3, 7, 107, 31, 53, 41, 151, 11, 107, 227, 251, 151, 37, 11, 43, 53, 73, 11, 7, 47, 61, 61, 23, 241, 53, 71, 277, 13
Offset: 2

Views

Author

Reinhard Zumkeller, Jul 04 2005

Keywords

Comments

a(n) = A000040(n) - A109831(n) * A109832(n).

A333600 a(n) is the greatest possible length of a list of pairwise coprime distinct positive integers in arithmetic progression with greatest element n.

Original entry on oeis.org

1, 2, 3, 2, 3, 2, 4, 2, 3, 2, 4, 2, 5, 2, 3, 2, 5, 2, 5, 2, 3, 2, 5, 2, 5, 2, 3, 2, 5, 2, 6, 2, 3, 2, 5, 2, 7, 2, 3, 2, 6, 2, 8, 2, 3, 2, 7, 2, 7, 2, 3, 2, 8, 2, 5, 2, 3, 2, 9, 2, 6, 2, 3, 2, 5, 2, 7, 2, 3, 2, 6, 2, 8, 2, 3, 2, 7, 2, 9, 2, 3, 2, 8, 2, 5, 2, 3
Offset: 1

Views

Author

Rémy Sigrist, Mar 28 2020

Keywords

Comments

The Green-Tao theorem implies that this sequence is unbounded.

Examples

			The first terms, alongside a corresponding list, are:
  n   a(n)  List
  --  ----  ----
   1     1  (1)
   2     2  (1, 2)
   3     3  (1, 2, 3)
   4     2  (3, 4)
   5     3  (1, 3, 5)
   6     2  (5, 6)
   7     4  (1, 3, 5, 7)
   8     2  (7, 8)
   9     3  (7, 8, 9)
  10     2  (9, 10)
  11     4  (5, 7, 9, 11)
  12     2  (11, 12)
  13     5  (5, 7, 9, 11, 13)
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local d, m, p, x, mmax;
      if n::even then return 2 fi;
      if n mod 3 = 0 then return 3 fi;
      mmax:= 1;
      for d from 1 to n-1 do
        if n <= mmax*d then return mmax fi;
        p:= n;
        for m from 1 to n/d do
          x:= n - d*m;
          if igcd(x,p) > 1 then break fi;
          p:= p*x;
        od;
        mmax:= max(mmax, m)
      od;
    end proc:
    f(1):= 1:
    map(f, [$1..100]); # Robert Israel, Apr 03 2020
  • Mathematica
    a[n_] := Module[{d, m, p, x, mmax}, If[EvenQ[n], Return[2]]; If[Mod[n, 3] == 0, Return[3]]; mmax = 1; For[d = 1, d <= n-1, d++, If[n <= mmax d, Return[mmax]]; p = n; For[m = 1, m <= n/d, m++, x = n - d m; If[GCD[x, p] > 1, Break[]]; p = p x]; mmax = Max[mmax, m]]];
    a[1] = 1;
    Array[a, 100] (* Jean-François Alcover, Oct 25 2020, after Robert Israel *)
  • PARI
    a(n) = { if (n%2==0, return (2), my (v=1); for (s=1, n-1, if (v>=ceil(n/s), break); my (p=1, w=0); forstep (k=n, 1, -s, if (gcd(p,k)==1, p*=k; w++, break)); v=max(v,w)); return (v)) }

Formula

a(2*n) = 2 for any n > 0.
a(prime(n)) > A109831(n) for any n > 1.
a(n) <= A020639(n) for n > 1. - Robert Israel, Apr 03 2020
Showing 1-3 of 3 results.