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.

A302446 a(n) is the maximum remainder of p*q divided by p+q where p and q are primes with p <= q <= n.

Original entry on oeis.org

0, 3, 3, 7, 7, 11, 11, 11, 11, 11, 11, 23, 23, 23, 23, 23, 23, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 43, 43, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 69, 69, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 91, 91, 91, 91, 91, 91, 103, 103, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 143, 143, 143, 143
Offset: 2

Views

Author

Altug Alkan and Andres Cicuttin, Apr 08 2018

Keywords

Comments

Inspired by A302245.
While A302245 is completely predictable, this sequence behaves relatively complex.
Least positive nonsquarefree term is a(139) = 5^2*11.
If a(n) > a(n-1), then n is prime and a(n+1) = a(n). Values of a(n) such that a(n+2) > a(n+1) = a(n) > a(n-1) are 3, 7, 43, 69, 103, 259, 343, 463, 523, ...
Numbers n such that a(n) > a(n-1) are 3, 5, 7, 13, 19, 29, 31, 41, 43, 53, 59, ...

Examples

			a(2) = 0 because only option is p = q = 2.
a(3) = 3 because 3^2 mod 6 = 3 is the largest remainder.
		

Crossrefs

Programs

  • Maple
    Primes:= {}:
    A[2]:= 0:
    for n from 3 to 200 do
      if not isprime(n) then A[n]:= A[n-1]
      else
        Primes:= Primes union {n};
        A[n]:= max(A[n-1], seq(p*n mod (p+n),p=Primes))
      fi
    od:
    seq(A[n],n=2..200); # Robert Israel, Apr 08 2018
  • Mathematica
    a[n_] := Max@ Flatten@ Table[p=Prime[i]; q=Prime[j]; Mod[p q, p + q], {i, PrimePi[n]}, {j, i}]; Array[a, 75, 2]
  • PARI
    first(n) = {my(t = 1, u = nextprime(n+1), bet = vector(primepi(u)), res = List(vector(u)), p, q); forprime(p = 2, u, forprime(q = 2, p, r = (p*q) % (p+q); for(i = t, #bet, bet[i] = max(bet[i], r))); t++); t = 1; p = 2; forprime(q = 3, u, for(i = p, q - 1, res[i] = bet[t]); p = q; t++); res[u] = bet[t]; listpop(res,1); res} \\ David A. Corneth, Apr 08 2018

Formula

If A007917(n) is in A006512, then a(n) = 2*A007917(n) - 3.

A302706 a(n) is the maximum remainder of x^2 + y^2 divided by x + y with 0 < x <= y <= n.

Original entry on oeis.org

0, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 16, 18, 18, 18, 26, 27, 28, 29, 30, 32, 32, 33, 34, 35, 40, 40, 40, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 72, 72, 72, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 98, 98, 98, 98, 98, 98, 99, 100, 104, 104, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132
Offset: 1

Views

Author

Altug Alkan and Andres Cicuttin, Apr 12 2018

Keywords

Comments

Values of a(n) such that a(n) is prime are 2, 3, 5, 11, 13, 29, 53, 59, 61, 83, 89, 127, 131, 137, 139, 173, ...
Conjecture: lim_{n->inf} a(n)/(2n) = 1, with both variables x and y taking values asymptotically close to n. - Andres Cicuttin, Oct 18 2018

Examples

			a(1) = 0 because x = y = 1 is only option.
a(13) = a(14) = a(15) = 18 because (7^2 + 13^2) mod (7 + 13) = 18 is the largest corresponding remainder for them.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Table[Table[Mod[x^2+y^2 ,x+y],{x,1,y}],{y,1,n}]//Flatten//Max;
    Table[a[n],{n,1,100}]
  • PARI
    a(n) = vecmax(vector(n, x, vecmax(vector(x, y, (x^2+y^2) % (x+y))))); \\ after Michel Marcus at A302245

A302754 Maximum remainder of prime(p) + prime(q) divided by p + q with p <= q <= n.

Original entry on oeis.org

0, 2, 4, 6, 6, 6, 6, 6, 10, 18, 18, 22, 22, 24, 24, 24, 24, 24, 24, 24, 24, 26, 28, 34, 44, 46, 46, 46, 46, 46, 57, 58, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 62, 62, 62, 62, 62, 62, 70, 74, 78, 82, 82, 82, 82, 82, 90, 110, 110, 110, 110, 126, 130, 136, 138, 138, 142, 142, 142, 142
Offset: 1

Views

Author

Andres Cicuttin and Altug Alkan, Apr 12 2018

Keywords

Comments

Odd numbers k which are terms of this sequence are 57, 61, 353, 2113, ...
Approximate self-similar growing patterns appear at different scales which suggest a fractal-like structure, see plots in Links section.

Examples

			a(1) = 0 because only option is p = q = 1.
a(4) = a(8) = 6 because (prime(4) + prime(4)) mod 8 = (prime(8) + prime(7)) mod 15 = 6 is the largest remainder for both.
a(31) = 57 because (prime(28) + prime(31)) mod 59 = 57 is the largest remainder.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Table[Table[Mod[Prime[j]+Prime[i],i+j],{i,1,j}],{j,1,n}]//Flatten//Max;
    Table[a[n],{n,1,100}]
  • PARI
    a(n) = vecmax(vector(n, q, vecmax(vector(q, p, (prime(p)+prime(q)) % (p+q)))));
Showing 1-3 of 3 results.