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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A036467 a(n) + a(n-1) = n-th prime. 8
1, 1, 2, 3, 4, 7, 6, 11, 8, 15, 14, 17, 20, 21, 22, 25, 28, 31, 30, 37, 34, 39, 40, 43, 46, 51, 50, 53, 54, 55, 58, 69, 62, 75, 64, 85, 66, 91, 72, 95, 78, 101, 80, 111, 82, 115, 84, 127, 96, 131, 98, 135, 104, 137, 114, 143, 120, 149, 122, 155, 126, 157, 136, 171, 140, 173 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

After the initial 1,1, this sequence contains no duplicate values: terms thereafter have opposite parity, and a(n+2) > a(n). Do even and odd values trade the lead infinitely often? (We would expect them to if we model their difference as a random walk.) - Franklin T. Adams-Watters, Jan 25 2010

LINKS

T. D. Noe, Table of n, a(n) for n = 0..2000

MATHEMATICA

a[n_] := Abs[1+Sum[(-1)^(k+1)*Prime[k], {k, 2, n}]]; a /@ Range[0, 65] (* Jean-Fran├žois Alcover, Apr 22 2011 *)

t={1, 1}; Do[AppendTo[t, NextPrime[t[[-2]]+t[[-1]]]-t[[-1]]], {n, 64}]; t (* Vladimir Joseph Stephan Orlovsky, Jan 26 2012 *)

Transpose[NestList[{First[#]+1, Prime[First[#]+1]-Last[#]}&, {0, 1}, 70]][[2]] (* Harvey P. Dale, Sep 14 2012 *)

PROG

(MAGMA) [n lt 2 select 1 else NthPrime(n)-NthPrime(n-1)+Self(n-1): n in [0..65]];  // Bruno Berselli, Jun 18 2011

(PARI) print1(t=1); forprime(p=2, 1e3, print1(", ", t=p-t)) \\ Charles R Greathouse IV, Jun 18, 2011

(Haskell)

a036467 n = a036467_list !! n

a036467_list = 1 : zipWith (-) a000040_list a036467_list

-- Reinhard Zumkeller, Nov 02 2011

CROSSREFS

Cf. A001223, A008347.

Sequence in context: A106442 A091204 A106446 * A006875 A064554 A290641

Adjacent sequences:  A036464 A036465 A036466 * A036468 A036469 A036470

KEYWORD

nonn,easy,nice

AUTHOR

Maghraoui Abdelkader

EXTENSIONS

More terms from Jud McCranie

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy .

Last modified February 23 07:47 EST 2018. Contains 299473 sequences. (Running on oeis4.)