login
Periodic sequence: repeat [1, 5].
19

%I #65 Dec 14 2023 06:08:27

%S 1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,

%T 1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,

%U 1,5,1,5,1,5,1,5,1,5,1,5,1

%N Periodic sequence: repeat [1, 5].

%C Also continued fraction expansion of (5+3*sqrt(5))/10. - _Bruno Berselli_, Sep 30 2011

%C From _Gary Detlefs_, May 19 2014: (Start)

%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 is congruent to either 5,11,13,17,21, or 23 mod 24 and b is of the form 2k+1.

%C 1. If a = 5 mod 6 then c = 6.

%C 2. If a = 5 mod 8 then c = 8.

%C 3. If a = 5 mod 12 then c = 12.

%C 4. If a = 5 mod 24 then c = 24.

%C For example: a(n)= 13^(5*n) mod 8, a(n)= 29^(7*n) mod c where c is any number in {6,8,12,24}. (End)

%H Burkard Polster, <a href="http://plus.maths.org/issue52/features/polster/index.html">Juggling, maths and a beautiful mind</a> [From Parthasarathy Nambi, Nov 20 2009]

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

%F From _Paul Barry_, Jun 03 2003: (Start)

%F G.f.: (1+5*x)/((1-x)*(1+x)).

%F E.g.f.: 3*exp(x)-2*exp(-x).

%F a(n) = 3-2(-1)^n.

%F a(n) = 5^((1-(-1)^n)/2) = 5^(ceiling(n/2)-floor(n/2)). (End)

%F a(n) = 5^n mod 24. - _Paul Curtz_, Jan 09 2008

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

%F a(n) = A000364(n+1) mod 10. - _Paul Curtz_, Feb 09 2010

%F a(n) = 11^n mod 6. - _Vincenzo Librandi_, Jun 01 2016

%p [seq (modp((4*n+1),8),n=0..80)]; # _Zerinvary Lajos_, Dec 01 2006

%t PadRight[{},120,{1,5}] (* _Harvey P. Dale_, Aug 19 2012 *)

%o (Sage) [pow(5,n,12) for n in range(51)] # _Zerinvary Lajos_, Nov 25 2009

%o (Maxima) A010686(n):=if evenp(n) then 1 else 5$

%o makelist(A010686(n),n,0,30); /* _Martin Ettl_, Nov 09 2012 */

%o (PARI) a(n)=n%2*4+1 \\ _Charles R Greathouse IV_, Sep 24 2015

%Y Cf. A000364.

%K nonn,easy

%O 0,2

%A _N. J. A. Sloane_

%E Definition rewritten by _Bruno Berselli_, Sep 30 2011