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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A260181 Numbers whose last digit is prime. 4
2, 3, 5, 7, 12, 13, 15, 17, 22, 23, 25, 27, 32, 33, 35, 37, 42, 43, 45, 47, 52, 53, 55, 57, 62, 63, 65, 67, 72, 73, 75, 77, 82, 83, 85, 87, 92, 93, 95, 97, 102, 103, 105, 107, 112, 113, 115, 117, 122, 123, 125, 127, 132, 133, 135, 137, 142, 143, 145, 147 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

Numbers ending in 2, 3, 5 or 7.

The subsequence of primes is A042993. - Michel Marcus, Jul 19 2015

From Wesley Ivan Hurt, Aug 15 2015, Sep 26 2015: (Start)

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

Complement of (A197652 Union A262389). (End)

LINKS

Muniru A Asiru, Table of n, a(n) for n = 1..5000

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

FORMULA

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

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

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

MAPLE

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);

MATHEMATICA

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]

LinearRecurrence[{1, 0, 0, 1, -1}, {2, 3, 5, 7, 12}, 60] (* Vincenzo Librandi, Jul 18 2015 *)

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 *)

PROG

(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

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

(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

(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

CROSSREFS

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

Union of A017293, A017305, A017329 and A017353.

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

Cf. A197652, A262389.

Sequence in context: A092620 A028843 A028842 * A140971 A073689 A257560

Adjacent sequences:  A260178 A260179 A260180 * A260182 A260183 A260184

KEYWORD

nonn,base,easy

AUTHOR

Wesley Ivan Hurt, Jul 17 2015

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 November 21 09:14 EST 2019. Contains 329362 sequences. (Running on oeis4.)