login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Numbers that are congruent to {0, 1, 2} mod 5.
25

%I #91 Dec 23 2024 13:43:54

%S 0,1,2,5,6,7,10,11,12,15,16,17,20,21,22,25,26,27,30,31,32,35,36,37,40,

%T 41,42,45,46,47,50,51,52,55,56,57,60,61,62,65,66,67,70,71,72,75,76,77,

%U 80,81,82,85,86,87,90,91,92,95,96,97,100,101,102,105,106,107,110,111

%N Numbers that are congruent to {0, 1, 2} mod 5.

%C Also, the only numbers that are eligible to be the sum of two 4th powers (A004831). - _Cino Hilliard_, Nov 23 2003

%C Nonnegative m such that floor(2*m/5) = 2*floor(m/5). - _Bruno Berselli_, Dec 09 2015

%C The sequence lists the indices of the multiples of 5 in A007531. - _Bruno Berselli_, Jan 05 2018

%H Mohammed Yaseen, <a href="/A047217/b047217.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from Vincenzo Librandi)

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

%F a(n+1) = Sum_{k>=0} A030341(n,k)*b(k) with b(0)=1 and b(k)=5*3^(k-1) for k>0. - _Philippe Deléham_, Oct 22 2011

%F G.f.: x^2*(1+x+3*x^2)/(1-x)^2/(1+x+x^2). - _Colin Barker_, Feb 17 2012

%F a(n) = 5 + a(n-3) for n>3. - _Robert Israel_, Sep 02 2014

%F a(n) = floor((5/4)*floor(4*(n-1)/3)). - _Bruno Berselli_, May 03 2016

%F From _Wesley Ivan Hurt_, Jun 14 2016: (Start)

%F a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.

%F a(n) = (15*n-21-6*cos(2*n*Pi/3)+2*sqrt(3)*sin(2*n*Pi/3))/9.

%F a(3*k) = 5*k-3, a(3*k-1) = 5*k-4, a(3*k-2) = 5*k-5. (End)

%F a(n) = n - 1 + 2*floor((n-1)/3). - _Bruno Berselli_, Feb 06 2017

%F Sum_{n>=2} (-1)^n/a(n) = sqrt(1-2/sqrt(5))*Pi/5 + 3*log(2)/5. - _Amiram Eldar_, Dec 10 2021

%p seq(op([5*i,5*i+1,5*i+2]),i=0..100); # _Robert Israel_, Sep 02 2014

%t Select[Range[0,120], MemberQ[{0,1,2}, Mod[#,5]]&] (* _Harvey P. Dale_, Jan 20 2012 *)

%o (PARI) a(n)=n--\3*5+n%3 \\ _Charles R Greathouse IV_, Oct 22 2011

%o (PARI) concat(0, Vec(x^2*(1+x+3*x^2)/(1-x)^2/(1+x+x^2) + O(x^100))) \\ _Altug Alkan_, Dec 09 2015

%o (PARI) is(n) = n%5 < 3 \\ _Felix Fröhlich_, Jan 05 2018

%o (Magma) I:=[0, 1, 2, 5]; [n le 4 select I[n] else Self(n-1)+Self(n-3)-Self(n-4): n in [1..70]]; // _Vincenzo Librandi_, Apr 25 2012

%o (Magma) &cat [[5*n,5*n+1,5*n+2]: n in [0..30]]; // _Bruno Berselli_, Dec 09 2015

%Y Cf. A007531, A030341, A004831 (two 4th powers).

%Y Cf. similar sequences with formula n+i*floor(n/3) listed in A281899.

%K nonn,easy

%O 1,3

%A _N. J. A. Sloane_