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

A260273 Successively add the smallest nonzero binary number that is not a substring.

Original entry on oeis.org

1, 3, 5, 8, 11, 15, 17, 20, 23, 27, 31, 33, 36, 39, 44, 51, 56, 61, 65, 68, 71, 76, 81, 84, 87, 91, 95, 99, 104, 111, 115, 120, 125, 129, 132, 135, 140, 145, 148, 151, 157, 165, 168, 171, 175, 179, 186, 190, 194, 199, 204, 209, 216, 223, 227, 232, 241, 246
Offset: 1

Views

Author

Alex Meiburg, Jul 22 2015

Keywords

Comments

a(n) is at least Omega(n), at most O(n*log(n)).
The empirical approximation n*(log(n)/2 + exp(1)) is startlingly close to tight, compared with many increasing upper bounds.
A261644(n) = A062383(a(n)) - a(n). - Reinhard Zumkeller, Aug 30 2015

Examples

			Begin with a(1)=1, in binary, "1". This contains the string "1" but not "10", so we add 2. Thus a(2)=1+2=3. This also contains "1" but not "10", so we move to a(3)=3+2=5. This contains "1" and "10" but not "11", so we add 3. Thus a(4)=5+3=8. (See A261018 for the successive numbers that are added. - _N. J. A. Sloane_, Aug 17 2015)
		

Crossrefs

See A261922 and A261461 for the smallest missing number function; also A261923, A262279, A261281.
See also A261396 (when a(n) just passes a power of 2), A261416 (the limiting behavior just past a power of 2).
First differences are A261018.
A262288 is the decimal analog.

Programs

  • Haskell
    a260273 n = a260273_list !! (n-1)
    a260273_list = iterate (\x -> x + a261461 x) 1
    -- Reinhard Zumkeller, Aug 30 2015, Aug 17 2015
    
  • Java
    public static void main(String[] args) {
       int a=1;
       for(int iter=0;iter<100;iter++){
           System.out.print(a+", ");
           int inc;
           for(inc=1; contains(a,inc); inc++);
           a+=inc;
       }
    }
    static boolean contains(int a,int test){
       int mask=(Integer.highestOneBit(test)<<1)-1;
       while(a >= test){
           if((a & mask) == test) return true;
           a >>= 1;
       }
       return false;
    }
    
  • Mathematica
    sublistQ[L1_, L2_] := Module[{l1 = Length[L1], l2 = Length[L2], k}, If[l2 <= l1, For[k = 1, k <= l1 - l2 + 1, k++, If[L1[[k ;; k + l2 - 1]] == L2, Return[True]]]]; False];
    a[1] = 1; a[n_] := a[n] = Module[{bb = IntegerDigits[a[n-1], 2], k}, For[k = 1, sublistQ[bb, IntegerDigits[k, 2]], k++]; a[n-1] + k]; Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Apr 01 2016 *)
    NestList[Function[k, k + FromDigits[#, 2] &@ SelectFirst[IntegerDigits[Range[2^8], 2], Length@ SequencePosition[IntegerDigits[k, 2], #] == 0 &]], 1, 64] (* Michael De Vlieger, Apr 01 2016, Version 10.1 *)
  • Python
    A260273_list, a = [1], 1
    for i in range(10**3):
        b, s = 1, format(a,'b')
        while format(b,'b') in s:
            b += 1
        a += b
        s = format(a,'b')
        A260273_list.append(a) # Chai Wah Wu, Aug 26 2015

Formula

a(n+1) = a(n) + A261461(a(n)). - Reinhard Zumkeller, Aug 30 2015

A261416 Let b(k) denote A260273(k). It appears that for k >= 200, whenever b(k) just passes a power of 2, 2^m say, the successive differences b(k)-2^m converge to this sequence.

Original entry on oeis.org

2, 5, 8, 11, 17, 20, 23, 29, 38, 43, 49, 54, 61, 70, 75, 81, 84, 87, 93, 102, 107, 114, 119, 128, 131, 136, 139, 145, 148, 151, 157, 167, 173, 180, 187, 196, 201, 206, 211, 218, 225, 230, 235, 244, 253, 262, 267, 273, 276, 279, 285, 294, 299, 305, 310, 317, 327, 333, 340, 343, 349, 358, 365, 372, 381
Offset: 0

Views

Author

N. J. A. Sloane, Aug 25 2015

Keywords

Comments

It would be nice to have an independent characterization of this sequence.
A partial answer: set a(0)=2, and for n>0, a(n) = A261281(a(n-1)). - N. J. A. Sloane, Sep 17 2015

Examples

			At k=200, b(k)=b(200)=1026 has just passed 2^10. The successive differences b(200+i)-2^10 (i>=0) beyond this point are 2, 5, 8, 11, 17, 20, 23, 29, 38, 43, 49, 54, 61, 70, 75, 81, 84, 87, 93, 102, 107, 114, 119, 128, 131, 136, 139, 145, 148, 151, 157, [165, ...], which are the first 31 terms of the present sequence.
At k=371, b(371)=2050, and the successive differences b(371+i)-2^11 are 2, 5, ..., 279, 285, ... giving the first 51 terms of the present sequence.
		

Crossrefs

Cf. A260273, A261281. For when A260273 just passes a power of 2, see A261396.

A261282 Least positive integer k such that prime(k)*prime(k*n) = prime(p)+2 for some prime p.

Original entry on oeis.org

14, 60, 135, 41, 199, 2, 2, 2, 61, 2, 183, 25, 15, 12, 47, 143, 110, 294, 117, 88, 22, 402, 26, 269, 116, 145, 164, 6, 10, 488, 2, 44, 120, 4, 127, 144, 119, 704, 1058, 368, 104, 2, 6, 214, 4, 129, 2, 3, 301, 2, 2, 466, 20, 107, 280, 14, 337, 12, 22, 12, 242, 1705, 415, 10, 115, 50, 2, 420, 4, 15
Offset: 1

Views

Author

Zhi-Wei Sun, Aug 14 2015

Keywords

Comments

Conjecture: a(n) exists for any n > 0. In general, any positive rational number r can be written as m/n, where m and n are positive integers such that prime(m)*prime(n) = prime(p)+2 for some prime p.
For example, 14/19 = 24528/33288, and prime(24528)*prime(33288) = 281153*392723 = 110415249619 = prime(4528436431)+2 with 4528436431 prime.
The conjecture implies that there are infinitely many primes p such that prime(p)+2 is a product of two primes. Recall that a prime p is called a Chen prime if p+2 is a product of at most two primes.

Examples

			a(2) = 60 since prime(60)*prime(60*2) = 281*659 = 185179 = prime(16763)+2 with 16763 prime.
		

References

  • Jing-run Chen, On the representation of a large even integer as the sum of a prime and a product of at most two primes, Sci. Sinica 16(1973), 157-176.
  • Zhi-Wei Sun, Problems on combinatorial properties of primes, in: M. Kaneko, S. Kanemitsu and J. Liu (eds.), Number Theory: Plowing and Starring through High Wave Forms, Proc. 7th China-Japan Seminar (Fukuoka, Oct. 28 - Nov. 1, 2013), Ser. Number Theory Appl., Vol. 11, World Sci., Singapore, 2015, pp. 169-187.

Crossrefs

Programs

  • Mathematica
    f[n_]:=Prime[n]
    PQ[n_]:=PrimeQ[n]&&PrimeQ[PrimePi[n]]
    Do[k=0;Label[bb];k=k+1;If[PQ[f[k]*f[k*n]-2],Goto[aa],Goto[bb]];Label[aa];Print[n," ", k];Continue,{n,1,70}]

A261354 Primes p such that prime(p)^2 - 2 = prime(q) for some prime q.

Original entry on oeis.org

31, 191, 541, 809, 1153, 1301, 2221, 3037, 3847, 4049, 4159, 5441, 8243, 10177, 12277, 13681, 14783, 15619, 17903, 19463, 20897, 22697, 24517, 25163, 25847, 25849, 26633, 26647, 27329, 27407, 28051, 32653, 35059, 35747, 36341, 36527, 37369, 37811, 38609, 40949, 42737, 46679, 51061, 51607, 54443, 54679, 56113, 57637, 60887, 61493
Offset: 1

Views

Author

Zhi-Wei Sun, Aug 15 2015

Keywords

Comments

Conjecture: The sequence has infinitely many terms. In general, for any integers a,b,c with a>0 and gcd(a,b,c)=1, if b^2-4*a*c is not a square, a+b+c is odd, and gcd(b,a+c) is not divisible by 3, then there are infinitely many prime pairs {p,q} such that a*prime(p)^2+b*prime(p)+c = prime(q).

Examples

			a(1) = 31 since 31 is a prime, and prime(31)^2-2 = 127^2-2 = 16127 = prime(1877) with 1877 prime.
		

References

  • Zhi-Wei Sun, Problems on combinatorial properties of primes, in: M. Kaneko, S. Kanemitsu and J. Liu (eds.), Number Theory: Plowing and Starring through High Wave Forms, Proc. 7th China-Japan Seminar (Fukuoka, Oct. 28 - Nov. 1, 2013), Ser. Number Theory Appl., Vol. 11, World Sci., Singapore, 2015, pp. 169-187.

Crossrefs

Programs

  • Mathematica
    PQ[n_]:=PrimeQ[n]&&PrimeQ[PrimePi[n]]
    f[k_]:=Prime[Prime[k]]^2-2
    n=0;Do[If[PQ[f[k]],n=n+1;Print[n," ",Prime[k]]],{k,1,6200}]

A261295 Least positive integer k such that both k and k*n belong to the set {m>0: prime(m) = prime(p)+2 for some prime p}.

Original entry on oeis.org

3, 3, 6, 578, 18, 3, 6, 90, 1868, 374, 4, 674, 278, 3, 6, 114, 3534, 110, 6, 354, 4, 14, 28464, 2790, 84, 4452, 2802, 3, 6, 3, 90, 2820, 354, 110, 4080, 278, 44, 3, 2712, 18, 3012, 90, 14, 12672, 44, 14, 1572, 1124, 720, 42, 114, 44, 84, 2790, 42, 90, 42, 3, 6, 84, 44, 1572, 3068, 1742, 2394, 174, 110, 744, 3020, 578
Offset: 1

Views

Author

Zhi-Wei Sun, Aug 14 2015

Keywords

Comments

Conjecture: (i) Any positive rational number r can be written as m/n with m and n in the set S = {k>0: prime(k) = prime(p)+2 for some prime p} = {p+1: p and prime(p)+2 are both prime}.
(ii) Any positive rational number r can be written as m/n with m and n in the set T = {k>0: prime(k) = prime(p)-2 for some prime p} = {p-1: p and prime(p)-2 are both prime}.
(iii) Any positive rational number r not equal to 1 can be written as m/n with m in S and n in T, where the sets S and T are given in parts (i) and (ii).
For example, 4/5 = 15648/19560 with 15647, prime(15647)+2 = 171763, 19559 and prime(19559)+2 = 219409 all prime; and 4/5 = 67536/84420 with 67537, prime(67537)-2 = 848849, 84421 and prime(84421)-2 = 1081937 all prime. Also, 4/5 = 8/10 with 7, prime(7)+2 = 19, 11 and prime(11)-2 = 29 all prime; and 5/4 = 8220/6576 with 8221, prime(8221)+2 = 84349, 6577 and prime(6577)-2 = 65837 all prime.

Examples

			a(3) = 6 since prime(6) = 13 = prime(5)+2 with 5 prime, and prime(6*3) = 61 = prime(17)+2 with 17 prime.
a(4) = 578 since prime(578) = 4219 = prime(577)+2 with 577 prime, and prime(578*4) = 20479 = prime(2311)+2 with 2311 prime.
		

References

  • Zhi-Wei Sun, Problems on combinatorial properties of primes, in: M. Kaneko, S. Kanemitsu and J. Liu (eds.), Number Theory: Plowing and Starring through High Wave Forms, Proc. 7th China-Japan Seminar (Fukuoka, Oct. 28 - Nov. 1, 2013), Ser. Number Theory Appl., Vol. 11, World Sci., Singapore, 2015, pp. 169-187.

Crossrefs

Programs

  • Mathematica
    f[n_]:=Prime[n]
    PQ[n_]:=PrimeQ[n]&&PrimeQ[PrimePi[n]]
    Do[k=0;Label[bb];k=k+1;If[PQ[f[k]-2]&&PQ[f[k*n]-2],Goto[aa],Goto[bb]];Label[aa];Print[n," ", k];Continue,{n,1,70}]
Showing 1-5 of 5 results.