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”).

A151990
If p and q are (odd) twin primes and q > p then p*q^2 + (p + q) + 1 is divisible by 6; a(n) = (p*q^2 + (p + q) + 1)/6.
2
14, 43, 314, 1029, 4655, 12649, 36610, 63084, 178619, 211914, 441209, 566275, 977430, 1185824, 1300299, 1984094, 2313640, 3292695, 3750929, 5078164, 7044274, 12377470, 13468104, 16470839, 23751609, 30919745, 36060100, 39401929
OFFSET
1,1
LINKS
FORMULA
a(n) = A164689(n)/2. a(n) = (p+1)*(p^2 + 3p + 3)/6 where p = A001359(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: A151990 := proc(n) p := A001359(n) ; (p+1)*(p^2+3*p+3)/6 ; end: seq(A151990(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)/6];
Array[a, 28] (* Jean-François Alcover, Mar 31 2020 *)
(#[[1]]#[[2]]^2+#[[1]]+#[[2]]+1)/6&/@Select[Partition[Prime[Range[200]], 2, 1], #[[2]]- #[[1]] == 2&] (* Harvey P. Dale, Jul 06 2024 *)
CROSSREFS
Cf. A164689.
Sequence in context: A302219 A302665 A041380 * A156166 A064125 A089031
KEYWORD
nonn
AUTHOR
Tanin (Mirza Sabbir Hossain Beg) (mirzasabbirhossainbeg(AT)yahoo.com), Aug 22 2009
EXTENSIONS
More terms from R. J. Mathar, Sep 18 2009
STATUS
approved