login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A010685 Period 2: repeat (1,4). 24
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, 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, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

COMMENTS

Continued fraction of (1+sqrt 2)/2. - R. J. Mathar, Nov 21 2011

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

LINKS

Matthew House, Table of n, a(n) for n = 0..1000

Index entries for linear recurrences with constant coefficients, signature (0, 1).

FORMULA

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

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

a(n) = gcd((n-1)^2, (n+1)^2). - Paul Barry, Sep 16 2004

a(n) = 4*(n mod 2) + (n+1) mod 2. - Paolo P. Lava, Oct 20 2006

a(n) = A160700(A000302(n)). - Reinhard Zumkeller, Jun 10 2009

a(n) = 4^n mod 5. - Zerinvary Lajos, Nov 26 2009

a(n) = 4^(n mod 2). - Wesley Ivan Hurt, Mar 29 2014

MAPLE

A010685 := proc(n)

    if type(n, 'even') then

        1 ;

    else

        4;

    end if;

end proc: # R. J. Mathar, Aug 03 2015

MATHEMATICA

Table[(5-3(-1)^n)/2, {n, 0, 100}] (* Wesley Ivan Hurt, Mar 26 2014 *)

PROG

(Sage) [power_mod(4, n, 5)for n in xrange(0, 81)] # Zerinvary Lajos, Nov 26 2009

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

CROSSREFS

Cf. sequences listed in Comments section of A283393.

Sequence in context: A144865 A096622 A080905 * A174571 A099301 A244971

Adjacent sequences:  A010682 A010683 A010684 * A010686 A010687 A010688

KEYWORD

nonn,easy

AUTHOR

N. J. A. Sloane

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy .

Last modified February 21 00:32 EST 2018. Contains 299388 sequences. (Running on oeis4.)