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!)
A242265 Primes that become composite numbers if the most significant digit is removed. 2

%I #39 Jun 09 2022 21:55:36

%S 19,29,59,79,89,109,127,139,149,151,157,163,181,191,193,199,227,233,

%T 239,251,257,263,269,277,281,293,349,409,421,433,439,449,457,463,487,

%U 491,499,509,521,557,563,569,577,587,593,599,677,691,709,727,733,739,751

%N Primes that become composite numbers if the most significant digit is removed.

%H Alois P. Heinz, <a href="/A242265/b242265.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) ~ n log n. - _Charles R Greathouse IV_, May 11 2014

%e 127 is a term because 127 is prime but 27 is composite.

%e 131 is not a term because 131 and 31 are both prime.

%p a:= proc(n) option remember; local p, m;

%p p:= `if`(n=1, 1, a(n-1));

%p do p:= nextprime(p);

%p m:= irem(p, 10^(length(p)-1));

%p if m>1 and not isprime(m) then return p fi

%p od

%p end:

%p seq(a(n), n=1..100); # _Alois P. Heinz_, May 10 2014

%t Select[Prime[Range[5, 200]], PrimeOmega[FromDigits[Drop[IntegerDigits[#], 1]]] > 1 &] (* _Alonso del Arte_, May 10 2014 *)

%t Select[Prime[Range[200]],CompositeQ[FromDigits[Rest[IntegerDigits[ #]]]]&] (* _Harvey P. Dale_, Mar 09 2016 *)

%o (Sage)

%o [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

%o (PARI) drop(v)=v[2..#v];

%o iscomposite(n)=n>3 && !isprime(n);

%o is(n)=isprime(n) && n>9 && iscomposite(subst(Pol(drop(digits(n))),'x,10)) \\ _Charles R Greathouse IV_, May 11 2014

%K nonn,base

%O 1,1

%A _J. Lowell_, May 09 2014

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 April 16 18:22 EDT 2024. Contains 371750 sequences. (Running on oeis4.)