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
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)
See also
A261396 (when a(n) just passes a power of 2),
A261416 (the limiting behavior just past a power of 2).
-
a260273 n = a260273_list !! (n-1)
a260273_list = iterate (\x -> x + a261461 x) 1
-- Reinhard Zumkeller, Aug 30 2015, Aug 17 2015
-
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;
}
-
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 *)
-
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
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
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.
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
a(2) = 60 since prime(60)*prime(60*2) = 281*659 = 185179 = prime(16763)+2 with 16763 prime.
- 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.
-
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
a(1) = 31 since 31 is a prime, and prime(31)^2-2 = 127^2-2 = 16127 = prime(1877) with 1877 prime.
- 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.
-
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
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.
- 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.
-
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.
Comments