login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A051353 a(n) = a(n-1) + n^2 if n prime else a(n-1) - n. 1
0, -1, 3, 12, 8, 33, 27, 76, 68, 59, 49, 170, 158, 327, 313, 298, 282, 571, 553, 914, 894, 873, 851, 1380, 1356, 1331, 1305, 1278, 1250, 2091, 2061, 3022, 2990, 2957, 2923, 2888, 2852, 4221, 4183, 4144, 4104, 5785, 5743, 7592, 7548 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
FORMULA
a(n) = a(n-1) + n*(A010051(n)*(n+1)-1). - Reinhard Zumkeller, Aug 13 2013
MATHEMATICA
nxt[{n_, a_}]:={n+1, If[PrimeQ[n+1], a+(n+1)^2, a-(n+1)]}; Transpose[ NestList[ nxt, {0, 0}, 50]][[2]] (* Harvey P. Dale, Dec 12 2012 *)
PROG
(Haskell)
a051353 n = a051353_list !! n
a051353_list = 0 : zipWith (+) a051353_list
(zipWith (\chi x -> x * (chi * (x + 1) - 1)) a010051_list [1..])
-- Reinhard Zumkeller, Aug 13 2013
CROSSREFS
Sequence in context: A337203 A013188 A234947 * A070706 A239932 A114237
KEYWORD
sign,easy,nice
AUTHOR
Armand Turpel armandt(AT)unforgettable.com
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 19 03:15 EDT 2024. Contains 374388 sequences. (Running on oeis4.)