OFFSET
1,1
COMMENTS
a(n) are the primes in A163077.
LINKS
Peter Luschny, Die schwingende Fakultät und Orbitalsysteme, August 2011.
Peter Luschny, Swinging Primes.
EXAMPLE
5 is prime and 5$ + 1 = 30 + 1 = 31 is prime, so 5 is in the sequence.
MAPLE
a := proc(n) select(isprime, select(k -> isprime(A056040(k)+1), [$0..n])) end:
MATHEMATICA
f[n_] := 2^(n - Mod[n, 2])*Product[k^((-1)^(k + 1)), {k, n}]; p = 2; lst = {}; While[p < 38000, a = f@p + 1; If[ PrimeQ@a, AppendTo[ lst, p]; Print@p]; p = NextPrime@p]; lst (* Robert G. Wilson v, Aug 08 2010 *)
PROG
(PARI) is(k) = isprime(k) && ispseudoprime(1+k!/(k\2)!^2); \\ Jinyuan Wang, Mar 22 2020
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Peter Luschny, Jul 21 2009
EXTENSIONS
a(8)-a(12) from Robert G. Wilson v, Aug 08 2010
STATUS
approved