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

A258326
a(1) = 3; for n > 1, a(n) = a(n-1) + prime(n+2) - 2*prime(n+1) + 2*prime(n) - prime(n-1).
0
3, 4, 8, 8, 14, 14, 20, 24, 24, 34, 34, 38, 44, 48, 52, 54, 64, 64, 68, 76, 76, 84, 90, 92, 98, 104, 104, 110, 122, 116, 132, 132, 146, 140, 154, 156, 160, 168, 172, 174, 188, 182, 194, 194, 208, 210, 214, 224, 230, 234, 234, 248, 246, 256, 262, 264, 274, 274
OFFSET
1,1
COMMENTS
Conjecture: except for a(3)=8 and a(8)=24, this is the same as A073271.
FORMULA
For n>1, a(n) = a(n-1) - A062234(n+1) + A062234(n). - Michel Marcus, May 31 2015
MATHEMATICA
f[n_] := Block[{a = {3}}, g[x_] := a[[x - 1]] + Prime[x + 2] - 2 Prime[x + 1] + 2 Prime@ x - Prime[x - 1]; Do[AppendTo[a, g@ k], {k, 2, n}]; a]; f@ 60 (* Michael De Vlieger, Jun 02 2015 *)
RecurrenceTable[{a[1]==3, a[n]==a[n-1]+Prime[n+2]-2Prime[n+1]+2Prime[n]-Prime[n-1]}, a, {n, 60}] (* Harvey P. Dale, Mar 25 2019 *)
PROG
(PARI) v=[3]; n=2; while(n<50, v=concat(v, v[#v]+prime(n+2) - 2*prime(n+1)+2*prime(n)-prime(n-1)); n++); v \\ Derek Orr, May 30 2015
CROSSREFS
Sequence in context: A065309 A097689 A349609 * A308769 A002246 A310016
KEYWORD
nonn,easy
AUTHOR
Gionata Neri, May 26 2015
STATUS
approved