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

A139107 Bisection of A139102.

Original entry on oeis.org

1, 9, 599, 38359, 2454999, 628479869, 643563386359, 41188056726999, 168706280353789919, 43188807770570219359, 2764083697316494039005, 2830421706052089895941623, 46373629231957440855107559295
Offset: 1

Views

Author

Omar E. Pol, Apr 08 2008

Keywords

Crossrefs

Cf. A139102.

Programs

  • Maple
    A139101 := proc(n) option remember ; local a,p; if n = 1 then RETURN(1); else a := 10*A139101(n-1) ; for p from ithprime(n-1)+1 to ithprime(n)-1 do a := 10*a+1 ; od: fi ; RETURN(a) ; end: bin2dec := proc(n) local nshft ; nshft := convert(n,base,10) ; add(op(i,nshft)*2^(i-1),i=1..nops(nshft) ) ; end: A139102 := proc(n) bin2dec(A139101(n)) ; end: A139107 := proc(n) A139102(2*n-1) ; end: seq(A139107(n),n=1..35) ; # R. J. Mathar, Apr 25 2008

Extensions

More terms from R. J. Mathar, Apr 25 2008

A139108 Bisection of A139102.

Original entry on oeis.org

2, 37, 2397, 153437, 157119967, 40222711647, 2574253545437, 2636035630527967, 674825121415159677, 691020924329123509751, 176901356628255618496351, 181146989187333753340263903, 741978067711319053681720948727
Offset: 1

Views

Author

Omar E. Pol, Apr 08 2008

Keywords

Crossrefs

Cf. A139102.

Programs

  • Maple
    A139101 := proc(n) option remember ; local a,p; if n = 1 then RETURN(1); else a := 10*A139101(n-1) ; for p from ithprime(n-1)+1 to ithprime(n)-1 do a := 10*a+1 ; od: fi ; RETURN(a) ; end: bin2dec := proc(n) local nshft ; nshft := convert(n,base,10) ; add(op(i,nshft)*2^(i-1),i=1..nops(nshft) ) ; end: A139102 := proc(n) bin2dec(A139101(n)) ; end: A139108 := proc(n) A139102(2*n) ; end: seq(A139108(n),n=1..35) ; # R. J. Mathar, Apr 25 2008

Extensions

More terms from R. J. Mathar, Apr 25 2008

A139101 Numbers that show the distribution of prime numbers up to the n-th prime minus 1, using "0" for primes and "1" for nonprime numbers.

Original entry on oeis.org

1, 10, 1001, 100101, 1001010111, 100101011101, 1001010111010111, 100101011101011101, 1001010111010111010111, 1001010111010111010111011111, 100101011101011101011101111101, 100101011101011101011101111101011111, 1001010111010111010111011111010111110111
Offset: 1

Views

Author

Omar E. Pol, Apr 08 2008

Keywords

Comments

a(n) has A000040(n)-1 digits, n-1 digits "0" and A000040(n)-n digits "1".

Crossrefs

Binary representation of A139102.
Subset of A118256.

Programs

  • Mathematica
    Table[ sum = 0; For[i = 1, i <= Prime[n] - 1 , i++, sum = sum*2;
    If[! PrimeQ[i], sum++]]; IntegerString[sum, 2], {n, 1, 13}] (* Robert Price, Apr 03 2019 *)
  • PARI
    a(n) = fromdigits(vector(prime(n)-1, k, !isprime(k)), 10); \\ Michel Marcus, Apr 04 2019
    
  • Python
    from sympy import isprime, prime
    def a(n): return int("".join(str(1-isprime(i)) for i in range(1, prime(n))))
    print([a(n) for n in range(1, 14)]) # Michael S. Branicky, Jan 10 2022
    
  • Python
    # faster version for initial segment of sequence
    from sympy import isprime
    from itertools import count, islice
    def agen(): # generator of terms
        an = 0
        for k in count(1):
            an = 10 * an + int(not isprime(k))
            if isprime(k+1):
                yield an
    print(list(islice(agen(), 13))) # Michael S. Branicky, Jan 10 2022

A139104 Numbers whose binary representation shows the distribution of prime numbers up to the n-th prime, using "0" for primes and "1" for nonprime numbers.

Original entry on oeis.org

2, 4, 18, 74, 1198, 4794, 76718, 306874, 4909998, 314239934, 1256959738, 80445423294, 1287126772718, 5148507090874, 82376113453998, 5272071261055934, 337412560707579838, 1349650242830319354, 86377615541140438718, 1382041848658247019502, 5528167394632988078010
Offset: 1

Views

Author

Omar E. Pol, Apr 08 2008

Keywords

Comments

a(n) is the decimal representation of A139103(n) interpreted as binary number.

Examples

			a(4)=74 because 74 written in base 2 is 1001010 and the string "1001010" shows the distribution of prime numbers up to the 4th prime, using "0" for primes and "1" for nonprime numbers.
		

Crossrefs

Programs

  • Mathematica
    Table[ sum = 0; For[i = 1, i <= Prime[n] , i++, sum = sum*2;
    If[! PrimeQ[i], sum++]]; sum, {n, 1, 21}] (* Robert Price, Apr 03 2019 *)
    Module[{nn=30,t},t=Table[If[PrimeQ[n],0,1],{n,Prime[nn]}];Table[ FromDigits[ Take[t,p],2],{p,Prime[Range[nn]]}]] (* Harvey P. Dale, Jul 15 2019 *)
  • PARI
    a(n) = fromdigits(vector(prime(n), k, !isprime(k)), 2); \\ Michel Marcus, Apr 04 2019

Formula

a(n) = 2 * A139102(n).
From Ridouane Oudra, Aug 27 2019: (Start)
a(n) = 2^prime(n) - 1 - (1/2)*(n + Sum_{i=1..prime(n)} 2^(prime(n)-i)*pi(i)), where prime(n) = A000040(n) and pi(n) = A000720(n)
a(n) = A001348(n) - A121240(n)
a(n) = A118255(A000040(n)). (End)

Extensions

More terms from R. J. Mathar, May 22 2008
a(19)-a(21) from Robert Price, Apr 03 2019

A139103 Numbers that show the distribution of prime numbers up to the n-th prime using "0" for primes and "1" for nonprime numbers.

Original entry on oeis.org

10, 100, 10010, 1001010, 10010101110, 1001010111010, 10010101110101110, 1001010111010111010, 10010101110101110101110, 10010101110101110101110111110, 1001010111010111010111011111010, 1001010111010111010111011111010111110, 10010101110101110101110111110101111101110
Offset: 1

Views

Author

Omar E. Pol, Apr 08 2008

Keywords

Comments

a(n) has A000040(n) digits, n digits "0" and A000040(n)-n digits "1".

Crossrefs

Binary representation of A139104.
Subset of A118256.

Programs

  • Mathematica
    Table[ sum = 0; For[i = 1, i <= Prime[n] , i++, sum = sum*2;
    If[! PrimeQ[i], sum++]]; IntegerString[sum, 2], {n, 1, 20}] (* Robert Price, Apr 03 2019 *)
  • PARI
    a(n) = fromdigits(vector(prime(n), k, !isprime(k)), 10); \\ Michel Marcus, Apr 04 2019

Extensions

a(12)-a(13) from Robert Price, Apr 03 2019

A139119 Primes whose binary representation shows the distribution of prime numbers using "0" for primes and "1" for nonprime numbers.

Original entry on oeis.org

2, 37, 149, 599, 153437, 39279991, 628479869, 11056334789265976156021, 3263254052013454238294691704608897001027543, 7524551543123483484068003542235060639999919940760883731360687
Offset: 1

Views

Author

Omar E. Pol, Apr 11 2008

Keywords

Comments

Primes in A118255.
Primes whose binary representation is also the concatenation of the initial terms of A005171, the characteristic function of nonprimes. - Omar E. Pol, Oct 07 2013
a(11) is a 120-digit number 377859...798653. - Robert Price, Apr 03 2019

Crossrefs

Programs

  • Mathematica
    Select[Table[FromDigits[Boole /@ Not /@ PrimeQ /@ Range@k, 2], {k, 1, 100}], PrimeQ] (* Federico Provvedi, Oct 07 2013 *)
  • PARI
    f(n) = fromdigits(vector(n, k, !isprime(k)), 2); \\ A118255
    lista(nn) = for (n=1, nn, if (isprime(p=f(n)), print1(p, ", "))); \\ Michel Marcus, Apr 04 2019

Extensions

a(8)-a(10) from Donovan Johnson, Oct 07 2013

A139120 Primes that show the distribution of prime numbers using "0" for primes and "1" for nonprime numbers.

Original entry on oeis.org

10010101, 1001010111010111, 100101011101011101011101111101011111011101011101111101111101011111011101011111011101111101111111011101011101011101111111111111011101111101011111111101011111011111011101111101111, 100101011101011101011101111101011111011101011101111101111101011111011101011111011101111101111111011101011101011101111111111111011101111101011111111101011111011111011101111101111101011111111101011101011111111
Offset: 1

Views

Author

Omar E. Pol, Apr 11 2008

Keywords

Comments

Primes in A118256.
For n = 1..7, the number of digits in a(n) is 8, 16, 177, 207, 872, 1395, 2114 (no more through 10000). - Jon E. Schoenfield, Apr 13 2018

Crossrefs

Programs

Extensions

Extended by Charles R Greathouse IV, Jul 27 2009

A139122 Primes whose binary representation shows the distribution of prime numbers up to some prime minus 1, using "0" for primes and "1" for nonprime numbers.

Original entry on oeis.org

2, 37, 599, 153437, 628479869
Offset: 1

Views

Author

Omar E. Pol, Apr 11 2008

Keywords

Comments

Primes in A139102.
a(6) > 10^14632 if it exists (no further primes in first 5000 terms of A139102). - Michael S. Branicky, Jan 25 2022

Crossrefs

Programs

  • Mathematica
    Select[Table[ sum = 0; For[i = 1, i <= Prime[n] - 1 , i++, sum = sum*2; If[! PrimeQ[i], sum++]]; sum, {n, 1, 1000}], PrimeQ[#] &] (* Robert Price, Apr 03 2019 *)
    Module[{nn=500,p,x},p=Table[If[PrimeQ[n],0,1],{n,nn}];x=SequencePosition[p,{1,0}][[All,1]];Join[{2},Select[Table[FromDigits[Take[p,k],2],{k,x}],PrimeQ]]] (* Harvey P. Dale, Jun 15 2022 *)
  • PARI
    f(n) = fromdigits(vector(prime(n)-1, k, !isprime(k)), 2); \\ A139102
    lista(nn) = for (n=1, nn, if (isprime(p=f(n)), print1(p, ", ")));
    
  • Python
    # uses agen() in A139102
    from sympy import isprime
    print(list(islice(filter(isprime, agen()), 5))) # Michael S. Branicky, Jan 25 2022

Extensions

a(5) from Robert Price, Apr 03 2019

A370069 Lexicographically earliest sequence of distinct integers such that the concatenated binary expansions of the terms is A010051.

Original entry on oeis.org

0, 1, 2, 40, 162, 8, 32, 160, 34, 544, 130, 520, 2568, 8320, 552, 663552, 2178, 512, 10272, 34848, 2560, 665600, 2048, 35360, 163872, 2080, 10274, 8396800, 9052160, 33280, 2592, 128, 33288, 133128, 131584, 10242, 33312, 2056, 165888, 526464, 2230272, 655360, 2129952, 8352, 32800, 534560, 141312, 2050, 139394, 32776
Offset: 1

Views

Author

Giorgos Kalogeropoulos, Feb 08 2024

Keywords

Comments

If we take the binary expansion of each term and concatenate these bits to a sequence, we get the sequence of the characteristic function of primes (A010051).
For n > 2 every term is an even Fibbinary number (A022340).

Examples

			terms   0,   1,    2,         40,             162,            8,          32
binary {0}, {1}, {1,0}, {1,0,1,0,0,0}, {1,0,1,0,0,0,1,0}, {1,0,0,0}, {1,0,0,0,0,0}
A010051 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0
		

Crossrefs

Programs

  • Mathematica
    n=49; lst={0};p=2;c=Boole[PrimeQ@Range[n^2]]; Do[k=1;While[MemberQ[lst,ne=FromDigits[c[[p;;(pn=NextPrime[p,k])-1]],2]],k++]; AppendTo[lst,ne];p=pn,{i,n}];lst
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen(): # generator of terms
        yield 0
        p, nextp, aset = 2, 3, {0}
        while True:
            an = 0
            while an in aset:
                an = (an<<(nextp-p)) + (1<<(nextp-p-1))
                p, nextp = nextp, nextprime(nextp)
            yield an
            aset.add(an)
    print(list(islice(agen(), 50))) # Michael S. Branicky, Feb 08 2024
Showing 1-9 of 9 results.