cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A109008 a(n) = gcd(n,4).

This page as a plain text file.
%I A109008 #41 Sep 08 2022 08:45:19
%S A109008 4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,
%T A109008 2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,
%U A109008 4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4
%N A109008 a(n) = gcd(n,4).
%C A109008 Period 4: repeat [4, 1, 2, 1]. - _Wesley Ivan Hurt_, Aug 31 2014
%H A109008 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,1).
%F A109008 a(n) = 1 + [2|n] + 2*[4|n] = 2 + (-1)^n + cos(n*Pi/2), where [x|y] = 1 when x divides y, 0 otherwise.
%F A109008 a(n) = a(n-4) for n>3.
%F A109008 Multiplicative with a(p^e) = gcd(p^e, 4). - _David W. Wilson_, Jun 12 2005
%F A109008 Dirichlet g.f.: (1  + 1/2^s + 2/4^s)*zeta(s). - _R. J. Mathar_, Feb 28 2011
%F A109008 G.f.: (4+x+2*x^2+x^3)/((1-x)*(1+x)*(1+x^2)). - _R. J. Mathar_, Apr 04 2011
%F A109008 a(n) = 1 + mod((n-1)^3, 4). - _Wesley Ivan Hurt_, Aug 31 2014
%F A109008 a(n) = 2 + cos(n*Pi) + cos(n*Pi/2). - _Wesley Ivan Hurt_, Jul 07 2016
%F A109008 E.g.f.: exp(-x) + 2*exp(x) + cos(x). - _Ilya Gutkovskiy_, Jul 07 2016
%p A109008 A109008:=n->gcd(n,4): seq(A109008(n), n=0..100); # _Wesley Ivan Hurt_, Aug 31 2014
%t A109008 Table[GCD[n, 4], {n, 0, 100}] (* _Wesley Ivan Hurt_, Aug 31 2014 *)
%o A109008 (Haskell)
%o A109008 a109008 = gcd 4
%o A109008 a109008_list = cycle [4,1,2,1]  -- _Reinhard Zumkeller_, Nov 25 2013
%o A109008 (Magma) [Gcd(n,4) : n in [0..100]]; // _Wesley Ivan Hurt_, Aug 31 2014
%o A109008 (PARI) a(n)=gcd(n,4) \\ _Charles R Greathouse IV_, Oct 07 2015
%Y A109008 Cf. A109004.
%K A109008 nonn,easy,mult
%O A109008 0,1
%A A109008 _Mitch Harris_