OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
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
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