login
a(n) = [n*u + n*v] - [n*u] - [n*v], where u=e^(Pi/2), v=1/u, and []=floor.
3

%I #14 Sep 08 2022 08:45:57

%S 1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,0,1,1,0,

%T 0,0,1,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,1,1,0,1,1,1,1,0,1,1,1,1,0,

%U 1,1,1,1,0,1,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,0,0

%N a(n) = [n*u + n*v] - [n*u] - [n*v], where u=e^(Pi/2), v=1/u, and []=floor.

%C e^(Pi/2) - i^(-i) = 4.81047738096535165547..., as at A042972.

%H G. C. Greubel, <a href="/A190239/b190239.txt">Table of n, a(n) for n = 1..10000</a>

%t u = Exp[Pi/2]; v = 1/u;

%t f[n_] := Floor[n*u + n*v] - Floor[n*u] - Floor[n*v]

%t t = Table[f[n], {n, 1, 120}] (* A190239 *)

%t Flatten[Position[t, 0]] (* A190240 *)

%t Flatten[Position[t, 1]] (* A190241 *)

%t Table[Floor[2*n*Cosh[Pi/2]] - Floor[n*Exp[Pi/2]] - Floor[n*Exp[-Pi/2]], {n,1,30}] (* _G. C. Greubel_, Dec 26 2017 *)

%o (PARI) for(n=1,30, print1(floor(2*n*cosh(Pi/2)) - floor(n*exp(Pi/2)) - floor(n*exp(-Pi/2)), ", ")) \\ _G. C. Greubel_, Dec 26 2017

%o (Magma) C<i> := ComplexField(); [Floor(2*n*Cosh(Pi(C)/2)) - Floor(n*Exp(Pi(C)/2)) - Floor(n*Exp(-Pi(C)/2)): n in [1..30]]; // _G. C. Greubel_, Dec 26 2017

%Y Cf. A190240, A190241, A042972.

%K nonn

%O 1

%A _Clark Kimberling_, May 06 2011