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!)
A276481 Numbers n such that b(n) is a prime, where b(1) = prime(1) = 2, b(n) = 10*b(n-1) + (prime(n) mod 10). 0

%I #19 Sep 10 2016 16:29:15

%S 1,2,4,13,16,17,28,34,90,100,132,331,534,7923

%N Numbers n such that b(n) is a prime, where b(1) = prime(1) = 2, b(n) = 10*b(n-1) + (prime(n) mod 10).

%C Primes in the sequence b(n) are 2, 23, 2357, 2357137939171, ...

%p Res:= NULL: p:= 0: b:= 0:

%p for n from 1 to 600 do

%p p:= nextprime(p);

%p b:= 10*b + (p mod 10);

%p if isprime(b) then Res:= Res, n fi

%p od:

%p Res; # _Robert Israel_, Sep 05 2016

%t b[1] = Prime@ 1; b[n_] := b[n] = 10 b[n - 1] + Mod[Prime@ n, 10]; Select[Range[10^3], PrimeQ@ b[#] &] (* _Michael De Vlieger_, Sep 06 2016 *)

%o (PARI) b(n) = if (n==1, 2, 10*b(n-1) + (prime(n) % 10));

%o isok(n) = isprime(b(n)); \\ _Michel Marcus_, Sep 05 2016

%o (PARI) list(lim)=my(v=List(),s,n); forprime(p=2,, if(n++>lim, return(Vec(v))); if(ispseudoprime(s=10*s+p%10), listput(v, n))) \\ _Charles R Greathouse IV_, Sep 05 2016

%Y Cf. A007652, A069151.

%K nonn,base

%O 1,2

%A _Thomas Ordowski_, Sep 05 2016

%E a(7)-a(13) from _Michel Marcus_, Sep 05 2016

%E a(14) from _Robert Israel_, Sep 05 2016

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 May 10 23:01 EDT 2024. Contains 372388 sequences. (Running on oeis4.)