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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A069705 a(n) = 2^n mod 7. 12
1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4, 1, 2, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

COMMENTS

Periodic sequence with period [1,2,4]. - Philippe Deléham, Sep 25 2006

a(n) = cubefree part of 2^n. - Artur Jasinski, Oct 15 2008

From Klaus Brockhaus, May 23 2010: (Start)

Continued fraction expansion of (11 + sqrt(229))/18.

Decimal expansion of 124/999. (End)

LINKS

Table of n, a(n) for n=0..104.

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

FORMULA

n=0 mod 3 -> a(n)=1 n=1 mod 3 -> a(n)=2 n=2 mod 3 -> a(n)=4.

a(n) = 2^(n mod 3). - Paul Barry, Oct 06 2003

a(n) = (1/9)*(16*(n mod 3) + ((n+1) mod 3) + 4*((n+2) mod 3)). - Paolo P. Lava, Nov 21 2006

From R. J. Mathar, Apr 13 2010: (Start)

a(n) = a(n-3).

G.f.: (1+2*x+4*x^2)/((1-x) * (1+x+x^2)). (End)

a(n) = (7+5*cos(2*(n+1)*Pi/3)-sqrt(3)*sin(2*(n+1)*Pi/3))/3. - Wesley Ivan Hurt, Oct 01 2017

EXAMPLE

a(4)=16 mod 7=2, a(5)=32 mod 7=4, a(6)=64 mod 7=1.

MAPLE

A069705 := proc(n) op((n mod 3)+1, [1, 2, 4]) ; end proc: # R. J. Mathar, Feb 05 2011

MATHEMATICA

PowerMod[2, Range[0, 110], 7] (* or *) PadRight[{}, 110, {1, 2, 4}] (* Harvey P. Dale, Mar 28 2015 *)

PROG

(Sage) [power_mod(2, n, 7) for n in xrange(0, 105)] # Zerinvary Lajos, Jun 07 2009

(PARI) a(n)=2^(n%3)%7 \\ Charles R Greathouse IV, Jun 11 2015

(PARI) a(n) = lift(Mod(2, 7)^n); \\ Altug Alkan, Mar 25 2016

(MAGMA) [Modexp(2, n, 7): n in [0..100]]; // Vincenzo Librandi, Mar 25 2016

(GAP) List([0..83], n->PowerMod(2, n, 7)); # Muniru A Asiru, Jan 31 2019

CROSSREFS

Cf. A145642. - Artur Jasinski, Oct 15 2008

Cf. A178233 (decimal expansion of (11+sqrt(229))/18). - Klaus Brockhaus, May 23 2010

Appears in A179132. - Johannes W. Meijer, Jul 01 2010

Sequence in context: A227184 A124911 A132954 * A106645 A115314 A062039

Adjacent sequences:  A069702 A069703 A069704 * A069706 A069707 A069708

KEYWORD

nonn,easy

AUTHOR

Jon Perry, Jan 14 2003

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
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 19 03:54 EDT 2019. Contains 328211 sequences. (Running on oeis4.)