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!)
A336236 a(n) = prime(n-2) - a(n-2) for n > 2, starting with a(1)=1, a(2)=1. 0
1, 1, 1, 2, 4, 5, 7, 8, 10, 11, 13, 18, 18, 19, 23, 24, 24, 29, 35, 32, 32, 39, 41, 40, 42, 49, 55, 52, 48, 55, 61, 58, 66, 73, 71, 66, 78, 85, 79, 78, 88, 95, 91, 86, 100, 107, 97, 92, 114, 131, 113, 98, 120, 141, 121, 110, 136, 153, 133, 118, 144, 163, 139, 130 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
LINKS
EXAMPLE
a(3) = prime(1) - a(1) = 2 - 1 = 1,
a(4) = prime(2) - a(2) = 3 - 1 = 2,
a(5) = prime(3) - a(3) = 5 - 1 = 4,
a(6) = prime(4) - a(4) = 7 - 2 = 5,
a(7) = prime(5) - a(5) = 11 - 4 = 7,
a(8) = prime(6) - a(6) = 13 - 5 = 8,
a(9) = prime(7) - a(7) = 17 - 7 = 10.
MATHEMATICA
a[1] = a[2] = 1; a[n_] := a[n] = Prime[n - 2] - a[n - 2] ; Array[a, 100] (* Amiram Eldar, Jul 16 2020 *)
PROG
(Ruby) require 'prime'
values = [1, 1]
Prime.each(500) {|prime| values << prime - values[-2] }
p values
(PARI) a(n) = if (n<=2, 1, prime(n-2) - a(n-2)); \\ Michel Marcus, Jul 16 2020
CROSSREFS
Sequence in context: A288521 A067940 A230286 * A215099 A022768 A229973
KEYWORD
nonn
AUTHOR
Simon Strandgaard, Jul 13 2020
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 29 14:21 EDT 2024. Contains 374734 sequences. (Running on oeis4.)