A032596
Second of three consecutive palindromes all of which are prime.
Original entry on oeis.org
1879781, 1880881, 1969691, 3590953, 7820287, 108494801, 159191951, 160707061, 175101571, 187101781, 316696613, 319404913, 725595527, 728898827, 731909137, 904090409, 921202129, 930505039, 987202789, 987494789, 10456965401, 10745054701
Offset: 1
-
nxt(n)=my(d=digits(n)); i=(#d+1)\2; while(i&&d[i]==9, d[i]=0; d[#d+1-i]=0; i--); if(i, d[i]++; d[#d+1-i]=d[i], d=vector(#d+1); d[1]=d[#d]=1); sum(i=1, #d, 10^(#d-i)*d[i]) \\ From David A. Corneth at A002113
list(lim)=my(v=List(),p=1,q=2,r=3); while(q<=lim\=1, if(isprime(r), if(isprime(q), if(isprime(p), listput(v,q)); p=q; q=r; r=nxt(r), q=nxt(p=r); r=nxt(q)), q=nxt(p=nxt(r)); r=nxt(q))); Vec(v) \\ Charles R Greathouse IV, Aug 11 2021
A032597
Third of three consecutive palindromes all of which are prime.
Original entry on oeis.org
1880881, 1881881, 1970791, 3591953, 7821287, 108505801, 159202951, 160717061, 175111571, 187111781, 316707613, 319414913, 725606527, 728909827, 731919137, 904101409, 921212129, 930515039, 987212789, 987505789, 10457075401, 10745154701
Offset: 1
-
nxt(n)=my(d=digits(n)); i=(#d+1)\2; while(i&&d[i]==9, d[i]=0; d[#d+1-i]=0; i--); if(i, d[i]++; d[#d+1-i]=d[i], d=vector(#d+1); d[1]=d[#d]=1); sum(i=1, #d, 10^(#d-i)*d[i]) \\ From David A. Corneth at A002113
list(lim)=my(v=List(),p=1,q=2,r=3); while(r<=lim\=1, if(isprime(r), if(isprime(q), if(isprime(p), listput(v,r)); p=q; q=r; r=nxt(r), q=nxt(p=r); r=nxt(q)), q=nxt(p=nxt(r)); r=nxt(q))); Vec(v) \\ Charles R Greathouse IV, Aug 11 2021
A230806
The smallest of 4 consecutive palindromic numbers that are all primes.
Original entry on oeis.org
1878781, 11782828711, 13828882831, 33694849633, 36331813363, 76093839067, 93121812139, 1018278728101, 1101228221011, 1200528250021, 1237788877321, 1296978796921, 1318608068131, 1449108019441, 1477968697741, 1608678768061, 1713708073171, 1792308032971
Offset: 1
1878781 is in the sequence because 1878781, 1879781, 1880881 and 1881881 are consecutive palindromic numbers that are all primes.
-
a = {}; m = 0; Do[z = n*10^(IntegerLength[n] - 1) + FromDigits@Rest@Reverse@IntegerDigits[n]; If[PrimeQ[z], m = m + 1; If[m == 1, z1 = z]; If[m == 4, AppendTo[a, z1]], m = 0], {n, 1, 1000000000}]
A230807
The smallest of n consecutive palindromic numbers which are all primes.
Original entry on oeis.org
2, 2, 1878781, 1878781
Offset: 1
1878781 is in the sequence because 1878781, 1879781, 1880881 and 1881881 are consecutive palindromic numbers which are all primes.
Showing 1-4 of 4 results.
Comments