|
|
A107730
|
|
Numbers n such that prime(n+1) has the same last digit as prime(n).
|
|
7
|
|
|
34, 42, 53, 61, 68, 80, 82, 101, 106, 115, 125, 127, 138, 141, 145, 154, 157, 172, 175, 177, 191, 193, 204, 222, 233, 258, 259, 266, 269, 279, 289, 306, 308, 310, 316, 324, 369, 383, 397, 399, 403, 418, 422, 431, 442, 443, 474, 480, 491, 497, 500, 502, 518
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(1) = 34 because prime(34) = 139, prime(35) = 149, both end with the digit 9.
a(2) = 42 because prime(42) = 181, prime(43) = 191, both end with the digit 1.
a(4) = 61 because prime(61) = 283, prime(62) = 293, both end with the digit 3.
a(5) = 68 because prime(68) = 337, prime(69) = 347, both end with the digit 7.
|
|
MAPLE
|
isA107730 := proc(n) local ldign, ldign2 ; ldign := convert(ithprime(n), base, 10) ; ldign2 := convert(ithprime(n+1), base, 10) ; if op(1, ldign) = op(1, ldign2) then true ; else false ; fi ; end: for n from 1 to 600 do if isA107730(n) then printf("%d, ", n) ; fi ; od ; # R. J. Mathar, Jun 15 2007
|
|
MATHEMATICA
|
Select[Range[200], IntegerDigits[Prime[ # ]][[ -1]]==IntegerDigits[Prime[ #+1]][[ -1]]&] (* Stefan Steinerberger, Jun 14 2007 *)
Flatten[Position[Partition[Prime[Range[600]], 2, 1], _?(Mod[#[[1]], 10] == Mod[#[[2]], 10]&), {1}, Heads->False]] (* Harvey P. Dale, Aug 20 2015 *)
|
|
PROG
|
(PARI) isok(n) = (prime(n) % 10) == prime(n+1) % 10; \\ Michel Marcus, Feb 16 2017
(PARI) is_A107730(n)=!((nextprime(1+n=prime(n))-n)%10) \\ This (...) is twice as fast as prime(n+1)-prime(n), and prime(n) becomes very slow for n > 41538, even with primelimit = 10^7. - M. F. Hasler, Oct 24 2018
(GAP) P:=List(Filtered([1..4000], IsPrime), n->Reversed(ListOfDigits(n)));;
a:=Filtered([1..Length(P)-1], i->P[i+1][1]=P[i][1]); # Muniru A Asiru, Oct 31 2018
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,easy,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|