A298613 Primes formed by the concatenation of 2^k-1 and 2^(k-1)-1.
31, 73, 157, 12763, 255127, 40952047, 524287262143, 41943032097151, 6871947673534359738367, 7036874417766335184372088831, 22517998136852471125899906842623, 14757395258967641292773786976294838206463, 604462909807314587353087302231454903657293676543
Offset: 1
Links
Programs
-
GAP
m:=300;; g1:=List(List([1..m],k->2^k-1),ListOfDigits);; g2:=List(List([1..m],k->2^(k-1)-1),ListOfDigits);; g3:=List([1..m],i->Concatenation(g1[i],g2[i]));; a:=Filtered(List([1..Length(g3)],s->Sum([0..Length(g3[s])-1],t->g3[s][Length(g3[s])-t]*10^t)),IsPrime); # Muniru A Asiru, Mar 29 2018
-
Magma
[t: n in [1..100] | IsPrime(t) where t is Seqint(Intseq(2^(n-1)-1) cat Intseq(2^n-1))]; // Bruno Berselli, Feb 02 2018
-
Mathematica
Select[Map[#1 10^IntegerLength@ #2 + #2 & @@ Reverse@ # &, Partition[Array[2^# - 1 &, 90], 2, 1]], PrimeQ] (* Michael De Vlieger, Jan 23 2018 *)
-
PARI
lista(nn) = for (n=1, nn, if (isprime(p=fromdigits(concat(digits(2^n-1), digits(2^(n-1)-1)))), print1(p, ", "))); \\ Michel Marcus, Jan 29 2018
Formula
a(n) = concatenation of 2^k-1 and 2^(k-1)-1, where k = A301806(n).
Comments