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.

A092855 Numbers k such that the k-th bit in the binary expansion of sqrt(2) - 1 is 1: sqrt(2) - 1 = Sum_{n>=1} 1/2^a(n).

Original entry on oeis.org

2, 3, 5, 7, 13, 16, 17, 18, 19, 22, 23, 26, 27, 30, 31, 32, 33, 34, 35, 36, 39, 40, 41, 43, 44, 45, 46, 49, 50, 53, 56, 61, 65, 67, 68, 71, 73, 74, 75, 76, 77, 79, 80, 84, 87, 88, 90, 91, 94, 95, 97, 98, 99, 101, 103, 105, 108, 110, 112, 114, 115, 116, 117, 118, 120, 123, 124
Offset: 1

Views

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu)

Keywords

Comments

Previous name was: Representation of sqrt(2) - 1 by an infinite sequence.
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 A092857.
An example for the inverse mapping is A051006.
It is relatively rich in primes, but cf. A092875.

Crossrefs

Cf. A004539, A051006, A092857, A092875, A320985 (complement).

Programs

  • Mathematica
    PositionIndex[First[RealDigits[Sqrt[2], 2, 200, -1]]][1] (* Paolo Xausa, Sep 01 2024 *)
  • PARI
    v=binary(sqrt(2))[2]; for(i=1,#v,if(v[i],print1(i,","))) \\ Ralf Stephan, Mar 30 2014

Extensions

New name from Joerg Arndt, Aug 26 2024

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

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 */}

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 */}

A093516 Transform of the prime sequence by the Rule137 cellular automaton.

Original entry on oeis.org

1, 3, 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, 154
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 */}

A093517 Transform of the prime sequence by the Rule225 cellular automaton.

Original entry on oeis.org

1, 4, 5, 7, 10, 13, 16, 19, 22, 26, 27, 28, 31, 34, 35, 36, 40, 43, 46, 50, 51, 52, 56, 57, 58, 61, 64, 65, 66, 70, 73, 76, 77, 78, 82, 86, 87, 88, 92, 93, 94, 95, 96, 100, 103, 106, 109, 112, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 130, 134, 135, 136, 139
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 */}
Showing 1-9 of 9 results.