[go: up one dir, main page]

login
A246944
Prime numbers p with property that when the first digit is shifted to the last digit, we obtain a prime greater than p.
2
13, 17, 37, 79, 113, 127, 131, 149, 157, 163, 181, 191, 197, 199, 337, 359, 367, 373, 787, 797, 1117, 1123, 1129, 1151, 1153, 1181, 1187, 1193, 1201, 1213, 1231, 1237, 1259, 1279, 1297, 1301, 1319, 1327, 1367, 1409, 1423, 1427, 1439, 1459, 1483, 1487, 1493
OFFSET
1,1
LINKS
EXAMPLE
13: when 1 is shifted to last it becomes 31.
MATHEMATICA
fdlQ[n_]:=Module[{c=FromDigits[RotateLeft[IntegerDigits[n]]]}, PrimeQ[c] && c>n]; Select[Prime[Range[300]], fdlQ] (* Harvey P. Dale, Jun 06 2018 *)
PROG
(PHP)
function number_firsttolast($a)
{
$b=str_split($a);
$c=count($b);
for($i=1; $i<$c; $i++)
{
$d=$d.$b[$i];
}
$e=$d.$b[0];
return ($e);
}
(PARI)
move(n)=n=Vec(Str(n)); N=List(); for(i=2, #n, listput(N, n[i])); listput(N, n[1]); return(eval(concat(N)));
forprime(p=2, 1000, if(isprime(move(p))&&move(p)>p, print1(p, ", "))) \\ Edward Jiang, Sep 08 2014
CROSSREFS
Cf. A109308.
Sequence in context: A166681 A109308 A263241 * A086402 A358571 A271050
KEYWORD
nonn,base
AUTHOR
STATUS
approved