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.

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

This page as a plain text file.
%I A302446 #26 Apr 09 2018 04:25:44
%S A302446 0,3,3,7,7,11,11,11,11,11,11,23,23,23,23,23,23,35,35,35,35,35,35,35,
%T A302446 35,35,35,43,43,59,59,59,59,59,59,59,59,59,59,69,69,83,83,83,83,83,83,
%U A302446 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
%N A302446 a(n) is the maximum remainder of p*q divided by p+q where p and q are primes with p <= q <= n.
%C A302446 Inspired by A302245.
%C A302446 While A302245 is completely predictable, this sequence behaves relatively complex.
%C A302446 Least positive nonsquarefree term is a(139) = 5^2*11.
%C A302446 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, ...
%C A302446 Numbers n such that a(n) > a(n-1) are 3, 5, 7, 13, 19, 29, 31, 41, 43, 53, 59, ...
%F A302446 If A007917(n) is in A006512, then a(n) = 2*A007917(n) - 3.
%e A302446 a(2) = 0 because only option is p = q = 2.
%e A302446 a(3) = 3 because 3^2 mod 6 = 3 is the largest remainder.
%p A302446 Primes:= {}:
%p A302446 A[2]:= 0:
%p A302446 for n from 3 to 200 do
%p A302446   if not isprime(n) then A[n]:= A[n-1]
%p A302446   else
%p A302446     Primes:= Primes union {n};
%p A302446     A[n]:= max(A[n-1], seq(p*n mod (p+n),p=Primes))
%p A302446   fi
%p A302446 od:
%p A302446 seq(A[n],n=2..200); # _Robert Israel_, Apr 08 2018
%t A302446 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]
%o A302446 (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
%Y A302446 Cf. A006512, A007917, A302245.
%K A302446 nonn,easy
%O A302446 2,2
%A A302446 _Altug Alkan_ and _Andres Cicuttin_, Apr 08 2018