login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A164689
If p and q are (odd) twin primes and q > p then p*q^2+(p+q)+1 is divisible by 3; a(n) = (p*q^2+(p+q)+1)/3.
2
28, 86, 628, 2058, 9310, 25298, 73220, 126168, 357238, 423828, 882418, 1132550, 1954860, 2371648, 2600598, 3968188, 4627280, 6585390, 7501858, 10156328, 14088548, 24754940, 26936208, 32941678, 47503218, 61839490, 72120200
OFFSET
1,1
FORMULA
a(n) = 2*A151990(n). - R. J. Mathar, Sep 18 2009
MAPLE
A001359 := proc(n) if n = 1 then 3; else for p from procname(n-1)+2 by 2 do if isprime(p) and isprime(p+2) then RETURN(p) ; fi; od: fi; end: A164689 := proc(n) p := A001359(n) ; (p+1)*(p^2+3*p+3)/3 ; end: seq(A164689(n), n=1..80) ; # R. J. Mathar, Sep 18 2009
MATHEMATICA
(* b = A001359 *)
b[n_] := b[n] = If[n == 1, 3, Module[{p = NextPrime[b[n - 1]]}, While[ !PrimeQ[p + 2], p = NextPrime[p]]; p]];
a[n_] := With[{p = b[n]}, (p + 1)(p^2 + 3 p + 3)/3];
Array[a, 27] (* Jean-François Alcover, Mar 31 2020 *)
CROSSREFS
Cf. A151990.
Sequence in context: A042540 A042544 A042546 * A096384 A065655 A341623
KEYWORD
nonn
AUTHOR
Tanin (Mirza Sabbir Hossain Beg) (mirzasabbirhossainbeg(AT)yahoo.com), Aug 22 2009
EXTENSIONS
Incorrect leading term deleted by N. J. A. Sloane, Sep 14 2009
More terms from R. J. Mathar, Sep 18 2009
STATUS
approved