login
Maximum number of consecutive integers starting at n such that any pair (k, k+1) among these shares at least one digit with its sum k + (k+1) = 2k + 1.
4

%I #25 Mar 16 2021 09:19:59

%S 2,0,0,0,0,0,0,0,0,5,4,3,2,0,0,2,0,0,0,3,2,0,0,4,3,2,0,0,0,4,3,2,0,0,

%T 0,0,3,2,0,3,2,0,0,0,0,0,0,0,6,5,4,3,2,0,0,0,0,2,0,5,4,3,2,0,0,0,0,0,

%U 0,4,3,2,0,4,3,2,0,0,5,4,3,2,0,0,0,0,3

%N Maximum number of consecutive integers starting at n such that any pair (k, k+1) among these shares at least one digit with its sum k + (k+1) = 2k + 1.

%C Both members of the pair (k, k+1) must be in the considered set of consecutive integers, therefore a(n) = 0 when there is none, and a(n) >= 2 when there is at least one such pair. (So we consider the "length of a chain" to be the number of vertices, not edges.)

%C At powers of 10 (A011557) start "trivial" chains of increasingly large length.

%H Jinyuan Wang, <a href="/A341755/b341755.txt">Table of n, a(n) for n = 0..10000</a>

%H Eric Angelini, <a href="https://mailman.xmission.com/hyperkitty/list/math-fun@mailman.xmission.com/">Pair sums with a shared digit</a>, math-fun discussion list, Mar 01 2021

%e a(0) = 2 because 0 + 1 = 1 shares a digit with (0,1).

%e a(1) = 0 because 1 + 2 = 3 shares no digit with (0,1).

%e a(9) = 5 because 9 + 10 = 19 shares '1' with (9, 10); 10 + 11 = 21 shares '1' with (10, 11); ..., 12 + 13 = 25 shares '2' with (12, 13), but 13 + 14 = 27 does not share any digit with (13, 14).

%o (PARI) {A341755(n, o=n) = while(#setintersect(Set(concat(digits(n), digits(n+1))), Set(digits(n+n+1))), n+=1); (n>o)+n-o }

%Y Cf. A341756, A341757 for records and corresponding indices.

%Y Cf. A011557 (powers of 10).

%K nonn,base,look

%O 0,1

%A _Eric Angelini_ and _M. F. Hasler_, Mar 01 2021