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

A113625 Irregular triangle in which the n-th row contains all primes having digit sum n (not containing the digit '0') in increasing order.

Original entry on oeis.org

2, 11, 3, 13, 31, 211, 5, 23, 41, 113, 131, 311, 2111, 7, 43, 61, 151, 223, 241, 313, 331, 421, 1123, 1213, 1231, 1321, 2113, 2131, 2221, 2311, 3121, 4111, 11113, 11131, 11311, 12211, 21121, 21211, 22111, 111121, 111211, 112111, 17, 53, 71, 233, 251, 431, 521
Offset: 2

Views

Author

Amarnath Murthy, Nov 10 2005

Keywords

Comments

The number of primes in the n-th row is A073901(n). The smallest prime in the n-th row is A067180(n). The largest prime in the n-th row is A069869(n).

Examples

			Starting with row 2, the table is
2, 11
3
13, 31, 211
5, 23, 41, 113, 131, 311, 2111
none
7, 43, 61, 151, 223, 241, 313, 331, 421, 1123,...
		

Crossrefs

Cf. A110741 (with contraints on number of digits).

Programs

  • Maple
    with(combinat):
    b:= proc(n, i, l) option remember; `if`(n=0, select(isprime,
          map(x-> parse(cat(x[])), permute(l))), `if`(i<1, [],
          [seq(b(n-i*j, i-1, [l[],i$j])[], j=0..n/i)]))
        end:
    T:= n-> sort(b(n, 9, []))[]:
    seq(T(n), n=2..8);  # Alois P. Heinz, May 25 2013
  • Mathematica
    Table[If[n > 3 && Mod[n, 3] == 0, {}, p = IntegerPartitions[n]; u = {}; Do[t = Permutations[i]; u = Union[u, Select[FromDigits /@ t, PrimeQ]], {i, p}]; u], {n, 2, 14}]

Extensions

Edited, corrected and extended by Stefan Steinerberger, Aug 10 2007
Edited by T. D. Noe, Jan 25 2011

A110742 Number of primes with digit sum n having at most n digits.

Original entry on oeis.org

0, 2, 1, 8, 27, 0, 211, 500, 0, 5404, 23137, 0, 269736, 806856, 0, 10508986, 43103947, 0
Offset: 1

Views

Author

Amarnath Murthy, Aug 10 2005

Keywords

Comments

a(3n) = 0 for n > 1.
The binary version of this sequence is the characteristic function of A000043. [David Wasserman, Dec 17 2008]

Examples

			For a(2) the two primes are 2 and 11. 101 is not included because it has 3 digits.
		

Crossrefs

Cf. A110741.

Programs

  • PARI
    f(n, i, left, num) = if (i == n - 1, return(left <= 9 && isprime(num + left*10^i))); sum(j = 0, min(left, 9), f(n, i + 1, left - j, num + j*10^i));
    a(n) = f(n, 0, n, 0); \\ David Wasserman, Dec 17 2008

Extensions

a(7)-a(10) from Donovan Johnson, Mar 23 2008
More terms from David Wasserman, Dec 17 2008
Showing 1-2 of 2 results.