login
Numbers of the form 8k+5; or, numbers whose binary expansion ends in 101.
30

%I #49 Feb 18 2024 23:36:50

%S 5,13,21,29,37,45,53,61,69,77,85,93,101,109,117,125,133,141,149,157,

%T 165,173,181,189,197,205,213,221,229,237,245,253,261,269,277,285,293,

%U 301,309,317,325,333,341,349,357,365,373,381,389,397,405,413,421,429

%N Numbers of the form 8k+5; or, numbers whose binary expansion ends in 101.

%C Only numbers of the form 8k+5 may be written as a sum of 5 odd squares. Examples: 5 = 1+1+1+1+1, 13 = 9+1+1+1+1, 21 = 9+9+1+1+1, 29 = 25+1+1+1+1= 9+9+9+1+1, 37 = 9+9+9+9+1 = 25+9+1+1+1, 45 = 25+9+9+1+1=9+9+9+9+9, 53 = 49+1+1+1+1 = 25+25+1+1+1 = 25+9+9+9+1, ... - _Philippe Deléham_, Sep 03 2005

%C Positive solutions to the equation x == 5 (mod 8). - _K.V.Iyer_, Apr 27 2009

%H Vincenzo Librandi, <a href="/A004770/b004770.txt">Table of n, a(n) for n = 1..5000</a>

%H Tanya Khovanova, <a href="http://www.tanyakhovanova.com/RecursiveSequences/RecursiveSequences.html">Recursive Sequences</a>.

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

%F From _R. J. Mathar_, Mar 14 2011: (Start)

%F a(n) = 8*n - 3.

%F G.f.: x*(5+3*x)/(x-1)^2. (End)

%F a(n) = 2*a(n-1) - a(n-2). - _Vincenzo Librandi_, May 28 2011

%t Range[5, 1000, 8] (* _Vladimir Joseph Stephan Orlovsky_, May 27 2011 *)

%t LinearRecurrence[{2,-1},{5,13},60] (* or *) NestList[#+8&,5,60] (* _Harvey P. Dale_, Jun 28 2021 *)

%o (Magma) [8*n-3: n in [1..60]]; // _Vincenzo Librandi_, May 28 2011

%o (Haskell)

%o a004770 = (subtract 3) . (* 8)

%o a004770_list = [5, 13 ..] -- _Reinhard Zumkeller_, Aug 17 2012

%o (PARI) a(n)=8*n-3 \\ _Charles R Greathouse IV_, Sep 24 2015

%Y Cf. A110534, A017101, A017113.

%Y Cf. A004776 (complement), A007521 (primes).

%K nonn,easy

%O 1,1

%A _N. J. A. Sloane_