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.

Showing 1-4 of 4 results.

A332113 a(n) = (10^(2n+1)-1)/9 + 2*10^n.

Original entry on oeis.org

3, 131, 11311, 1113111, 111131111, 11111311111, 1111113111111, 111111131111111, 11111111311111111, 1111111113111111111, 111111111131111111111, 11111111111311111111111, 1111111111113111111111111, 111111111111131111111111111, 11111111111111311111111111111, 1111111111111113111111111111111
Offset: 0

Views

Author

M. F. Hasler, Feb 09 2020

Keywords

Comments

See A107123 = {0, 1, 2, 19, 97, 9818, ...} for the indices of primes.

Crossrefs

Cf. (A077779-1)/2 = A107123: indices of primes; A331864 & A331865 (non-palindromic variants).
Cf. A002275 (repunits R_n = (10^n-1)/9), A011557 (10^n).
Cf. A138148 (cyclops numbers with binary digits), A002113 (palindromes).
Cf. A332123 .. A332193 (variants with different repeated digit 2, ..., 9).
Cf. A332112 .. A332119 (variants with different middle digit 2, ..., 9).

Programs

  • Maple
    A332113 := n -> (10^(2*n+1)-1)/9+2*10^n;
  • Mathematica
    Array[(10^(2 # + 1)-1)/9 + 2*10^# &, 15, 0]
  • PARI
    apply( {A332113(n)=10^(n*2+1)\9+2*10^n}, [0..15])
    
  • Python
    def A332113(n): return 10**(n*2+1)//9+2*10**n

Formula

a(n) = A138148(n) + 3*10^n = A002275(2n+1) + 2*10^n.
G.f.: (3 - 202*x + 100*x^2)/((1 - x)(1 - 10*x)(1 - 100*x)).
a(n) = 111*a(n-1) - 1110*a(n-2) + 1000*a(n-3) for n > 2.

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

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 8, 12, 20, 39, 74, 78, 80, 84, 104, 195, 654, 980, 2076, 5940, 19637
Offset: 1

Views

Author

M. F. Hasler, Jan 30 2020

Keywords

Comments

The corresponding primes are a subsequence of A105992: near-repunit primes.
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.
a(22) > 50000. - Michael S. Branicky, Feb 19 2025

Examples

			For n = 0, R(0) + 2*10^floor(0/2) = 2 is prime.
For n = 1, R(1) + 2*10^floor(1/2) = 3 is prime.
For n = 2, R(2) + 2*10^floor(2/2) = 31 is prime.
For n = 3, R(3) + 2*10^floor(3/2) = 131 is prime.
For n = 5, R(5) + 2*10^floor(5/2) = 11311 is prime.
For n = 6, R(6) + 2*10^floor(6/2) = 113111 is prime.
		

Crossrefs

Cf. A105992 (near-repunit primes), A002275 (repunits), A004023 (indices of prime repunits), A011557 (powers of 10).
Cf. A331860 & A331863 (variants with digit 2 resp. 0 instead of 3), A331864 (variant with floor(n/2-1) instead of floor(n/2)).
Cf. A077779 (odd terms).

Programs

  • Mathematica
    Select[Range[0, 2500], PrimeQ[(10^# - 1)/9 + 2*10^Floor[#/2]] &] (* Michael De Vlieger, Jan 31 2020 *)
  • PARI
    for(n=0,9999,isprime(p=10^n\9+2*10^(n\2))&&print1(n","))

Extensions

a(18)-a(20) from Giovanni Resta, Jan 30 2020
a(21) from Michael S. Branicky, Feb 19 2025

A331867 Numbers n for which R(n) + 3*10^floor(n/2-1) is prime, where R(n) = (10^n-1)/9 (repunit: A002275).

Original entry on oeis.org

68, 5252, 5494, 7102
Offset: 1

Views

Author

M. F. Hasler, Jan 30 2020

Keywords

Comments

The corresponding primes are a subsequence of A105992: near-repunit primes.
In base 10, R(n) + 3*10^floor(n/2-1) has ceiling(n/2) digits 1, one digit 4, and again floor(n/2-1) digits 1. For odd and even n, the digit 4 is just to the right of the middle of the number.
For odd n = 2m + 1, f(n) = R(n) + 3*10^floor(n/2-1) is divisible by 3, 7 or 13 when m is congruent 1 or 4, 3 or 5, resp. 0 or 2 (mod 6): there can't be an odd term.
For even n = 2m, f(n) is divisible by 3 or 7 when m is congruent to 0 or 3, resp. 1 or 2 (mod 6). When m = 6k + 4, then f(n) is prime for k = 5 and 437 (and no further k <= 600), and divisible by 23 or 53 when k is congruent to 10 (mod 11) resp. 3 (mod 13). When m = 6k + 5, f(n) is prime for k = 457 and 591 and no other value up to 600, and divisible by 23, 47, 53, 97, 163, 181, 859, ... for k congruent to 5 (mod 11), 11 (mod 23), 5 (mod 13), 0 (mod 32), 13 (mod 27), 26 (mod 30), 3 (mod 13), ..., respectively.
a(5) > 7272.

Examples

			For n = 2, R(2) + 3*10^floor(2/2-1) = 14 = 2*7 is not prime.
For n = 3, R(3) + 3*10^floor(3/2-1) = 114 = 2*3*19 is not prime.
For n = 4, R(4) + 3*10^floor(4/2) = 1141 = 7*163 is not prime.
For n = 5, R(5) + 3*10^floor(5/2) = 11141 = 13*857 is not prime.
For n = 68, R(68) + 3*10^floor(68/2) = 1...1141...1 is prime, with 34 digits '1' to the left of a digit '4' and 33 digits '1' to its right.
		

Crossrefs

Cf. A105992 (near-repunit primes), A002275 (repunits), A004023 (indices of prime repunits), A011557 (powers of 10).
Cf. A331860, A331863, A331864 (variants with digit 2, 0 resp. 3 instead of 4), A331866 (variant with floor(n/2) instead of floor(n/2-1)).

Programs

  • Mathematica
    Select[Range[2, 2500], PrimeQ[(10^# - 1)/9 + 3*10^Floor[#/2 - 1]] &]  (* corrected by Amiram Eldar, Feb 10 2020 *)
  • PARI
    for(n=2,9999,isprime(p=10^n\9+3*10^(n\2-1))&&print1(n","))

A331868 Numbers k for which R(k) + 4*10^floor(k/2-1) is prime, where R(n) = (10^n-1)/9 (repunit: A002275).

Original entry on oeis.org

4, 147, 270, 1288, 1551, 3427
Offset: 1

Views

Author

M. F. Hasler, Jan 30 2020

Keywords

Comments

The corresponding primes are a subsequence of A105992: near-repunit primes.
In base 10, R(n) + 4*10^floor(n/2-1) has ceiling(n/2) digits 1, one digit 5, and again floor(n/2-1) digits 1. For odd and even n as well, the digit 5 appears just to the right of the middle of the number.
a(7) > 10^4. - Daniel Suteu, Feb 10 2020
a(7) > 5*10^4. - Michael S. Branicky, Nov 02 2024

Examples

			For n = 4, R(4) + 4*10^floor(4/2-1) = 1151 is prime.
For n = 5, R(5) + 4*10^floor(5/2-1) = 11151 =  3^3*7*59 is not prime.
For n = 147, R(147) + 4*10^72 = 1(74)51(72) is prime, where (.) indicates how many times the preceding digit is repeated.
		

Crossrefs

Cf. A105992 (near-repunit primes), A002275 (repunits), A004023 (indices of prime repunits), A011557 (powers of 10).
Cf. A331863, A331860, A331864, A331867 (variants with digit 0, 2, 3 resp. 4 instead of 5), A331869 (variant with floor(n/2) instead of floor(n/2-1)).

Programs

  • Mathematica
    Select[Range[2, 2500], PrimeQ[(10^# - 1)/9 + 4*10^Floor[#/2 - 1]] &]
  • PARI
    for(n=2,9999,isprime(p=10^n\9+4*10^(n\2-1))&&print1(n","))

Extensions

a(6) from Daniel Suteu, Feb 10 2020
Showing 1-4 of 4 results.