The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A010685 Period 2: repeat (1,4). 25

%I

%S 1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,

%T 1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,

%U 1,4,1,4,1,4,1,4,1,4,1,4,1

%N Period 2: repeat (1,4).

%C Continued fraction of (1+sqrt 2)/2. - _R. J. Mathar_, Nov 21 2011

%C This sequence can be generated by an infinite number of formulas all having the form a^(b*n) mod c subject to the following conditions. The number a can be congruent to either 2,3, or 4 mod 5 (A047202). If a is congruent to 2 or 3 mod 5, then b can be any number of the form 4k+2 and c = 5 or 15. If a is congruent to 4 mod 5, then b can be any number of the form 2k+1 and c = 5. For example: a(n) = 29^(13*n) mod 5, a(n) = 24^(11*n) mod 5, and a(n) = 22^(10*n) mod 15. - _Gary Detlefs_, May 19 2014

%H Matthew House, <a href="/A010685/b010685.txt">Table of n, a(n) for n = 0..1000</a>

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

%F a(2n) = 1, a(2n+1) = 4.

%F G.f.:(1+4x)/((1-x)(1+x)); E.g.f.:(5*exp(x)-3*exp(-x))/2; a(n) = (5-3(-1)^n)/2; a(n) = 4^((1-(-1)^n)/2) = 2^(1-(-1)^n) = 2/(2^((-1)^n)); a(n) = 4^(ceiling(n/2)-floor(n/2)). - _Paul Barry_, Jun 03 2003

%F a(n) = gcd((n-1)^2, (n+1)^2). - _Paul Barry_, Sep 16 2004

%F a(n) = 4*(n mod 2) + (n+1) mod 2. - _Paolo P. Lava_, Oct 20 2006

%F a(n) = A160700(A000302(n)). - _Reinhard Zumkeller_, Jun 10 2009

%F a(n) = 4^n mod 5. - _Zerinvary Lajos_, Nov 26 2009

%F a(n) = 4^(n mod 2). - _Wesley Ivan Hurt_, Mar 29 2014

%p A010685 := proc(n)

%p if type(n,'even') then

%p 1 ;

%p else

%p 4;

%p end if;

%p end proc: # _R. J. Mathar_, Aug 03 2015

%t Table[(5-3(-1)^n)/2, {n, 0, 100}] (* _Wesley Ivan Hurt_, Mar 26 2014 *)

%o (Sage) [power_mod(4,n,5)for n in range(0,81)] # _Zerinvary Lajos_, Nov 26 2009

%o (PARI) values(m)=my(v=[]);for(i=1,m,v=concat([1,4],v));v; /* _Anders Hellström_, Aug 03 2015 */

%Y Cf. sequences listed in Comments section of A283393.

%K nonn,easy

%O 0,2

%A _N. J. A. Sloane_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified April 7 13:36 EDT 2020. Contains 333305 sequences. (Running on oeis4.)