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

A239690 Base 4 sum of digits of prime(n).

Original entry on oeis.org

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

Views

Author

Tom Edgar, Mar 24 2014

Keywords

Comments

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

Examples

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

Crossrefs

Programs

  • Haskell
    a239690 = a053737 . a000040  -- Reinhard Zumkeller, Mar 20 2015
  • Magma
    [&+Intseq(NthPrime(n),4): n in [1..100]]; // Vincenzo Librandi, Mar 25 2014
    
  • Mathematica
    Table[Plus @@ IntegerDigits[Prime[n], 4], {n, 1, 100}] (* Vincenzo Librandi, Mar 25 2014 *)
  • Sage
    [sum(i.digits(base=4)) for i in primes_first_n(200)]
    

Formula

a(n) = A053737(A000040(n)).

A240886 Primes p equal to the sum in base-3 of the digits of all primes < p.

Original entry on oeis.org

23, 31, 47, 59, 695689, 698471, 883517, 992609, 992737, 993037, 1314239, 1324361, 1324571, 1326511, 1327289, 1766291, 3174029
Offset: 1

Views

Author

Anthony Sand, Apr 14 2014

Keywords

Comments

Conjecture: this sequence is finite and all terms are shown. - Robert G. Wilson v, Jul 27 2014
The sum of the digits in base three of all primes < 10^10 is 9694409092. - Robert G. Wilson v, Jul 27 2014

Examples

			For example, 23 = digit-sum(primes < 23, base=3) = sum(2) + sum(1,0) + sum(1,2) + sum(2,1) + sum(1,0,2) + sum(1,1,1) + sum(1,2,2) + sum(2,0,1).
		

Crossrefs

Cf. A239619 (Base 3 sum of digits of prime(n)).

Programs

  • Mathematica
    p = 2; s = 0; lst = {}; While[p < 3200000, If[s == p, AppendTo[lst, p]; Print[p]]; s = s + Total@ IntegerDigits[p, 3]; p = NextPrime[p]] (* Robert G. Wilson v, Jul 27 2014 *)
  • PARI
    sdt(n) = my(d = digits(n, 3)); sum(i=1, #d, d[i]);
    lista(nn) = {sp = 0; forprime(p=1, nn, if (p == sp, print1(p, ", ")); sp += sdt(p););} \\ Michel Marcus, May 02 2014

Formula

prime(n) such that, using base 3, prime(n) = sum_{1..n-1} A239619(i).

A241897 Primes p equal to the sum in base 3 of the digits of all primes < p - digit-sum of the index of prime p(i-1).

Original entry on oeis.org

67, 71, 97, 101, 149, 223, 656267, 697511, 697951, 698447, 699493, 700277, 715373, 883963, 888203, 888211, 992021, 992183, 992891, 993241, 994181, 1155607, 1155829, 1308121, 1308649, 1310093, 1313083, 1317409, 1320061, 1320157, 1320379, 1322521, 1322591
Offset: 1

Views

Author

Anthony Sand, May 01 2014

Keywords

Comments

There are no further solutions beyond a(46)=4539541 up to at least 10^10. - Andrew Howroyd, Mar 02 2018

Examples

			67 = digit-sum(2..61,b=3) - digit-sum(index(61),b=3) = sum(2) + sum(1,0) + sum(1,2) + sum(2,1) + sum(1,0,2) + sum(1,1,1) + sum(1,2,2) + sum(2,0,1) + sum(2,1,2) + sum(1,0,0,2) + sum(1,0,1,1) + sum(1,1,0,1) + sum(1,1,1,2) + sum(1,1,2,1) + sum(1,2,0,2) + sum(1,2,2,2) + sum(2,0,1,2) + sum(2,0,2,1) - digit-sum(200).
		

Crossrefs

A240886. Primes p equal to the digit-sum in base 3 of all primes < p. A168161. Primes p which are equal to the sum of the binary digits in all primes <= p.

Programs

  • PARI
    seq(maxp)={my(p=1,L=List(),s=0,k=0); while(pAndrew Howroyd, Mar 01 2018

Formula

prime(n) such that, using base 3, prime(n) = sum_{1..n-1} A239619(i) - sum_{index(n-1)}

Extensions

a(29)-a(33) from Andrew Howroyd, Mar 02 2018

A241895 Primes p equal to the sum in base 3 of the digits of all primes <= p.

Original entry on oeis.org

3, 37, 695663, 695881, 1308731, 1308757, 1313153, 1314301, 1326097, 1766227, 3204779, 14328191
Offset: 1

Views

Author

Anthony Sand, May 01 2014

Keywords

Examples

			3 = digit-sum(primes <= 3,base=3) = sum(2) + sum(1,0). 37 = digit-sum(primes <= 37,base=3) = sum(2) + sum(1,0) + sum(1,2) + sum(2,1) + sum(1,0,2) + sum(1,1,1) + sum(1,2,2) + sum(2,0,1) + sum(2,1,2) + sum(1,0,0,2) + sum(1,0,1,1) + sum(1,1,0,1).
		

Crossrefs

Cf. A168161 (similar in base 2), A240886 (similar but excluding p from the sum).

Programs

  • PARI
    sdt(n) = my(d = digits(n, 3)); sum(i=1, #d, d[i]);
    lista(nn) = {sp = 0; forprime(p=1, nn, sp += sdt(p); if (p == sp, print1(p, ", ")););} \\ Michel Marcus, May 02 2014

Formula

prime(n) such that, using base 3, prime(n) = sum_{1..n} A239619(i).

A241896 Increasingly ordered odd primes p(m) with p(m) = (sum of the digits of all primes p(i) in base 3 for i=1, 2, ..., m-1) + (sum of digits of m-1 in base 3).

Original entry on oeis.org

3, 5, 7, 11, 17, 29, 37, 695641, 695687, 695749, 695881, 699943, 700199, 715457, 883433, 883451, 883471, 883621, 992111, 992357, 992591, 993683, 1308563, 1309999, 1310041, 1310359, 1310993, 1313161, 1314191, 1314377, 1317271, 1324567, 1326097, 1326109, 1326649, 1760113, 1760287, 1766509, 1766537, 3173761, 3204779, 3204827, 4539191
Offset: 1

Views

Author

Anthony Sand, May 01 2014

Keywords

Examples

			prime(2) = 3  = A239619(1) + A053735(1) = 2 + 1. This is a(1) because it is the smallest odd prime from the defined set S.
prime(7) = 17 = sum_{i=1..6} A239619(i) + A053735(6) = (2 + 1 + 3 + 3 + 3 + 3) + 2 = 17. This is a(5) because it is the fifth smallest odd prime from the set S.
prime(6) = 13 is not a member of this sequence because (2 + 1 + 3 + 3 + 3) + 3 = 15 which is not equal 13, hence prime(6) is not a member of the set S.
		

Crossrefs

CF. A240886 (similar sequence with digit-sums), A168161 (similar sequence but in binary). A053735, A239619.

Formula

This is the increasingly ordered set of numbers
S:= {odd primes: prime(m) = sum_{i=1..m-1} A239619(i) + A053735(m-1)}.

Extensions

Edited. - Wolfdieter Lang, May 19 2014

A331112 Sum of the digits of the n-th prime number in balanced ternary.

Original entry on oeis.org

0, 1, -1, 1, 1, 3, -1, 1, -1, 1, 3, 3, -3, -1, -1, -1, -1, 1, 3, -1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, -1, -3, -1, 1, -3, -1, 1, 1, -1, 1, -1, 1, 1, 3, 1, 3, 1, 1, 1, 3, -1, -1, 1, 1, -1, 1, 1, 3, 3, 3, 5, -1, 3, -1, 1, 1, 3, 5, 1, 3, 3, 3, -3, -1, -1, -3, -1, -1, -3, 1, -3, -1, -1, 1, 1, 1, -3, -1, -1, 1, -1, -1, 1, -1, 3, -1, -1, 1, 3, 1
Offset: 1

Views

Author

Thomas König, Jan 09 2020

Keywords

Examples

			Using T for -1 and _bt as suffix for balanced ternary: 2_10 = 1T_bt, sum of digits is zero; 3_10 = 10_bt, sum of digits is 1 and 5_10 = 1TT, sum of digits = -1.
		

Crossrefs

See A007605 (sum of digits of primes in base 10); A239619 (sum of digits of primes in base 3).

Programs

  • C
    #include 
    #include 
    #define N 1000 /* Largest prime considered - 1  */
    char x[N];
    int main()
    {
      int i, n, v, s, r;
      for (i=4; i
    				
  • Maple
    b:= proc(n) `if`(n=0, 0, (d-> `if`(d=2,
          b(q+1)-1, d+b(q)))(irem(n, 3, 'q')))
        end:
    a:= n-> b(ithprime(n)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Jan 09 2020

Formula

a(n) = A065363(A000040(n)). - Alois P. Heinz, Jan 09 2020
Showing 1-6 of 6 results.