login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) is the number of positive numbers k < n such that n+k and n-k have no digit in common.
1

%I #13 Aug 31 2021 04:38:02

%S 0,1,2,3,4,4,4,5,6,7,6,7,6,6,7,8,9,11,12,13,14,13,13,13,13,14,16,17,

%T 19,20,19,20,20,19,20,22,22,24,25,26,26,27,26,27,26,28,29,31,32,32,32,

%U 31,32,32,35,33,33,32,32,32,31,30,30,30,31,36,34,35,36

%N a(n) is the number of positive numbers k < n such that n+k and n-k have no digit in common.

%H Michel Marcus, <a href="/A326821/b326821.txt">Table of n, a(n) for n = 1..10000</a>

%e For n = 7, the pairs (sum, difference) for k = 1..6 are (8, 6), (9, 5), (10, 4), (11, 3), (12, 2), (13, 1). The last two pairs are not allowed so a(7) = 4.

%o (PARI) ok(a,b)=length(setintersect(Set(digits(a+b)), Set(digits(a-b))))==0;

%o count(n)={c=0; for(k=1, n-1, if(ok(n,k),c++)); c};

%o a(limit)=vector(limit,n,count(n));

%Y Cf. A328021, A328289.

%K nonn,base

%O 1,3

%A _Lars Blomberg_, Oct 20 2019