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-5 of 5 results.

A266141 Number of n-digit primes in which n-1 of the digits are 2's.

Original entry on oeis.org

4, 2, 3, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0
Offset: 1

Views

Author

Keywords

Comments

The leading digits must be 2's and only the trailing digit can vary.
For n large a(n) is usually zero.
a(n) <= 4. If n > 1 and not a multiple of 3, then a(n) <= 2. It appears that a(n) <= 1 for n > 3. - Chai Wah Wu, Dec 26 2015

Examples

			a(3) = 3 since 223, 227 and 229 are all primes.
		

Crossrefs

Programs

  • Mathematica
    d = 2; Array[Length@ Select[d (10^# - 1)/9 + (Range[0, 9] - d), PrimeQ] &, 100]
  • Perl
    use ntheory ":all"; sub a266141 { my $n=shift; return 4 if $n==1; 0+scalar(grep{is_prime("2"x($n-1).$)} 1,3,7,9); } say a266141($) for 1..20; # Dana Jacobsen, Dec 27 2015
  • Python
    from sympy import isprime
    def A266141(n):
        return 4 if n==1 else sum(1 for d in '1379' if isprime(int('2'*(n-1)+d))) # Chai Wah Wu, Dec 26 2015
    

A165402 a(n) = (2*10^n - 11)/9.

Original entry on oeis.org

1, 21, 221, 2221, 22221, 222221, 2222221, 22222221, 222222221, 2222222221, 22222222221, 222222222221, 2222222222221, 22222222222221, 222222222222221, 2222222222222221, 22222222222222221, 222222222222222221, 2222222222222222221, 22222222222222222221, 222222222222222222221
Offset: 1

Views

Author

Ivan Panchenko, Sep 17 2009

Keywords

Comments

a(n) are also n-1 twos followed by a one.
Sum of n-th row of triangle of powers of 10: 1; 10 1 10; 100 10 1 10 100; 1000 100 10 1 10 100 1000; ... - Philippe Deléham, Feb 24 2014

Examples

			a(1) = 1;
a(2) = 10 + 1 + 10 = 21;
a(3) = 100 + 10 + 1 + 10 + 100 = 221;
a(4) = 1000 + 100 + 10 + 1 + 10 + 100 + 1000 = 2221; etc. - _Philippe Deléham_, Feb 24 2014
		

Crossrefs

Cf. A084832 (positions of primes).

Programs

  • Mathematica
    Table[FromDigits[PadLeft[{1},n,2]],{n,20}] (* or *) (2*10^Range[20]-11)/9 (* Harvey P. Dale, Aug 10 2011 *)

Formula

From Philippe Deléham, Feb 24 2014: (Start)
a(n) = 10*a(n-1) + 11, a(1)=1.
a(n) = 11*a(n-1) - 10*a(n-2), a(1)=1, a(2)=21.
G.f.: x*(1+10*x)/((1-x)*(1-10*x)). (End)
E.g.f.: 1 + exp(x)*(2*exp(9*x) - 11)/9. - Elmo R. Oliveira, Jun 13 2025

A056660 Numbers k such that 20*R_k + 1 is a prime, where R_k = 11...1 is the repunit (A002275) of length k.

Original entry on oeis.org

3, 17, 99, 120, 243, 545, 630, 1493, 2565, 8087
Offset: 1

Views

Author

Robert G. Wilson v, Aug 09 2000

Keywords

Comments

Also numbers k such that (2*10^(k+1)-11)/9 is a prime.

Crossrefs

Cf. A002275, A084832, A091189 (corresponding primes).

Programs

  • Mathematica
    Do[ If[ PrimeQ[ 20*(10^n - 1)/9 + 1 ], Print[n]], {n, 7000}]

Formula

a(n) = A084832(n) - 1. - Robert Price, Jan 30 2015

Extensions

a(8) and a(9) from Rick L. Shepherd, Feb 22 2004
More terms from Herman Jamke (hermanjamke(AT)fastmail.fm), Jan 01 2008

A084831 Numbers n such that sum of odd divisors and sum of even divisors are both palindromic.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 43, 81, 86, 162, 201, 205, 211, 221, 241, 251, 271, 281, 325, 333, 344, 365, 422, 433, 443, 463, 482, 489, 519, 559, 633, 650, 685, 730, 793, 803, 827, 857, 866, 877, 886, 887, 1419, 1505, 1841, 2021, 2111, 2221, 2305, 2441, 2551, 2561, 2611
Offset: 1

Views

Author

Jason Earls, Jun 05 2003

Keywords

Comments

Primes of form 2*10^n + R(n) (A056700) and 2/9*(-1+10^n)-1 (A084832) are members.

Examples

			a(11)=162 because sum of even divisors is 242 and sum of odd divisors is 121.
		

Crossrefs

Programs

  • Mathematica
    sodQ[n_]:=Module[{dn=Divisors[n],o,e},o=IntegerDigits[Total[Select[ dn,OddQ]]]; e=IntegerDigits[Total[Select[dn,EvenQ]]]; o== Reverse[o] && e==Reverse[e]]; Select[Range[3000],sodQ] (* Harvey P. Dale, Feb 27 2013 *)

A091189 Primes of the form 20*R_k + 1, where R_k is the repunit (A002275) of length k.

Original entry on oeis.org

2221, 222222222222222221, 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221
Offset: 1

Views

Author

Rick L. Shepherd, Feb 22 2004

Keywords

Comments

Primes of the form 222...221.
The number of 2's in each term is given by the corresponding term of A056660 and so the first term too large to include above is 222...2221 (with 120 2's).

Crossrefs

Cf. A056660 (corresponding k), A084832.
Showing 1-5 of 5 results.