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.

A109007 a(n) = gcd(n,3).

This page as a plain text file.
%I A109007 #44 Sep 08 2022 08:45:19
%S A109007 3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,
%T A109007 1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,
%U A109007 1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1
%N A109007 a(n) = gcd(n,3).
%C A109007 For n>1: a(n) = GCD of the n-th and (n+2)-th triangular numbers = A050873(A000217(n+2), A000217(n)). - _Reinhard Zumkeller_, May 28 2007
%C A109007 From _Klaus Brockhaus_, May 24 2010: (Start)
%C A109007 Continued fraction expansion of (3+sqrt(17))/2.
%C A109007 Decimal expansion of 311/999. (End)
%H A109007 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,1).
%F A109007 a(n) = 1 + 2*[3|n] = 1 + 2(1 + 2*cos(2*n*Pi/3))/3, where [x|y] = 1 when x divides y, 0 otherwise.
%F A109007 a(n) = a(n-3) for n>2.
%F A109007 Multiplicative with a(p^e, 3) = gcd(p^e, 3). - _David W. Wilson_, Jun 12 2005
%F A109007 O.g.f.: -(3+x+x^2)/((x-1)*(x^2+x+1)). - _R. J. Mathar_, Nov 24 2007
%F A109007 Dirichlet g.f. zeta(s)*(1+2/3^s). - _R. J. Mathar_, Apr 08 2011
%F A109007 a(n) = 2*floor(((n-1) mod 3)/2) + 1. - _Gary Detlefs_, Dec 28 2011
%F A109007 a(n) = 3^(1 - sgn(n mod 3)). - _Wesley Ivan Hurt_, Jul 24 2016
%F A109007 a(n) = 3/(1 + 2*((n^2) mod 3)). - _Timothy Hopper_, Feb 25 2017
%F A109007 a(n) = (5 + 4*cos(2*n*Pi/3))/3. - _Wesley Ivan Hurt_, Oct 04 2018
%p A109007 A109007:=n->gcd(n,3): seq(A109007(n), n=0..100); # _Wesley Ivan Hurt_, Jul 24 2016
%t A109007 GCD[Range[0,100],3] (* or *) PadRight[{},110,{3,1,1}] (* _Harvey P. Dale_, Jun 28 2015 *)
%o A109007 (PARI) a(n)=gcd(n,3) \\ _Charles R Greathouse IV_, Sep 24 2015
%o A109007 (Magma) [Gcd(n,3) : n in [0..100]]; // _Wesley Ivan Hurt_, Jul 24 2016
%Y A109007 Cf. A000217, A026741, A050873, A109004, A130334.
%Y A109007 Cf. A178255 (decimal expansion of (3+sqrt(17))/2). - _Klaus Brockhaus_, May 24 2010
%K A109007 nonn,easy,mult
%O A109007 0,1
%A A109007 _Mitch Harris_