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.

User: Tjandra Satria Gunawan

Tjandra Satria Gunawan's wiki page.

Tjandra Satria Gunawan has authored 2 sequences.

A214506 Last digit of the smallest prime number in base 10 with n digits.

Original entry on oeis.org

2, 1, 1, 9, 7, 3, 3, 9, 7, 7, 9, 3, 9, 7, 1, 7, 1, 3, 3, 1, 9, 7, 9, 7, 7, 3, 7, 3, 1, 9, 7, 3, 9, 1, 3, 9, 7, 3, 3, 3, 1, 9, 3, 7, 1, 9, 1, 3, 3, 9, 1, 1, 7, 1, 1, 1, 3, 9, 9, 9, 7, 3, 7, 1, 7, 9, 9, 9, 9, 9, 3, 3, 9, 9, 7, 9, 3, 1, 3, 9, 9, 3, 1, 7, 1, 3
Offset: 1

Author

Tjandra Satria Gunawan, Jul 19 2012

Keywords

Comments

The last digit of the first prime number in base 10 with n digits for n = 1, 2, 3 is 211, because 2 is the least with 1 digit, 11 the least with 2 digits, 101 the least with 3 digits. The concatenation, 211, is prime. This does not happen again through 24 digits. - Jonathan Vos Post, Jul 04 2012

Programs

  • Mathematica
    Table[Mod[NextPrime[10^n],10],{n,0,30}] (* Harvey P. Dale, Jan 25 2013 *)

Formula

a(1) = 2, and a(n) = A033873(n) mod 10 for n>1.
a(n) = A003617(n) mod 10. - Michel Marcus, Aug 06 2013

Extensions

More terms from Harvey P. Dale, Jan 25 2013

A214344 Number of 1's in the first 10^n binary digits in the stream of prime numbers in base 2.

Original entry on oeis.org

1, 8, 69, 593, 5723, 56090, 541794, 5369528, 53803123, 527428642, 5249946808, 52800311682
Offset: 0

Author

Tjandra Satria Gunawan, Jul 13 2012

Keywords

Comments

Consider the stream (concatenation) of binary digits of primes in the MSB-first order featured in A191232. a(n) is the total count of 1's in the first 10^n of zeros and ones in this stream.
The complementary count of 0's is 10^n - a(n) = 0, 2, 31, 407, 4277, 43910, 458206, ... - R. J. Mathar, Jul 16 2012

Crossrefs

Cf. A095375.

Programs

  • Maple
    A214344 := proc()
        local stre,len,ct,p ;
        stre := [] ;
        len := 2 ;
        ct := 1 ;
        p := 2 ;
        while true do
            if nops(stre) = 0 then
                p := nextprime(p) ;
                stre := convert(p,base,2) ;
            end if;
            if op(-1,stre) = 1 then
                ct := ct+ 1;
            end if;
            stre := subsop(-1=NULL,stre) ;
            len := len+1 ;
            if ilog10(len-1) <> ilog10(len) then
                print(ct) ;
            end if;
        end do:
    end proc: # R. J. Mathar, Jul 14 2012
  • Mathematica
    pow = 1; sum1 = 0; sum2 = 0; p = 2;seq={}; k = 0; Do[d = IntegerDigits[p, 2]; sum1 += Count[d, 1]; sum2 += Length[d]; k++; If[sum2 >= pow, del = sum2 - pow; term = sum1 - Count[d[[-del ;; -1]], 1];   AppendTo[seq, term]; pow *= 10]; p = NextPrime[p], {10^4}]; seq (* Amiram Eldar, May 10 2019 *)
  • Python
    from sympy import nextprime
    from itertools import islice
    def bgen(p=2):
        while True: yield from (int(b) for b in bin(p)[2:]); p = nextprime(p)
    def a(n): return sum(islice(bgen(), 10**n))
    print([a(n) for n in range(7)]) # Michael S. Branicky, Jul 03 2022

Extensions

a(9)-a(11) from Amiram Eldar, May 10 2019