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!)
A277224 a(1)=1, a(n+1) = a(n) + p, where p is the largest prime < a(n) if a(n) is even and the smallest prime > a(n) if a(n) is odd. 1
1, 3, 8, 15, 32, 63, 130, 257, 520, 1029, 2060, 4113, 8240, 16477, 32958, 65915, 131836, 263633, 527280, 1054553, 2109130, 4218257, 8436528, 16873045, 33746094, 67492171, 134984390, 269968777, 539937558, 1079875091, 2159750220, 4319500381, 8639000780, 17278001533, 34556003072, 69112006095 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Probably a(n) ~ k * 2^n where k is about 1.005712.... - Charles R Greathouse IV, Oct 07 2016, corrected Oct 21 2016
LINKS
EXAMPLE
a(2)=a(1)+2=1+2=3, since a(1)=1 is odd and 2 is the smallest prime >1.
a(3)=3+5=8, since a(2)=3 is odd and 5 is the smallest prime >3.
Then a(4)=8+7=15 since a(3)=8 is even and 7 is the largest prime <8. Etc.
MATHEMATICA
NestList[# + NextPrime[#, -1 + 2 Boole[OddQ@ #]] &, 1, 35] (* Michael De Vlieger, Oct 07 2016 *)
PROG
(PARI) lista(nn)=print1(a = 1, ", "); for (n=2, nn, if (a % 2, a += nextprime(a+1), a += precprime(a-1)); print1(a, ", "); ); \\ Michel Marcus, Oct 07 2016
CROSSREFS
Cf. A277263.
Sequence in context: A295735 A309052 A328858 * A090741 A255835 A032234
KEYWORD
nonn
AUTHOR
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 April 24 12:22 EDT 2024. Contains 371937 sequences. (Running on oeis4.)