login
a(n) = gcd(n,8).
5

%I #32 Feb 12 2019 04:41:09

%S 8,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,8,1,

%T 2,1,4,1,2,1,8,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,8,1,2,1,

%U 4,1,2,1,8,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,8,1,2,1,4

%N a(n) = gcd(n,8).

%H <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,0,0,1).

%F a(n) = 1 + [2|n] + 2*[4|n] + 4*[8|n], where [x|y] = 1 when x divides y, 0 otherwise.

%F a(n) = a(n-8).

%F Multiplicative with a(p^e) = gcd(p^e, 8). - _David W. Wilson_, Jun 12 2005

%F G.f.: ( -8 - x - 2*x^2 - x^3 - 4*x^4 - x^5 - 2*x^6 - x^7 ) / ( (x-1)*(1+x)*(x^2+1)*(x^4+1) ). - _R. J. Mathar_, Apr 04 2011

%F Dirichlet g.f.: zeta(s)*(1 + 1/2^s + 2/4^s + 4/8^s). - _R. J. Mathar_, Apr 04 2011

%F a(n) = 2^(-(101*m^7 - 2464*m^6 + 23786*m^ 5 -115360*m^4 + 293909*m^3 - 371056*m^2 + 186204*m - 15120)/5040) where m = (n mod 8). - _Luce ETIENNE_, Nov 18 2018

%t a[n_]:= GCD[n,8]; Array[a, 100, 0] (* _Stefano Spezia_, Nov 19 2018 *)

%o (PARI) a(n) = gcd(n, 8) \\ _David A. Corneth_, Nov 19 2018

%Y Cf. A010877, A109004.

%K nonn,easy,mult

%O 0,1

%A _Mitch Harris_