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-10 of 19 results. Next

A320985 Complement of A092855.

Original entry on oeis.org

1, 4, 6, 8, 9, 10, 11, 12, 14, 15, 20, 21, 24, 25, 28, 29, 37, 38, 42, 47, 48, 51, 52, 54, 55, 57, 58, 59, 60, 62, 63, 64, 66, 69, 70, 72, 78, 81, 82, 83, 85, 86, 89, 92, 93, 96, 100, 102, 104, 106, 107, 109, 111, 113, 119, 121, 122, 128, 129, 130, 134, 136, 139
Offset: 1

Views

Author

Jianing Song, Oct 27 2018

Keywords

Comments

Positions of 0 in the binary expansion of sqrt(2) after the radix point. With a prepended 0, A092855 gives the positions of 1.

Examples

			In binary, sqrt(2) is read as 1.0110101000001001111001... The 1st, 4th, 6th and 8th digits after the radix are 0's, so the first four terms are 1, 4, 6 and 8.
		

Crossrefs

Programs

  • Mathematica
    PositionIndex[First[RealDigits[Sqrt[2], 2, 200, -1]]][0] (* Paolo Xausa, Aug 27 2024 *)
  • PARI
    default(realprecision, 150); x=sqrt(2); for(n=1, 150, if(!(floor(x*2^n)%2),print1(n, ", ")))
    
  • PARI
    Vec(select(x->(x==0), binary(sqrt(2))[2], 1)) \\ Michel Marcus, Oct 29 2018

A051006 Prime constant: decimal value of (A010051 interpreted as a binary number).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

From Ferenc Adorjan (fadorjan(AT)freemail.hu): (Start)
Decimal expansion of the representation of the sequence of primes by a single real in (0,1).
Any monotonic integer sequence can be represented by a real number in (0, 1) in such a way that in the binary representation of the real, the n-th digit of the fractional part is 1 if and only if n is in the sequence.
Examples of the inverse mapping are A092855 and A092857. (End)
Is the prime constant an EL number? See Chow's 1999 article. - Lorenzo Sauras Altuzarra, Oct 05 2020
The asymptotic density of numbers with a prime number of trailing 0's in their binary representation (A370596), or a prime number of trailing 1's. - Amiram Eldar, Feb 23 2024

Examples

			0.414682509851111660... (base 10) = .01101010001010001010001... (base 2).
		

Crossrefs

Programs

  • Maple
    a := n -> ListTools:-Reverse(convert(floor(evalf[1000](sum(1/2^ithprime(k), k = 1 .. infinity)*10^(n+1))), base, 10))[n+1]: - Lorenzo Sauras Altuzarra, Oct 05 2020
  • Mathematica
    RealDigits[ FromDigits[ {{Table[ If[ PrimeQ[n], 1, 0], {n, 370}]}, 0}, 2], 10, 111][[1]] (* Robert G. Wilson v, Jan 15 2005 *)
    RealDigits[Sum[1/2^Prime[k], {k, 1000}], 10, 100][[1]] (* Alexander Adamchuk, Aug 22 2006 *)
  • PARI
    { mt(v)= /*Returns the binary mapping of v monotonic sequence as a real in (0,1)*/ local(a=0.0,p=1,l);l=matsize(v)[2]; for(i=1,l,a+=2^(-v[i])); return(a)} \\ Ferenc Adorjan
    
  • PARI
    { default(realprecision, 20080); x=0; m=67000; for (n=1, m, if (isprime(n), a=1, a=0); x=2*x+a; ); x=10*x/2^m; for (n=0, 20000, d=floor(x); x=(x-d)*10; write("b051006.txt", n, " ", d)); } \\ Harry J. Smith, Jun 15 2009
    
  • PARI
    suminf(n=1,.5^prime(n)) \\ Then: digits(%\.1^default(realprecision)) to get seq. of digits. N.B.: Functions sumpos() and sumnum() yield much less accurate results. - M. F. Hasler, Jul 04 2017

Formula

Prime constant C = Sum_{k>=1} 1/2^prime(k), where prime(k) is the k-th prime. - Alexander Adamchuk, Aug 22 2006
From Amiram Eldar, Aug 11 2020: (Start)
Equals Sum_{k>=1} A010051(k)/2^k.
Equals Sum_{k>=1} 1/A034785(k).
Equals (1/2) * A119523.
Equals Sum_{k>=1} pi(k)/2^(k+1), where pi(k) = A000720(k). (End)

A093515 Numbers k such that either k or k-1 is a prime.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 17, 18, 19, 20, 23, 24, 29, 30, 31, 32, 37, 38, 41, 42, 43, 44, 47, 48, 53, 54, 59, 60, 61, 62, 67, 68, 71, 72, 73, 74, 79, 80, 83, 84, 89, 90, 97, 98, 101, 102, 103, 104, 107, 108, 109, 110, 113, 114, 127, 128, 131, 132, 137, 138, 139
Offset: 1

Views

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu)

Keywords

Comments

Original name: Transform of the prime sequence by the Rule 110 cellular automaton.
As described in A051006, a monotonic sequence can be mapped into a fractional real. Then the binary digits of that real can be treated (transformed) by an elementary cellular automaton. Taking the resulting sequence of binary digits as a fractional real, it can be mapped back into a sequence, as in A092855.
From M. F. Hasler, Mar 01 2008: (Start)
The "Rule110" transform as used here involves a right-shift of the sequence before applying the transform as described on the MathWorld page.
Robert G. Wilson v observed that this sequence contains exactly the indices for which A121561 equals 1. (End)
From M. F. Hasler, Jan 07 2019: (Start)
The correspondence of monotonic sequences with fractional reals mentioned in the first comment is not really relevant here: RuleX most naturally maps directly one characteristic sequence to another and thus one set (or increasing sequence) to another one. Interpreting the characteristic sequences as binary digits of a fractional real then yields a map from [0,1] into [0,1] rather as a consequence.
Antti Karttunen observed that this seems to be the complement of A005381 (k and k-1 are composite). This is indeed the case: The characteristic sequence of primes has no three subsequent 1's. In all other cases of the 8 possible inputs for Rule110, the output is 0 if and only if the cell itself and its neighbor to the right are zero, which here means "k and k+1 are composite", and with the right shift mentioned above, the complement of A005381, i.e., numbers such that k or k-1 is prime (or: primes U primes + 1). We have actually proved the more general
Theorem: Rule110 transforms any set S having no three consecutive integers into the set S' = {k | k or k-1 is in S} = S U (1 + S). (End)

Crossrefs

Cf. A005381 (complement, apart from 1 which is in neither sequence), A323162.
Cf. A121561.

Programs

  • Magma
    [n: n in [2..180] | not(not IsPrime(n) and not IsPrime(n-1))]; // Vincenzo Librandi, Jan 08 2019
    
  • Mathematica
    Select[Range[2, 150], !(!PrimeQ[# - 1] && !PrimeQ[#]) &] (* Vincenzo Librandi, Jan 08 2019 *)
  • PARI
    {ca_tr(ca,v)= /* Calculates the Cellular Automaton transform of the vector v by the rule ca */
    local(cav=vector(8),a,r=[],i,j,k,l,po,p=vector(3));
    a=binary(min(255,ca));k=matsize(a)[2];forstep(i=k,1,- 1,cav[k-i+1]=a[i]);
    j=0;l=matsize(v)[2];k=v[l];po=1;
    for(i=1,k+2,j*=2;po=isin(i,v,l,po);j=(j+max(0,sign(po)))% 8;if(cav[j+1],r=concat(r,i)));
    return(r) /* See the function "isin" at A092875 */}
    
  • PARI
    /* transform a sequence v by the rule r - Note: v could be replaced by a function, e.g. v[c] => prime(c) here */
    seqruletrans(v,r)={my(c=1,L=List(),t=0); r=Vecrev(binary(r),8); for(i=1,v[#v], v[c]A093515=seqruletrans(primes(10^4),110) \\ M. F. Hasler, Mar 01 2008, updated Jan 07 2019
    
  • PARI
    A121561_is_1(N,n=0)=vector(N,i, while(!isprime(n+=1)&&!isprime(n-1),);n) \\ M. F. Hasler, Mar 01 2008
    
  • PARI
    is(n)=isprime(n)||isprime(n-1) \\ M. F. Hasler, Jan 07 2019
    
  • Python
    from sympy import isprime
    def ok(n): return isprime(n) or isprime(n-1)
    print(list(filter(ok, range(140)))) # Michael S. Branicky, Aug 10 2021

Formula

{a(n)} = A000040 U (A000040 + 1), where A000040 are the primes. - M. F. Hasler, Jan 07 2019
a(1) = 2, a(n) = a(n-1) + 1 if a(n-1) is prime, a(n) is the next prime after a(n-1) otherwise. - Luca Armstrong, Aug 10 2021

Extensions

Name changed by Antti Karttunen, Jan 07 2019

A092874 Decimal expansion of the "binary" Liouville number.

Original entry on oeis.org

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

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu)

Keywords

Comments

The famous Liouville number is defined so that its n-th fractional decimal digit is 1 if and only if there exists k, such that k! = n.
The binary Liouville number is defined similarly, but as a binary number: its n-th fractional binary digit is 1 if and only if there exists k, such that k! = n.
According to the definitions introduced in A092855 and A051006, this number is "the binary mapping" of the sequence of factorials (A000142).
For the numerators of the partial sums of B(n) := Sum_{j=1..n} 1/j^(n!) see A145572. - Wolfdieter Lang, Apr 10 2024

Examples

			0.7656250596046447753906250000... = 1/2^1 + 1/2^2 + 1/2^6 + 1/2^24 + 1/2^120 + ...
		

References

  • Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, 2003, Section 2.22, p. 172.

Crossrefs

Programs

  • Mathematica
    RealDigits[Sum[1/2^(n!), {n, Infinity}], 10, 105][[1]] (* Alonso del Arte, Dec 03 2012 *)
  • PARI
    { mt(v)= /*Returns the binary mapping of v monotonic sequence as a real in (0,1)*/
    local(a=0.0,p=1,l);l=matsize(v)[2];
    for(i=1,l,a+=2^(-v[i])); return(a)}
    
  • PARI
    suminf(n=2,2^-gamma(n)) \\ Charles R Greathouse IV, Jun 14 2020

Extensions

Offset corrected by Franklin T. Adams-Watters, Dec 14 2017

A093513 Transform of the prime sequence by the Rule89 cellular automaton.

Original entry on oeis.org

1, 3, 4, 9, 10, 15, 16, 21, 22, 25, 26, 27, 28, 33, 34, 35, 36, 39, 40, 45, 46, 49, 50, 51, 52, 55, 56, 57, 58, 63, 64, 65, 66, 69, 70, 75, 76, 77, 78, 81, 82, 85, 86, 87, 88, 91, 92, 93, 94, 95, 96, 99, 100, 105, 106, 111, 112, 115, 116, 117, 118, 119, 120, 121, 122, 123
Offset: 1

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu)

Keywords

Comments

As described in A051006, a monotonic sequence can be mapped into a fractional real. Then the binary digits of that real can be treated (transformed) by an elementary cellular automaton. Taken resulted sequence of binary digits as a fractional real, it can be mapped back into a sequence, as in A092855.
For n > 3, the a(n) are those missed by the following construct. Start with b(0) = 1. If b(n-1) is not prime, b(n) is the next prime, otherwise b(n) is the next integer. This yields 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 17, 18, 19, 20, 23, ... with missed values a(n) = 9, 10, 15, 16, 21, 22, .... Interestingly, b(n) appears to be A093515 for n>0. This fits with Karttunen's observation at A093515. - Bill McEachen, Jun 12 2024

Programs

  • PARI
    {ca_tr(ca,v)= /* Calculates the Cellular Automaton transform of the vector v by the rule ca */
    local(cav=vector(8),a,r=[],i,j,k,l,po,p=vector(3));
    a=binary(min(255,ca));k=matsize(a)[2];forstep(i=k,1,- 1,cav[k-i+1]=a[i]);
    j=0;l=matsize(v)[2];k=v[l];po=1;
    for(i=1,k+2,j*=2;po=isin(i,v,l,po);j=(j+max(0,sign(po)))% 8;if(cav[j+1],r=concat(r,i)));
    return(r) /* See the function "isin" at A092875 */}

A092857 Representation of 1/sqrt(2*Pi) by an infinite sequence.

Original entry on oeis.org

2, 3, 6, 7, 11, 16, 20, 22, 25, 26, 29, 30, 31, 32, 34, 36, 41, 42, 44, 45, 48, 50, 55, 59, 60, 62, 67, 68, 69, 70, 71, 72, 75, 77, 78, 81, 82, 83, 84, 88, 90, 99, 101, 102, 103, 105, 107, 109, 110, 111, 115, 116, 117, 121, 123, 124, 125, 126, 127, 128, 129, 130, 132, 135
Offset: 1

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu)

Keywords

Comments

Any real number in the range (0,1), having infinite number of nonzero binary digits, can be represented by a monotonic infinite sequence, such a way that: n is in the sequence iff the n-th digit in the fraction part of the number is 1. See also A092855.
An example for the inverse mapping is A051006.

Crossrefs

Programs

  • PARI
    {/* mtinv(x)= /*Returns the inverse binary mapping of x into a monotonic sequence */ local(z,v=[],r=[],l); z=frac(x);v=binary(z)[2];l=matsize(v)[2]; for(i=1,l,if(v[i]==1,r=concat(r,i)));return(r)} }

A093510 Transform of the prime sequence by the Rule30 cellular automaton.

Original entry on oeis.org

2, 3, 6, 8, 9, 11, 12, 14, 15, 17, 18, 20, 21, 23, 24, 25, 29, 30, 32, 33, 37, 38, 39, 41, 42, 44, 45, 47, 48, 49, 53, 54, 55, 59, 60, 62, 63, 67, 68, 69, 71, 72, 74, 75, 79, 80, 81, 83, 84, 85, 89, 90, 91, 97, 98, 99, 101, 102, 104, 105, 107, 108, 110, 111, 113, 114, 115
Offset: 1

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu)

Keywords

Comments

As described in A051006, a monotonic sequence can be mapped into a fractional real. Then the binary digits of that real can be treated (transformed) by an elementary cellular automaton. Taken resulted sequence of binary digits as a fractional real, it can be mapped back into a sequence, as in A092855.

Programs

  • PARI
    {ca_tr(ca,v)= /* Calculates the Cellular Automaton transform of the vector v by the rule ca */
    local(cav=vector(8),a,r=[],i,j,k,l,po,p=vector(3));
    a=binary(min(255,ca));k=matsize(a)[2];forstep(i=k,1,- 1,cav[k-i+1]=a[i]);
    j=0;l=matsize(v)[2];k=v[l];po=1;
    for(i=1,k+2,j*=2;po=isin(i,v,l,po);j=(j+max(0,sign(po)))% 8;if(cav[j+1],r=concat(r,i)));
    return(r) /* See the function "isin" at A092875 */}

A093511 Transform of the prime sequence by the Rule45 cellular automaton.

Original entry on oeis.org

1, 3, 5, 6, 7, 8, 10, 12, 13, 14, 16, 18, 19, 20, 22, 24, 26, 27, 28, 30, 31, 32, 34, 35, 36, 38, 40, 42, 43, 44, 46, 48, 50, 51, 52, 54, 56, 57, 58, 60, 61, 62, 64, 65, 66, 68, 70, 72, 73, 74, 76, 77, 78, 80, 82, 84, 86, 87, 88, 90, 92, 93, 94, 95, 96, 98, 100, 102, 103, 104
Offset: 1

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu)

Keywords

Comments

As described in A051006, a monotonic sequence can be mapped into a fractional real. Then the binary digits of that real can be treated (transformed) by an elementary cellular automaton. If we take the resulting sequence of binary digits as a fractional real, it can be mapped back into a sequence, as in A092855.
Conjecture: For n > 3, the a(n) correspond to the following construct (in numerical order). a(n) terms include "bookend" values at every prime p + 1 (6,8,12,14,18,20,...). Additionally, the values between the bookends are included, unless adjacent to non-"twin composite" bookends. For example, consider bookends 6 and 8. There is only a single value 7 between these, so it is included. This means terms 6, 7 and 8 are included. Consider bookends 89 + 1, 97 + 1. Ignoring 91 and 97 adjacencies, values 92 through 96 are included. This means terms 90, 92-96 and 98 are included. - Bill McEachen, Jun 12 2024

Programs

  • PARI
    {ca_tr(ca,v)= /* Calculates the Cellular Automaton transform of the vector v by the rule ca */
    local(cav=vector(8),a,r=[],i,j,k,l,po,p=vector(3));
    a=binary(min(255,ca));k=matsize(a)[2];forstep(i=k,1,- 1,cav[k-i+1]=a[i]);
    j=0;l=matsize(v)[2];k=v[l];po=1;
    for(i=1,k+2,j*=2;po=isin(i,v,l,po);j=(j+max(0,sign(po)))% 8;if(cav[j+1],r=concat(r,i)));
    return(r) /* See the function "isin" at A092875 */}

A093512 Transform of the prime sequence by the Rule73 cellular automaton.

Original entry on oeis.org

1, 3, 4, 10, 16, 22, 26, 27, 28, 34, 35, 36, 40, 46, 50, 51, 52, 56, 57, 58, 64, 65, 66, 70, 76, 77, 78, 82, 86, 87, 88, 92, 93, 94, 95, 96, 100, 106, 112, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 130, 134, 135, 136, 142, 143, 144, 145, 146, 147, 148
Offset: 1

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu)

Keywords

Comments

As described in A051006, a monotonic sequence can be mapped into a fractional real. Then the binary digits of that real can be treated (transformed) by an elementary cellular automaton. Taken resulted sequence of binary digits as a fractional real, it can be mapped back into a sequence, as in A092855.

Programs

  • PARI
    {ca_tr(ca,v)= /* Calculates the Cellular Automaton transform of the vector v by the rule ca */
    local(cav=vector(8),a,r=[],i,j,k,l,po,p=vector(3));
    a=binary(min(255,ca));k=matsize(a)[2];forstep(i=k,1,- 1,cav[k-i+1]=a[i]);
    j=0;l=matsize(v)[2];k=v[l];po=1;
    for(i=1,k+2,j*=2;po=isin(i,v,l,po);j=(j+max(0,sign(po)))% 8;if(cav[j+1],r=concat(r,i)));
    return(r) /* See the function "isin" at A092875 */}

A093514 Transform of the prime sequence by the Rule90 cellular automaton.

Original entry on oeis.org

2, 3, 4, 9, 11, 15, 17, 21, 23, 25, 29, 33, 37, 39, 41, 45, 47, 49, 53, 55, 59, 63, 67, 69, 71, 75, 79, 81, 83, 85, 89, 91, 97, 99, 101, 105, 107, 111, 113, 115, 127, 129, 131, 133, 137, 141, 149, 153, 157, 159, 163, 165, 167, 169, 173, 175, 179, 183, 191, 195, 197, 201
Offset: 1

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu)

Keywords

Comments

As described in A051006, a monotonic sequence can be mapped into a fractional real. Then the binary digits of that real can be treated (transformed) by an elementary cellular automaton. Taken resulted sequence of binary digits as a fractional real, it can be mapped back into a sequence, as in A092855.
n is in this sequence if either n-2 OR n is prime but not both. Similar simple propositional rules can be given for all "RuleXXX" transforms of primes (or any strictly monotone sequence with a well-defined characteristic function) because the idea in these sequences is to take the characteristic function, consider it as an infinite binary word, apply one generation of some one-dimensional cellular automaton rule "XXX" to it and define the new sequence by this characteristic function. - Antti Karttunen, Apr 22 2004
For example, 2 is included because 0 is not prime, but 2 is. 3 is included because 1 is not prime, but 3 is. 4 is included because 2 is prime, although 4 is not. 5 is not included because both 3 and 5 are primes, 9 is included because 7 is prime, but 9 is not.

Crossrefs

Characteristic function for this sequence is A010051(n-2) + A010051(n) (modulo 2). Naturally none of the terms of A006512 occur here.

Programs

  • PARI
    {ca_tr(ca,v)= /* Calculates the Cellular Automaton transform of the vector v by the rule ca */
    local(cav=vector(8),a,r=[],i,j,k,l,po,p=vector(3));
    a=binary(min(255,ca));k=matsize(a)[2];forstep(i=k,1,- 1,cav[k-i+1]=a[i]);
    j=0;l=matsize(v)[2];k=v[l];po=1;
    for(i=1,k+2,j*=2;po=isin(i,v,l,po);j=(j+max(0,sign(po)))% 8;if(cav[j+1],r=concat(r,i)));
    return(r) /* See the function "isin" at A092875 */}
Showing 1-10 of 19 results. Next