|
|
A268428
|
|
a(n) = (3*(n^2+n+99)+cos(Pi*n/2)-sin(Pi*n/2))/2.
|
|
2
|
|
|
149, 151, 157, 167, 179, 193, 211, 233, 257, 283, 313, 347, 383, 421, 463, 509, 557, 607, 661, 719, 779, 841, 907, 977, 1049, 1123, 1201, 1283, 1367, 1453, 1543, 1637, 1733, 1831, 1933, 2039, 2147, 2257, 2371, 2489, 2609, 2731, 2857, 2987, 3119
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
First 20 terms are primes with periodic second order differences (4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4) which continue onwards.
The number of prime and nonprime terms is equal at a(1809): 905, a(1811): 906, a(1817): 909, a(1819): 910, a(1821): 911, a(1823): 912, a(1825): 913, a(1827): 914, a(1829): 915, and at a(1837): 919 (i.e. 919 prime and 919 nonprime terms among the total 1838 terms).
Single longer blocks containing only primes include 20, 14, 12, and 11 terms (in range n=0...10^8) while the longest block of nonprime terms in this range has length 78.
|
|
LINKS
|
|
|
FORMULA
|
G.f.: (-149x^4 + 296x^3 - 300x^2 + 296x - 149)/((x-1)^3*(x^2+1)).
a(n) = 2*floor(3*n*(n + 1)/4) + 149.
a(n) = (3*(n^2+n+99)+(-1)^binomial(n+1,2))/2. (Suggested by Michel Marcus)
a(n) = ((1/4+i/4)*((297-297*i)-i*(-i)^n+i^n)+(3*n)/2+(3*n^2)/2) where i is the imaginary unit. - Colin Barker, Feb 09 2016
|
|
MATHEMATICA
|
Table[2*Floor[3*n*(n+1)/4] + 149, {n, 0, 10000}] (* Efficient. *)
Table[(3*(n^2+n+99)+Cos[Pi*n/2]-Sin[Pi*n/2])/2, {n, 0, 1000}](* or *)
LinearRecurrence[{3, -4, 4, -3, 1}, {149, 151, 157, 167, 179}, 1000]
CoefficientList[Series[(-149 x^4 + 296 x^3 - 300 x^2 + 296 x - 149) / ((x - 1)^3 (x^2 + 1)), {x, 0, 50}], x] (* Vincenzo Librandi, Feb 05 2016 *)
|
|
PROG
|
(PARI) Vec((-149*x^4 + 296*x^3 - 300*x^2 + 296*x - 149)/((x-1)^3*(x^2+1)) + O(x^60)) \\ Michel Marcus, Feb 04 2016
(PARI) a(n) = ((1/4+I/4)*((297-297*I)-I*(-I)^n+I^n)+(3*n)/2+(3*n^2)/2) \\ Colin Barker, Feb 09 2016
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|