OFFSET
0,5
COMMENTS
For n <= 1000000, n prime divides a(n) only when n=5 and n composite does not divide a(n) only when n = 9. Is this always so?
FORMULA
a(0)=1, a(1)=0; a(n) = floor(n/2)*(a(n-1) + a(n-2)).
EXAMPLE
a(0) = 1;
a(1) = 0;
a(2) = floor(2/2)*(a(1) + a(0)) = 1;
a(3) = floor(3/2)*(a(2) + a(1)) = 1;
a(4) = floor(4/2)*(a(3) + a(2)) = 4;
a(5) = floor(5/2)*(a(4) + a(3)) = 10.
MATHEMATICA
a[0] = 1; a[1] = 0; a[n_] := a[n] = Floor[n/2] * (a[n - 1] + a[n - 2]); Array[a, 30, 0] (* Amiram Eldar, Apr 05 2023 *)
PROG
(Python)
def seqx_it(n):
a0 = 1
a1 = 0
sequence_store = [a0, a1]
for i in range (2, n):
a2 = (i//2) * (a1 + a0)
sequence_store.append(a2)
a0 = a1
a1 = a2
return sequence_store
CROSSREFS
KEYWORD
nonn
AUTHOR
Davide Oliveri, Mar 31 2023
STATUS
approved