login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A008348 a(n) = a(n-1)-prime(n) if a(n-1)>=prime(n) else a(n-1)+prime(n). 3
0, 2, 5, 0, 7, 18, 5, 22, 3, 26, 55, 24, 61, 20, 63, 16, 69, 10, 71, 4, 75, 2, 81, 164, 75, 172, 71, 174, 67, 176, 63, 190, 59, 196, 57, 206, 55, 212, 49, 216, 43, 222, 41, 232, 39, 236, 37, 248, 25, 252, 23, 256, 17, 258, 7, 264, 1, 270, 541, 264, 545, 262, 555 (list; graph; refs; listen; history; internal format)
OFFSET

0,2

FORMULA

a(n) = c(1)p(1)+...+c(n)p(n), where c(i) = 1 if a(i-1) > p(i) and c(i) = -1 if a(i-1) <= p(i) (p(i) = primes). (Kimberling)

MAPLE

A008348 := proc(n) option remember; if n = 0 then 0 elif A008348(n-1)>=ithprime(n) then A008348(n-1)-ithprime(n); else A008348(n-1)+ithprime(n); fi; end;

MATHEMATICA

a := {0}; For[n = 2, n < 100, n++, If[a[[n - 1]] >= Prime[n - 1], b := a[[n - 1]] - Prime[n - 1], b := a[[n - 1]] + Prime[n - 1]; ]; a = Append[a, b]]; a - Stefan Steinerberger (stefan.steinerberger(AT)gmail.com), May 02 2006

CROSSREFS

Sequence in context: A096319 A146105 A022832 * A201576 A020836 A111466

Adjacent sequences:  A008345 A008346 A008347 * A008349 A008350 A008351

KEYWORD

nonn

AUTHOR

N. J. A. Sloane (njas(AT)research.att.com) and J. H. Conway (conway(AT)math.princeton.edu)

EXTENSIONS

More terms from Clark Kimberling (ck6(AT)evansville.edu)

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 16 08:13 EST 2012. Contains 205893 sequences.