login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Numbers k such that k + (k+1) = 2*k + 1 shares at least one digit with either k or k+1.
3

%I #27 Oct 25 2021 11:05:33

%S 0,9,10,11,12,15,19,20,23,24,25,29,30,31,36,37,39,40,48,49,50,51,52,

%T 57,59,60,61,62,69,70,71,73,74,75,78,79,80,81,86,87,89,90,91,94,95,96,

%U 97,98,99,100,101,102,103,104,105,106,107,108,109,110

%N Numbers k such that k + (k+1) = 2*k + 1 shares at least one digit with either k or k+1.

%C The terms come frequently in runs of consecutive integers; sequence A341755 gives the length of the run + 1.

%C In particular, all intervals [10^m-1, ..., 10^m+(10^m-1)/9], m >= 1, e.g., {9, 11}, {99, ..., 111}, {999, ..., 1111}, ..., are subsequences.

%C See A342146 and A342147 for the variants where 2k+1 shares a digit with k, respectively with k+1. Their union equals this sequence.

%C Almost all numbers are in this sequence: It has asymptotic density 1, since almost all large enough numbers are pandigital.

%H Robert Israel, <a href="/A342145/b342145.txt">Table of n, a(n) for n = 1..10000</a>

%e 0 and 9 are in the sequence because 0 + 1 = 1 and 9 + 10 = 19 share a digit with {0, 1} and with {9, 10}, respectively.

%e 1 and 8 and 13 are not in the sequence because 1 + 2 = 3, 8 + 9 = 17 and 13 + 14 = 27 do not share a digit with the respective right hand side.

%e See A342146 and A342147 for more examples.

%p filter:= proc(n) convert(convert(2*n+1,base,10),set) intersect(convert(convert(n,base,10),set) union convert(convert(n+1,base,10),set)) <> {} end proc:

%p select(filter, [$1..200]); # _Robert Israel_, Oct 24 2021

%o (PARI) select( is_A342135 = A341755, [0..199])

%o (Python)

%o def ok(n): return set(str(2*n+1)) & set(str(n)+str(n+1)) != set()

%o print([k for k in range(111) if ok(k)]) # _Michael S. Branicky_, Oct 24 2021

%Y Cf. A341755, A341756, A341757; A342146 and A342147 (variants).

%Y Cf. A002275 (repunits: (10^n-1)/9), A005408 (odd numbers: 2n+1).

%K nonn,base

%O 1,2

%A _M. F. Hasler_, Mar 01 2021