|
|
A302446
|
|
a(n) is the maximum remainder of p*q divided by p+q where p and q are primes with p <= q <= n.
|
|
2
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
2,2
|
|
COMMENTS
|
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, ...
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(2) = 0 because only option is p = q = 2.
a(3) = 3 because 3^2 mod 6 = 3 is the largest remainder.
|
|
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:
|
|
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]
|
|
PROG
|
(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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|