login
A226159
a(n) = -prime(n) if prime(n) is an irregular prime else prime(n).
0
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, -37, 41, 43, 47, 53, -59, 61, -67, 71, 73, 79, 83, 89, 97, -101, -103, 107, 109, 113, 127, -131, 137, 139, -149, 151, -157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, -233, 239, 241, 251, -257, -263
OFFSET
1,1
MATHEMATICA
regularQ[p_]:= And @@ (!Divisible[ Numerator[ BernoulliB[#]], p] & /@ Range[2, p - 3, 2]); Table[p = Prime[n]; If[ regularQ[p], p, -p], {n, 1, 56}] (*Jean-François Alcover,Jul 02 2013 *)
PROG
(Sage)
defA226159_list(len):
t = [0]*(len+1); t[0] = 1; L = [2]; p = 1
for m in (1..len):
q = m + 1; t[m] = 1 / q
for j in range(m, 0, -1):
t[j - 1] = (t[j - 1] - t[j]) * j
if 2.divides(m):
if q.divides(denominator(t[0])):
if q.divides(p): q = -q
L.append(q)
p *= numerator(t[0])
return L
A226159_list(263)
KEYWORD
sign
AUTHOR
Peter Luschny,Jun 27 2013
STATUS
approved