login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A119556 Primes in the sequence f(n+1) = f(n)+((-1)^(n+1))*n!, with f(1)=0. 1
5, 101, 4421, 1226280710981, 115578717622022981, 32656499591185747972776747396512425885838364422981, 136372385605079432248118270297843987319730859689490659519593045108637838364422981 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

The tenth term has 1579 digits. - Harvey P. Dale, Sep 10 2018

REFERENCES

G. Balzarotti and P. P. Lava, Le sequenze di numeri interi, Hoepli, 2008, p. 160.

LINKS

Harvey P. Dale, Table of n, a(n) for n = 1..9

EXAMPLE

f(0)=0, f(1) = 0+((-1)^2)*1! = 1, f(2) = 1+((-1)^3)*2! = -1, f(3) = -1+((-1)^4)*3! = 5, which is prime, so 5 is the first term of the sequence.

MAPLE

P:=proc(n) local i, j; j:=0; for i from 1 by 1 to n do j:=j+((-1)^(i+1))*i!; if isprime(j) then print(i); fi; od; end: P(100);

MATHEMATICA

nxt[{n_, a_}]:={n+1, a+(-1)^(n+1) n!}; Select[NestList[nxt, {1, 0}, 205][[All, 2]], #>0 && PrimeQ[#]&] (* Harvey P. Dale, Sep 10 2018 *)

CROSSREFS

Sequence in context: A266452 A074790 A009757 * A009765 A113073 A275749

Adjacent sequences:  A119553 A119554 A119555 * A119557 A119558 A119559

KEYWORD

nonn,easy

AUTHOR

Paolo P. Lava and Giorgio Balzarotti, May 30 2006

EXTENSIONS

Offset changed to 1 (this is a list) from Bruno Berselli, Feb 16 2012

Definition corrected by Harvey P. Dale, Sep 10 2018

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
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 3 13:49 EDT 2020. Contains 336198 sequences. (Running on oeis4.)