|
|
A194960
|
|
a(n) = floor((n+2)/3) + ((n-1) mod 3).
|
|
8
|
|
|
1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 6, 5, 6, 7, 6, 7, 8, 7, 8, 9, 8, 9, 10, 9, 10, 11, 10, 11, 12, 11, 12, 13, 12, 13, 14, 13, 14, 15, 14, 15, 16, 15, 16, 17, 16, 17, 18, 17, 18, 19, 18, 19, 20, 19, 20, 21, 20, 21, 22, 21, 22, 23, 22, 23, 24, 23, 24, 25, 24, 25, 26, 25, 26
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
The sequence is formed by concatenating triples of the form (n, n+1, n+2) for n>=1. See A194961 and A194962 for the associated fractalization and interspersion. The sequence can be obtained from A008611 by deleting its first four terms.
The sequence contains every positive integer n exactly min(n,3) times. - Wesley Ivan Hurt, Dec 17 2013
|
|
LINKS
|
|
|
FORMULA
|
a(n) = ((-1)^n*A130772(n) + n + 4)/3.
G.f.: x*(1 + x + x^2 - 2*x^3)/((1+x+x^2)*(1-x)^2). (End)
a(n) = a(n-3) + 1, n >= 1, with input a(-2) = 0, a(-1) = 1 and a(0) = 2. Proof trivial. a(n) = A008611(n+3), n >= -2. See the first comment above. - Wolfdieter Lang, May 06 2017
a(n) = n - 2*floor((n-1)/3).
a(n) = (n + 2 + 2*((n-1) mod 3))/3.
a(n) = (3*n + 12 + 2*(w^(2*n)*(1 - w) + w^n*(2 + w)))/9, where w = (-1 + sqrt(-3))/2.
a(n) = (2*n + 3 - A330396(n-1))/3. (End)
|
|
MAPLE
|
|
|
MATHEMATICA
|
(* First program *)
p[n_]:= Floor[(n+2)/3] + Mod[n-1, 3]
Table[p[n], {n, 1, 90}] (* A194960 *)
g[1] = {1}; g[n_]:= Insert[g[n-1], n, p[n]]
f[1] = g[1]; f[n_]:= Join[f[n-1], g[n]]
row[n_]:= Position[f[30], n];
u = TableForm[Table[row[n], {n, 1, 5}]]
v[n_, k_]:= Part[row[n], k];
w = Flatten[Table[v[k, n-k+1], {n, 1, 13}, {k, 1, n}]] (* A194962 *)
q[n_]:= Position[w, n];
Flatten[Table[q[n], {n, 1, 80}]] (* A194963 *)
(* Other programs *)
CoefficientList[Series[(1 +x +x^2 -2 x^3)/((1+x+x^2) (1-x)^2), {x, 0, 100}], x] (* Vincenzo Librandi, Dec 17 2013 *)
Table[(n+4 -2*ChebyshevU[2*n+4, 1/2])/3, {n, 80}] (* G. C. Greubel, Oct 23 2022 *)
|
|
PROG
|
(Magma) I:=[1, 2, 3, 2]; [n le 4 select I[n] else Self(n-1)+Self(n-3)-Self(n-4): n in [1..100]]; // Vincenzo Librandi, Dec 17 2013
(SageMath) [(n+4 - 2*chebyshev_U(2*n+4, 1/2))/3 for n in (1..80)] # G. C. Greubel, Oct 23 2022
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|