login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A260181 Numbers whose last digit is prime. 5

%I #42 Sep 08 2022 08:46:13

%S 2,3,5,7,12,13,15,17,22,23,25,27,32,33,35,37,42,43,45,47,52,53,55,57,

%T 62,63,65,67,72,73,75,77,82,83,85,87,92,93,95,97,102,103,105,107,112,

%U 113,115,117,122,123,125,127,132,133,135,137,142,143,145,147

%N Numbers whose last digit is prime.

%C Numbers ending in 2, 3, 5 or 7.

%C The subsequence of primes is A042993. - _Michel Marcus_, Jul 19 2015

%C From _Wesley Ivan Hurt_, Aug 15 2015, Sep 26 2015: (Start)

%C Ceiling(a(n)/2) = A047201(n).

%C Complement of (A197652 Union A262389). (End)

%H Muniru A Asiru, <a href="/A260181/b260181.txt">Table of n, a(n) for n = 1..5000</a>

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

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

%F a(n) = a(n-1)+a(n-4)-a(n-5), n>5.

%F a(n) = (5*n-4-(-1)^n+((3-(-1)^n)/2)*(-1)^((2*n+5-(-1)^n)/4))/2.

%p A260181:=n->(5*n-4-(-1)^n+((3-(-1)^n)/2)*(-1)^((2*n+5-(-1)^n)/4))/2: seq(A260181(n), n=1..100);

%t CoefficientList[Series[(2 + x + 2 x^2 + 2 x^3 + 3 x^4)/((x - 1)^2*(1 + x + x^2 + x^3)), {x, 0, 100}], x]

%t LinearRecurrence[{1, 0, 0, 1, -1}, {2, 3, 5, 7, 12}, 60] (* _Vincenzo Librandi_, Jul 18 2015 *)

%t Table[(5n - 4 - (-1)^n + ((3 - (-1)^n)/2)*(-1)^((2*n + 5 - (-1)^n)/4))/2, {n, 100}] (* _Wesley Ivan Hurt_, Aug 11 2015 *)

%o (Magma) [(5*n-4-(-1)^n+((3-(-1)^n) div 2)*(-1)^((2*n+5-(-1)^n) div 4))/2: n in [1..70]]; // _Vincenzo Librandi_, Jul 18 2015

%o (PARI) is(n)=my(m=digits(n));isprime(m[#m]) \\ _Anders Hellström_, Jul 19 2015

%o (PARI) A260181(n)=(n--)\4*10+prime(n%4+1) \\ is(n)=isprime(n%10) is much more efficient than the above. - _M. F. Hasler_, Sep 16 2016

%o (GAP) a:=n->(5*n-4-(-1)^n+((3-(-1)^n)/2)*(-1)^((2*n+5-(-1)^n)/4))/2; List([1..60],n->a(n)); # _Muniru A Asiru_, Feb 16 2018

%Y Cf. A042993, A047201, A092620, subset of A118950.

%Y Union of A017293, A017305, A017329 and A017353.

%Y First differences are [1,2,2,5,...] = A002522(A140081(n-1)).

%Y Cf. A197652, A262389.

%K nonn,base,easy

%O 1,1

%A _Wesley Ivan Hurt_, Jul 17 2015

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 21:57 EDT 2024. Contains 371254 sequences. (Running on oeis4.)