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 21-30 of 92 results. Next

A090433 Primes p(k) having a smaller sum of digits than k.

Original entry on oeis.org

11, 13, 23, 61, 101, 103, 107, 109, 151, 163, 211, 223, 227, 241, 251, 271, 311, 313, 317, 331, 337, 347, 401, 421, 431, 433, 443, 461, 503, 509, 521, 523, 701, 911, 1009, 1013, 1021, 1031, 1033, 1051, 1061, 1063, 1103, 1109, 1117, 1123, 1129, 1151
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 01 2003

Keywords

Comments

A090431(a(n)) > 0.

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[200]],Total[IntegerDigits[#]]Harvey P. Dale, Mar 05 2017 *)

A239692 Base 6 sum of digits of prime(n).

Original entry on oeis.org

2, 3, 5, 2, 6, 3, 7, 4, 8, 9, 6, 2, 6, 3, 7, 8, 9, 6, 7, 11, 3, 4, 8, 9, 7, 11, 8, 12, 4, 8, 7, 11, 12, 9, 9, 6, 7, 8, 12, 13, 14, 6, 11, 8, 12, 9, 11, 3, 7, 4, 8, 9, 6, 11, 7, 8, 9, 6, 7, 11, 8, 8, 7, 11, 8, 12, 6, 7, 12, 9, 13, 14, 7, 8, 9, 13, 14, 7, 11, 9
Offset: 1

Views

Author

Tom Edgar, Mar 24 2014

Keywords

Comments

a(n) is the rank of prime(n) in the base-6 dominance order on the natural numbers.

Examples

			The sixth prime is 13, 13 in base 6 is (2,1) so a(6)=2+1=3.
		

Crossrefs

Programs

  • Magma
    [&+Intseq(NthPrime(n),6): n in [1..100]]; // Vincenzo Librandi, Mar 25 2014
    
  • Mathematica
    Table[Plus @@ IntegerDigits[Prime[n], 6], {n, 1, 100}] (* Vincenzo Librandi, Mar 25 2014 *)
  • PARI
    a(n) = sumdigits(prime(n), 6); \\ Michel Marcus, Mar 04 2023
  • Sage
    [sum(i.digits(base=6)) for i in primes_first_n(200)]
    

Formula

a(n) = A053827(A000040(n)).

A066538 Sum of the digits of the n-th Mersenne prime (A000668).

Original entry on oeis.org

3, 7, 4, 10, 19, 13, 28, 46, 73, 112, 139, 154, 697, 847, 1675, 3106, 3106, 4258, 5755, 5950, 13216, 13693, 14980, 27202, 28939, 31339, 60337, 116455, 149365, 179488, 291745, 1026544, 1163443, 1704376, 1893388, 4038358, 4092673, 9440671, 18243946, 28445131, 32580433, 35170384, 41201947, 44142151, 50349694, 57766339, 58416637
Offset: 1

Views

Author

Robert G. Wilson v, Jan 06 2002

Keywords

Comments

From Gord Palameta, Jul 21 2018: (Start)
a(38) and a(39) were calculated by Enoch Haga, Sep 07 1999 and Dec 17 2001; a(40) through a(42) were calculated by Andrew Rupinski, Mar 12 2005. (See the Carlos Rivera link.)
It appears that asymptotically a(n)/A000043(n) = 9*log_10(2)/2. (End)

Crossrefs

Subsequence of: A007953, A007605.
Cf. A001370 (sum of digits of 2^n).

Programs

  • Mathematica
    ep = {the exponents from A000043}; a = {}; Do[ a = Append[a, Apply[ Plus, IntegerDigits[ 2^ep[[n]] - 1]]], {n, 1, 47} ]; a
    (* Second program: *)
    Array[Total@ IntegerDigits[2^MersennePrimeExponent@ # - 1] &, 45] (* Michael De Vlieger, Jul 22 2018 *)

Formula

a(n) = A007953(A000668(n)). - Amiram Eldar, Oct 16 2024

Extensions

Definition corrected by Omar E. Pol, Apr 01 2008
a(38)-a(47) from Gord Palameta, Jul 21 2018

A074462 Average digit (rounded up) in the decimal expansion of prime(n).

Original entry on oeis.org

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

Views

Author

Y. Kelly Itakura (yitkr(AT)mta.ca), Aug 23 2002

Keywords

Examples

			The prime numbers begin with 2,3,5,7,11,13,17,19,23,... so the average digits rounded up are 2, 3, 5, 7, (1+1)/2=1, (1+3)/2=2, (1+7)/2=4, (1+9)/2=5, ceiling((2+3)/2)=3, ...
		

Crossrefs

Programs

  • Mathematica
    Table[Ceiling[Mean[IntegerDigits[p]]],{p,Prime[Range[120]]}] (* Harvey P. Dale, Nov 06 2022 *)
  • PARI
    a(n) = my(d=digits(prime(n))); ceil(vecsum(d)/#d); \\ Michel Marcus, Apr 23 2022

Formula

a(n) = ceiling(A007605(n)/A097944(n)). - R. J. Mathar, Sep 23 2008
a(n) = A004427(A000040(n)). - Reinhard Zumkeller, May 27 2010

Extensions

Offset changed to 1, cf. to A073342 added, and extended by R. J. Mathar, Sep 23 2008

A090432 Primes prime(k) having a greater sum of digits than does k.

Original entry on oeis.org

2, 3, 5, 7, 17, 19, 29, 31, 37, 41, 43, 47, 53, 59, 67, 71, 73, 79, 83, 89, 97, 113, 127, 137, 139, 149, 157, 167, 173, 179, 181, 191, 193, 197, 199, 229, 233, 239, 257, 269, 277, 281, 283, 293, 307, 349, 353, 359, 367, 373, 379, 383, 389, 397, 409, 419, 439
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 01 2003

Keywords

Comments

A090431(a(n)) < 0.

Crossrefs

Programs

  • Mathematica
    Prime[#]&/@Select[Range[100],Total[IntegerDigits[Prime[#]]]-Total[IntegerDigits[#]]>0&] (* Michel Lagneau, Nov 07 2015 *)
  • PARI
    isok(n) = sumdigits(prime(n)) > sumdigits(n); \\ Michel Marcus, Nov 07 2015

A104247 Primes that are the sum of digits of the first k primes for some k.

Original entry on oeis.org

2, 5, 17, 19, 23, 31, 41, 61, 71, 83, 181, 269, 389, 419, 449, 631, 683, 727, 743, 809, 929, 1039, 1061, 1069, 1091, 1277, 1381, 1481, 1567, 1613, 1747, 1873, 1951, 1993, 2039, 2129, 2281, 2297, 2339, 2381, 2549, 2579
Offset: 1

Views

Author

Zak Seidov, Feb 26 2005

Keywords

Examples

			a(4)=19 because A058049(4)= 5 and sum of digits of the first 5 primes, 2+3+5+7+(1+1)=19 is prime.
		

Crossrefs

Corresponding n's: A058049. Primes: A000040, sum of digits of primes: A007605.

Programs

  • Python
    from sympy import isprime, nextprime
    def sd(n): return sum(map(int, str(n)))
    def aupto(limit):
        alst, k, p, s = [], 1, 2, 2
        while s <= limit:
            if isprime(s): alst.append(s)
            k += 1; p = nextprime(p); s += sd(p)
        return alst
    print(aupto(2579)) # Michael S. Branicky, Jul 18 2021

Formula

a(n) = A007605(1) + ... + A007605(A058049(n)).

A104251 Sum of nonprime digits of n-th prime.

Original entry on oeis.org

0, 0, 0, 0, 2, 1, 1, 10, 0, 9, 1, 0, 5, 4, 4, 0, 9, 7, 6, 1, 0, 9, 8, 17, 9, 2, 1, 1, 10, 2, 1, 2, 1, 10, 14, 2, 1, 7, 7, 1, 10, 10, 11, 10, 10, 19, 2, 0, 0, 9, 0, 9, 5, 1, 0, 6, 15, 1, 0, 9, 8, 9, 0, 2, 1, 1, 1, 0, 4, 13, 0, 9, 6, 0, 9, 8, 17, 9, 5, 13, 14, 5, 5, 4, 13, 8, 17, 4, 11, 10, 10, 13, 12
Offset: 1

Views

Author

Zak Seidov, Feb 26 2005

Keywords

Examples

			a(6)=1 because sum of composite (nonprime) digits of prime(6)=13 is 1.
		

Crossrefs

Cf. A000040 (primes).
Cf. A007605 (sum of digits of primes), A104250 (sum of prime digits of n-th prime).

Formula

a(n) = A007605(n) - A104250(n).

A178701 An irregular array read by rows. The k-th entry of row r is the number of r-digit primes with digit sum k.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 2, 2, 2, 3, 3, 3, 1, 1, 2, 1, 1, 2, 4, 7, 7, 12, 13, 16, 16, 13, 18, 12, 11, 6, 4, 1, 0, 0, 4, 8, 20, 19, 31, 52, 67, 77, 93, 101, 116, 95, 92, 91, 63, 51, 29, 30, 16, 5, 0, 1, 0, 4, 12, 28, 45, 95, 143, 236, 272, 411, 479, 630, 664, 742, 757, 741, 706, 580, 528, 379, 341, 205, 166, 84, 62, 34, 13, 4, 2, 0, 2, 14, 58, 76, 204, 389, 660, 852, 1448, 1971, 2832, 3101, 4064, 4651, 5393, 5376, 5570, 5785, 5287, 4796
Offset: 1

Views

Author

Robert G. Wilson v, Dec 29 2010

Keywords

Comments

Each row, r, has 6r-1 terms. The first row does not account for the prime 3 and its count of 1.

Examples

			To begin the second row, only 11 has digit-sum 2, so the first term is 1; both 13 & 31 have digit-sum 4 so the second term is 2; both 23 & 41 have digit-sum 5, so the third term is 2; etc.
To begin the third row, only 101 -> 2, so its first term is 1, both 103 & 211 -> 4 so its second term is 2; 113, 131, 311 & 401 -> 5, so its third term is 4; etc.
  \k 2, 4,  5,  7,  8,  10,  11,  13,  14,   16,   17,   19,   20,   22,   23,   25,   26, ...
  r\
  1: 1, 0,  1,  1,  0;
  2: 1, 2,  2,  2,  3,   3,   3,   1,   1,    2,    1;
  3: 1, 2,  4,  7,  7,  12,  13,  16,  16,   13,   18,   12,   11,    6,    4,    1,    0;
  4: 0, 4,  8, 20, 19,  31,  52,  67,  77,   93,  101,  116,   95,   92,   91,   63,   51, ...
  5: 0, 4, 12, 28, 45,  95, 143, 236, 272,  411,  479,  630,  664,  742,  757,  741,  706, ...
  6: 0, 2, 14, 58, 76, 204, 389, 660, 852, 1448, 1971, 2832, 3101, 4064, 4651, 5393, 5376, ...
etc.
		

Crossrefs

Row sums (except for the first term) give A006879. The indices k are given by A001651 (beginning with 2).

Programs

  • Mathematica
    dir[n_] := Floor[(3 n + 2)/2]; inv[n_] := Floor[(2 n - 1)/3]; f[n_] := Block[{p = NextPrime[10^(n - 1)], t = Table[0, {inv[9 n]}]}, While[p < 10^n, t[[ inv[Plus @@ IntegerDigits@ p]]]++; p = NextPrime@ p]; t]; Array[f, 5] // Flatten

A239693 Base 7 sum of digits of prime(n).

Original entry on oeis.org

2, 3, 5, 1, 5, 7, 5, 7, 5, 5, 7, 7, 11, 7, 11, 5, 5, 7, 7, 5, 7, 7, 11, 11, 13, 5, 7, 5, 7, 5, 7, 11, 11, 13, 5, 7, 7, 7, 11, 11, 11, 13, 11, 13, 5, 7, 7, 13, 11, 13, 11, 11, 13, 11, 11, 11, 11, 13, 13, 11, 13, 17, 13, 11, 13, 11, 13, 13, 5, 7, 5, 5, 7, 7
Offset: 1

Views

Author

Tom Edgar, Mar 24 2014

Keywords

Comments

a(n) is the rank of prime(n) in the base-7 dominance order on the natural numbers.

Examples

			The fifth prime is 11, 11 in base 7 is (1,4) so a(5)=1+4=5.
		

Crossrefs

Programs

  • Magma
    [&+Intseq(NthPrime(n),7): n in [1..100]]; // Vincenzo Librandi, Mar 25 2014
    
  • Mathematica
    Table[Plus @@ IntegerDigits[Prime[n], 7], {n, 1, 100}] (* Vincenzo Librandi, Mar 25 2014 *)
  • PARI
    a(n) = sumdigits(prime(n), 7); \\ Michel Marcus, Mar 04 2023
  • Sage
    [sum(i.digits(base=7)) for i in primes_first_n(200)]
    

Formula

a(n) = A053828(A000040(n)).

A242368 Primes p such that p + digitsum(p) = q^k for some prime q and k > 1 where digitsum(n) = A007953(n).

Original entry on oeis.org

2, 17, 347, 521, 10601, 28541, 29759, 32027, 39569, 58061, 62969, 100469, 109541, 120401, 130307, 205357, 398129, 426383, 434261, 829883, 896771, 923501, 935063, 1190261, 1216583, 1261109, 1559963, 1697771, 2105381, 2128649, 2505857, 2778851, 2886563, 2920649
Offset: 1

Views

Author

J. M. Bergot, Aug 16 2014

Keywords

Comments

With k>1 the number of entries is greatly reduced compared to simply allowing p+digsum(p) = q. One could allow for k=1 to see how many entries could be found for a variation of this sequence.

Examples

			a(4)=521 because 521+5+2+1=529=23^2 and 23 is a prime.
		

Crossrefs

Programs

  • Mathematica
    a242368[n_Integer] := Module[{p, pp}, p = Prime[n]; pp = p + Plus @@ IntegerDigits@p; If[And[Length@FactorInteger[pp] == 1,
        Min[Last@Transpose[FactorInteger[pp]]] > 1], p, 0]]; Rest@Sort@DeleteDuplicates[a242368 /@ Range[10^6]] (* Michael De Vlieger, Aug 16 2014 *)
  • PARI
    dsum(n)=n=digits(n); sum(i=1,#n,n[i])
    is(p)=isprimepower(p+dsum(p))>1 && isprime(p)
    forprime(p=2,1e9,if(is(p), print1(p", "))) \\ Charles R Greathouse IV, Aug 16 2014

Extensions

More terms from Charles R Greathouse IV, Aug 16 2014
Previous Showing 21-30 of 92 results. Next