OFFSET
1,1
COMMENTS
The greatest prime in a twin primes couple is in the sequence. In fact if the twin primes are a and b, with a<b, b can be written as b=a+2. Being a’=b’=2’=1 we have b’=a’*2’ that is 1=1*1.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..12822 (first 250 terms from Paolo P. Lava)
EXAMPLE
n= 612, x=85, y=527; n’=1056, x’=22, y’=48 and 1056=22*48.
n= 752, x=361, y=391; n’=1520, x’=38, y’=40 and 1520=38*40.
n= 779, x=36, y=743; n’=60, x’=60, y’=1 and 60=60*1.
MAPLE
with(numtheory);
A218011:= proc(i)
local a, b, c, n, p, pfs, q;
for n from 1 to i do
for q from 1 to trunc(n/2) do
a:=q*add(op(2, p)/op(1, p), p= ifactors(q)[2]);
b:=(n-q)*add(op(2, p)/op(1, p), p= ifactors(n-q)[2]);
c:=n*add(op(2, p)/op(1, p), p= ifactors(n)[2]);
if c=a*b then lprint(n, q, n-q); break; fi;
od; od;
end:
A218011(1000000);
MATHEMATICA
dn[0] = 0; dn[1] = 0; dn[n_?Negative] := -dn[-n]; dn[n_] := Module[{f = Transpose[FactorInteger[n]]}, If[PrimeQ[n], 1, Plus @@ (n*f[[2]]/f[[1]])]]; f[n_] := Select[Range[n/2], dn[#]*dn[n - #] == dn[n] &]; Select[Range[535], Length[f[#]] > 0 &] (* T. D. Noe, Oct 18 2012 *)
PROG
(PARI)
up_to = 2^18;
A003415(n) = if(n<=1, 0, my(f=factor(n)); n*sum(i=1, #f~, f[i, 2]/f[i, 1]));
v003415 = vector(up_to, n, A003415(n));
isA218011(n) = { my(z=v003415[n]); for(x=2, ceil(n/2), if(!(z%v003415[x]), if(z==v003415[x]*v003415[n-x], return(1)))); (0); }; \\ Antti Karttunen, Feb 22 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Paolo P. Lava, Oct 18 2012
STATUS
approved