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.

Previous Showing 11-13 of 13 results.

A285095 Corresponding values of arithmetic means of digits of primes from A069709.

Original entry on oeis.org

2, 3, 5, 7, 1, 2, 4, 5, 2, 5, 4, 7, 4, 5, 8, 8, 1, 2, 4, 4, 2, 1, 2, 4, 5, 4, 4, 4, 5, 2, 5, 2, 4, 4, 4, 5, 4, 5, 4, 4, 4, 5, 7, 1, 5, 2, 2, 4, 4, 5, 4, 4, 2, 4, 5, 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 4, 5, 4, 5, 5, 5, 1, 2, 2, 4, 4, 5, 2, 2, 4, 4, 5, 4, 4, 5, 4, 5
Offset: 1

Views

Author

Jaroslav Krizek, Apr 16 2017

Keywords

Crossrefs

Cf. A069709 (primes with integer arithmetic mean of digits in base 10).
Sequences of primes such that a(n) = k for k = 1, 2, 4, 5, 7 and 8: A069710 (k = 1), A285096 (k = 2), A285225 (k = 4), A285226 (k = 5), A285227 (k = 7), A285228 (k = 8).

Programs

  • Magma
    [&+Intseq(n) / #Intseq(n): n in [1..100000] | IsPrime(n) and &+Intseq(n) mod #Intseq(n) eq 0];

A308335 Palindromic primes such that sum of digits = number of digits.

Original entry on oeis.org

11, 10301, 1201021, 3001003, 10000900001, 10002520001, 10013131001, 10111311101, 10301110301, 11012121011, 11020302011, 11030103011, 11100500111, 11120102111, 12000500021, 12110101121, 13100100131, 30000500003, 30011111003, 1000027200001, 1000051500001
Offset: 1

Views

Author

Bernard Schott, May 20 2019

Keywords

Comments

Every palindrome with an even number of digits is divisible by 11, so 11 is the only term of the sequence with an even number of digits.
Every palindrome with a number of digits which is a multiple of 3 also has a sum of digits which is divisible by 3, so there is no term with 3*k digits.
So, except 11 with 2 digits, the terms of this sequence must have a number of digits that belongs to A007310.
For n > 1, the middle digit of a(n) is odd. - Chai Wah Wu, Jun 30 2019

Examples

			3001003 is a term because it is a palindromic prime that has 7 digits and its sum of its digits is 7.
		

Crossrefs

Intersection of A000040 (primes), A002113 (palindromes) and A061384 (sum of digits = number of digits).
Intersection of A002385 and A061384.
Intersection of A069710 and A002113.

Programs

  • Mathematica
    f[n_] := If[n==2, {11}, If[Mod[(n-1) (n-5), 6]>0, {}, Block[{h = (n - 1)/2, L={}, p}, Do[p = Select[ Flatten[ Permutations /@ IntegerPartitions[ (n - c)/2, {h}, Range[0, 9]], 1], MemberQ[{1, 3, 7, 9}, Last[#]] &]; L = Join[L, Select[ FromDigits /@ (Flatten[{Reverse[#], c, #}] & /@ p), PrimeQ]], {c, 1, n-2, 2}]; Sort[L]]]]; Join @@ (f /@ Range[13]) (* Giovanni Resta, Jun 06 2019 *)
  • PARI
    isok(p) = isprime(p) && (d=digits(p)) && (Vecrev(d) == d) && (#d == vecsum(d)); \\ Michel Marcus, Jun 29 2019

Extensions

a(6)-a(21) from Jon E. Schoenfield, May 20 2019

A073902 Number of n-digit primes with digit sum n.

Original entry on oeis.org

0, 1, 0, 4, 12, 0, 95, 212, 0, 2395, 10657, 0, 126068, 375941, 0, 4943357, 20513691, 0, 271911476
Offset: 1

Views

Author

Amarnath Murthy, Aug 18 2002

Keywords

Comments

a(3n) = 0. - Sascha Kurz, Aug 23 2002

Examples

			a(2) = 1 because the only two-digit prime with digit sum 2 is 11. a(5) = 12: the primes are 10103, 10211, 10301, 11003, 12011, 12101, 13001, 20021, 20201, 21011, 21101, and 30011.
		

Crossrefs

Cf. A069710.

Programs

  • Mathematica
    Table[Length[Select[Prime[Range[PrimePi[10^(n-1)]+1,PrimePi[10^n]]], Total[IntegerDigits[#]]==n&]],{n,8}] (* Harvey P. Dale, Aug 09 2011 *)
  • Python
    from sympy import isprime
    def nextsod(n, base):
        c, b, w = 0, base, 0
        while True:
            d = n%b
            if d+1 < b and c:
                return (n+1)*b**w + ((c-1)%(b-1)+1)*b**((c-1)//(b-1))-1
            c += d; n //= b; w += 1
    def a(n):
        if n%3 == 0: return 0
        c, t = 0, 10**(n-1) + ((n-1)%9+1)*10**((n-1)//9)-1
        while t < 10**n:
            if isprime(t): c += 1
            t = nextsod(t, 10)
        return c
    print([a(n) for n in range(1, 13)]) # Michael S. Branicky, Aug 02 2022

Extensions

More terms from Sascha Kurz, Aug 23 2002
a(4) and a(5) corrected, and example corrected, by Harvey P. Dale, Aug 09 2011
a(11) corrected and a(13)-a(15) from Donovan Johnson, Aug 10 2011
a(16)-a(18) from David Radcliffe, May 05 2015
a(19) from Michael S. Branicky, Aug 02 2022
Previous Showing 11-13 of 13 results.