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!)
A226159 a(n) = -prime(n) if prime(n) is an irregular prime else prime(n). 0

%I #10 Mar 24 2022 12:48:05

%S 2,3,5,7,11,13,17,19,23,29,31,-37,41,43,47,53,-59,61,-67,71,73,79,83,

%T 89,97,-101,-103,107,109,113,127,-131,137,139,-149,151,-157,163,167,

%U 173,179,181,191,193,197,199,211,223,227,229,-233,239,241,251,-257,-263

%N a(n) = -prime(n) if prime(n) is an irregular prime else prime(n).

%t 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 *)

%o (Sage)

%o def A226159_list(len):

%o t = [0]*(len+1); t[0] = 1; L = [2]; p = 1

%o for m in (1..len):

%o q = m + 1; t[m] = 1 / q

%o for j in range(m, 0, -1) :

%o t[j - 1] = (t[j - 1] - t[j]) * j

%o if 2.divides(m):

%o if q.divides(denominator(t[0])):

%o if q.divides(p): q = -q

%o L.append(q)

%o p *= numerator(t[0])

%o return L

%o A226159_list(263)

%Y Cf. A000040, A000928.

%K sign

%O 1,1

%A _Peter Luschny_, Jun 27 2013

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 15 05:46 EDT 2024. Contains 372538 sequences. (Running on oeis4.)