[go: up one dir, main page]

login
A088440
a(4n) = 4n, otherwise a(n) = 1.
2
0, 1, 1, 1, 4, 1, 1, 1, 8, 1, 1, 1, 12, 1, 1, 1, 16, 1, 1, 1, 20, 1, 1, 1, 24, 1, 1, 1, 28, 1, 1, 1, 32, 1, 1, 1, 36, 1, 1, 1, 40, 1, 1, 1, 44, 1, 1, 1, 48, 1, 1, 1, 52, 1, 1, 1, 56, 1, 1, 1, 60, 1, 1, 1, 64, 1, 1, 1, 68, 1, 1, 1, 72, 1, 1, 1, 76, 1, 1, 1, 80, 1, 1, 1, 84, 1, 1, 1, 88, 1, 1, 1, 92, 1, 1, 1
OFFSET
0,5
FORMULA
a(n) = 1+(n-1)*((1+(-1)^(n/2))*(1+(-1)^n))/4. - Wesley Ivan Hurt, May 07 2021
G.f.: x*(1 + x + x^2 + 4*x^3 - x^4 - x^5 - x^6)/(1-x^4)^2. - Georg Fischer, Nov 17 2022
E.g.f.: (1/2)*( cosh(x) + (x+2)*sinh(x) - cos(x) - x*sin(x) ). - G. C. Greubel, Dec 05 2022
MATHEMATICA
Array[1 + (# - 1)*((1 + (-1)^(#/2))*(1 + (-1)^#))/4 &, 96, 0] (* Michael De Vlieger, May 07 2021 *)
PROG
(PARI) A088440(n) = if((n%4), 1, n); \\ Antti Karttunen, Jul 03 2018
(Magma)
A088440:= func< n | n mod 4 eq 0 select n else 1>;
[A088440(n): n in [0..120]]; // G. C. Greubel, Dec 05 2022
(SageMath)
def A088440(n): return 1 if (n%4) else n
[A088440(n) for n in range(121)] # G. C. Greubel, Dec 05 2022
CROSSREFS
Cf. A088140.
Sequence in context: A074058 A308552 A368333 * A300253 A212173 A366993
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula, Nov 09 2003
EXTENSIONS
Description corrected by Antti Karttunen, Jul 03 2018
STATUS
approved