OFFSET
1,1
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
FORMULA
a(n) ~ n log n. - Charles R Greathouse IV, May 11 2014
EXAMPLE
127 is a term because 127 is prime but 27 is composite.
131 is not a term because 131 and 31 are both prime.
MAPLE
a:= proc(n) option remember; local p, m;
p:= `if`(n=1, 1, a(n-1));
do p:= nextprime(p);
m:= irem(p, 10^(length(p)-1));
if m>1 and not isprime(m) then return p fi
od
end:
seq(a(n), n=1..100); # Alois P. Heinz, May 10 2014
MATHEMATICA
Select[Prime[Range[5, 200]], PrimeOmega[FromDigits[Drop[IntegerDigits[#], 1]]] > 1 &] (* Alonso del Arte, May 10 2014 *)
Select[Prime[Range[200]], CompositeQ[FromDigits[Rest[IntegerDigits[ #]]]]&] (* Harvey P. Dale, Mar 09 2016 *)
PROG
(Sage)
[x for x in primes(1000) if not(is_prime(x-(x.digits(base=10)[-1])*10^(floor(log(x, base=10))))) and x-(x.digits(base=10)[-1])*10^(floor(log(x, base=10)))!=1and x-(x.digits(base=10)[-1])*10^(floor(log(x, base=10)))!=0] # Tom Edgar, May 10 2014
(PARI) drop(v)=v[2..#v];
iscomposite(n)=n>3 && !isprime(n);
is(n)=isprime(n) && n>9 && iscomposite(subst(Pol(drop(digits(n))), 'x, 10)) \\ Charles R Greathouse IV, May 11 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. Lowell, May 09 2014
STATUS
approved