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

A133223 Sum of digits of primes (A007605), sorted and with duplicates removed.

Original entry on oeis.org

2, 3, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20, 22, 23, 25, 26, 28, 29, 31, 32, 34, 35, 37, 38, 40, 41, 43, 44, 46, 47, 49, 50, 52, 53, 55, 56, 58, 59, 61, 62, 64, 65, 67, 68, 70, 71, 73, 74, 76, 77, 79, 80, 82, 83, 85, 86, 88, 89, 91, 92, 94, 95, 97, 98, 100, 101, 103
Offset: 1

Views

Author

Lekraj Beedassy, Dec 19 2007

Keywords

Comments

Presumably this is 3 together with numbers greater than 1 and not divisible by 3 (see A001651). - Charles R Greathouse IV, Jul 17 2013. (This is not a theorem because we do not know if, given s > 3 and not a multiple of 3, there is always a prime with digit-sum s. Cf. A067180, A067523. - N. J. A. Sloane, Nov 02 2018)
From Chai Wah Wu, Nov 04 2018: (Start)
Conjecture: for s > 10 and not a multiple of 3, there exists a prime with digit-sum s consisting only of the digits 2 and 3 (cf. A137269). This conjecture has been verified for s <= 2995.
Conjecture: for s > 18 and not a multiple of 3, there exists a prime with digit-sum s consisting only of the digits 3 and 4. This conjecture has been verified for s <= 1345.
Conjecture: for s > 90 and not a multiple of 3, there exists a prime with digit-sum s consisting only of the digits 8 and 9. This conjecture has been verified for s <= 8995.
Conjecture: for 0 < a < b < 10, gcd(a, b) = 1 and ab not a multiple of 10, if s > 90 and s is not a multiple of 3, then there exists a prime with digit-sum s consisting only of the digits a and b. (End)

Crossrefs

Extensions

Corrected by Jeremy Gardiner, Feb 09 2014

A265433 Number of primes with digit sum n whose digit product is maximal among all numbers with digit sum n.

Original entry on oeis.org

0, 1, 1, 0, 1, 0, 2, 1, 0, 1, 2, 0, 5, 1, 0, 4, 3, 0, 8, 2, 0, 2, 2, 0, 10, 1, 0, 5, 4, 0, 8, 1, 0, 4, 2, 0, 17, 0, 0, 7, 4, 0, 13, 3, 0, 0, 3, 0, 17, 4, 0, 12, 1, 0, 13, 1, 0, 6, 2, 0, 18, 1, 0, 11, 0, 0, 24, 2, 0, 5, 1, 0, 25, 1, 0, 10, 2, 0, 23, 2, 0, 9, 1
Offset: 1

Views

Author

Chai Wah Wu, Dec 08 2015

Keywords

Comments

If n == 0 mod 3, then a(n) = 0.
If n == 1 mod 3, then primes with maximal digit product (if they exist) have digits 3 and either two digits 2 or a single digit 4.
If n == 2 mod 3, then primes with maximal digit product (if they exist) have digits 3 and a single digit 2 (see comment in A137269).
If n == 0 mod 3 or a(n) > 0, then a(n) = A137269(n). Terms a(n) coincide with A137269 except for n = 4, 38, 46, 65, 94, 107, 116, 128, 131, 140, 143, 149, 152, 170, 188, 227, ..., 767 (and most likely other n > 767). For these values of n, a(n) = 0 and A137269(n) > 0.
Conjecture: For n > 4, if n <> 0 mod 3 and a(n) = 0, then A137269(n) > 0 due to primes with only digits 2, 3, or 4.

Examples

			See examples in A137269. a(4) = 0 since the maximal digit product is 4 corresponding to the numbers 22 and 4, neither of which is prime.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{g, a265437 = {1, 4, 38, 46, 65, 94, 107, 116, 128, 131, 140, 143, 149, 152, 170, 188, 227, 230, 248, 272, 293, 302, 317, 335, 344, 359, 371, 382, 404, 488, 530, 533, 551, 584, 626, 647, 722, 767, 803, 815, 866, 875, 893, 914, 920}},
      g[k_] := Length@ MaximalBy[k, Times @@ IntegerDigits@ # &];
      Which[MemberQ[a265437, n], 0,
       1 < n <= 3, 1,
       Mod[n, 3] == 0, 0,
       Mod[n, 3] == 1, g@ Select[FromDigits /@ Apply[Join, Map[Permutations, {Join[Table[3, {Floor[n/3] - 1}], {2, 2}], Join[Table[3, {Floor[n/3] - 1}], {4}]}]] /. x_ /; EvenQ@ x -> Nothing, PrimeQ],
       Mod[n, 3] == 2, g@ Select[FromDigits /@ Permutations@ Join[Table[3, {Floor[n/3]}], {2}] /. x_ /; EvenQ@ x -> Nothing, PrimeQ],
    True, -1]] (* Michael De Vlieger, Dec 11 2015, Version 10, reliant on values of A265437 *)
  • Python
    from _future_ import division
    from sympy.utilities.iterables import multiset_permutations
    from sympy import isprime
    def A265433(n):
        if n == 1:
            return 0
        if n == 3:
            return 1
        if (n % 3) == 0:
            return 0
        else:
            pmaxlist = ['3'*(n//3) + '2'] if (n % 3 == 2) else ['3'*(n//3 -1) + '22','3'*(n//3 -1) + '4']
            return sum(1 for p in pmaxlist for k in multiset_permutations(p) if isprime(int(''.join(k)))) # Chai Wah Wu, Dec 11 2015

A265437 Numbers n such that A265433(n) = 0 and n is not a multiple of 3.

Original entry on oeis.org

1, 4, 38, 46, 65, 94, 107, 116, 128, 131, 140, 143, 149, 152, 170, 188, 227, 230, 248, 272, 293, 302, 317, 335, 344, 359, 371, 382, 404, 488, 530, 533, 551, 584, 626, 647, 722, 767, 803, 815, 866, 875, 893, 914, 920, 1016, 1034, 1040, 1070, 1082, 1133, 1160
Offset: 1

Views

Author

Chai Wah Wu, Dec 10 2015

Keywords

Comments

Conjecture: if n > 4 is in the sequence, then A137269(n) > 0 due to primes with only digits 2, 3, 4.

Crossrefs

Showing 1-3 of 3 results.