cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A331865 Numbers n for which R(n) + 2*10^floor(n/2) is prime, where R(n) = (10^n-1)/9.

This page as a plain text file.
%I A331865 #27 Feb 19 2025 11:21:12
%S A331865 0,1,2,3,5,6,8,12,20,39,74,78,80,84,104,195,654,980,2076,5940,19637
%N A331865 Numbers n for which R(n) + 2*10^floor(n/2) is prime, where R(n) = (10^n-1)/9.
%C A331865 The corresponding primes are a subsequence of A105992: near-repunit primes.
%C A331865 In base 10, R(n) + 2*10^floor(n/2) has ceiling(n/2)-1 digits 1, one digit 3, and again floor(n/2) digits 1 (except for n=0). For odd n, this is a palindrome (a.k.a. wing prime, cf. A077779), for even n the digit 3 is just left to the middle of the number.
%C A331865 a(22) > 50000. - _Michael S. Branicky_, Feb 19 2025
%H A331865 Brady Haran and Simon Pampena, <a href="https://www.youtube.com/watch?v=HPfAnX5blO0">Glitch Primes and Cyclops Numbers</a>, Numberphile video (2015).
%e A331865 For n = 0, R(0) + 2*10^floor(0/2) = 2 is prime.
%e A331865 For n = 1, R(1) + 2*10^floor(1/2) = 3 is prime.
%e A331865 For n = 2, R(2) + 2*10^floor(2/2) = 31 is prime.
%e A331865 For n = 3, R(3) + 2*10^floor(3/2) = 131 is prime.
%e A331865 For n = 5, R(5) + 2*10^floor(5/2) = 11311 is prime.
%e A331865 For n = 6, R(6) + 2*10^floor(6/2) = 113111 is prime.
%t A331865 Select[Range[0, 2500], PrimeQ[(10^# - 1)/9 + 2*10^Floor[#/2]] &] (* _Michael De Vlieger_, Jan 31 2020 *)
%o A331865 (PARI) for(n=0,9999,isprime(p=10^n\9+2*10^(n\2))&&print1(n","))
%Y A331865 Cf. A105992 (near-repunit primes), A002275 (repunits), A004023 (indices of prime repunits), A011557 (powers of 10).
%Y A331865 Cf. A331860 & A331863 (variants with digit 2 resp. 0 instead of 3), A331864 (variant with floor(n/2-1) instead of floor(n/2)).
%Y A331865 Cf. A077779 (odd terms).
%K A331865 nonn,base,hard,more
%O A331865 1,3
%A A331865 _M. F. Hasler_, Jan 30 2020
%E A331865 a(18)-a(20) from _Giovanni Resta_, Jan 30 2020
%E A331865 a(21) from _Michael S. Branicky_, Feb 19 2025