The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A083236 First order recursion: a(0)=2; a(n) = prime(n) - a(n-1). 6

%I #21 Nov 07 2022 13:45:49

%S 2,0,3,2,5,6,7,10,9,14,15,16,21,20,23,24,29,30,31,36,35,38,41,42,47,

%T 50,51,52,55,54,59,68,63,74,65,84,67,90,73,94,79,100,81,110,83,114,85,

%U 126,97,130,99,134,105,136,115,142,121,148,123,154,127,156,137,170,141,172,145

%N First order recursion: a(0)=2; a(n) = prime(n) - a(n-1).

%H Seiichi Manyama, <a href="/A083236/b083236.txt">Table of n, a(n) for n = 0..10000</a>

%F a(n-1) + a(n) = prime(n).

%F a(n+1)-a(n-1) = A001223(n).

%e n=6: a(6)+a(7) = 7+10 = prime(7) = 17 and a(7)+a(8) = 10+9 = 19 = prime(8);

%p A083236 := proc(n)

%p option remember ;

%p if n = 0 then

%p 2 ;

%p else

%p ithprime(n)-procname(n-1) ;

%p end if;

%p end proc:

%p seq(A083236(n),n=0..100) ; # _R. J. Mathar_, Jun 20 2021

%t RecursionLimit$=10000; f[x_] := Prime[x]-f[x-1]; f[0]=2; Table[f[w], {w, 1, 100}]

%t Join[{0},Abs[Accumulate[Table[Prime[n](-1)^n,{n,2,70}]]]] (* _Harvey P. Dale_, Nov 20 2013 *)

%o (PARI) lista(nn) = {my(last = 2, new, v=vector(nn)); for (n=1, nn, v[n] = prime(n) - last; last = v[n];); v;} \\ _Michel Marcus_, Mar 27 2020

%Y Cf. A000040, A001223.

%K nonn

%O 0,1

%A _Labos Elemer_, Apr 23 2003

%E a(0) prepended. - _R. J. Mathar_, Jun 20 2021

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 June 5 10:35 EDT 2024. Contains 373105 sequences. (Running on oeis4.)