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!)
A338398 Inverse boustrophedon transform of the primes. 1
2, 1, 1, -3, -1, -29, 33, -315, 1251, -7905, 48667, -344723, 2623549, -21739937, 193680399, -1849767375, 18840708855, -203907377005, 2336594492591, -28262970918841, 359855118160333, -4810909461068941, 67379837645787507, -986592769520379701 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
LINKS
Eric Weisstein's World of Mathematics, Boustrophedon Transform
FORMULA
a(n) = Sum_{k=0..n} (-1)^(n-k) * binomial(n,k) * A000111(n-k) * A000040(k+1).
PROG
(Python)
import sympy
def A338398(n):
T=[]
for k in range(n+1):
T.append(sympy.prime(k+1))
T.reverse()
for i in range(k):
T[i+1]=T[i]-T[i+1]
return T[-1]
(Python)
from itertools import accumulate, islice, count
from operator import sub
from sympy import prime
def A338398_gen(): # generator of terms
blist = tuple()
for i in count(1):
yield (blist := tuple(accumulate(reversed(blist), func=sub, initial=prime(i))))[-1]
A338398_list = list(islice(A338398_gen(), 20)) # Chai Wah Wu, Jun 10 2022
CROSSREFS
Sequence in context: A318833 A173937 A046223 * A192181 A073463 A183568
KEYWORD
sign
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 May 21 14:18 EDT 2024. Contains 372738 sequences. (Running on oeis4.)