[go: up one dir, main page]

login
A326821
a(n) is the number of positive numbers k < n such that n+k and n-k have no digit in common.
1
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, 19, 20, 19, 20, 20, 19, 20, 22, 22, 24, 25, 26, 26, 27, 26, 27, 26, 28, 29, 31, 32, 32, 32, 31, 32, 32, 35, 33, 33, 32, 32, 32, 31, 30, 30, 30, 31, 36, 34, 35, 36
OFFSET
1,3
LINKS
EXAMPLE
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.
PROG
(PARI) ok(a, b)=length(setintersect(Set(digits(a+b)), Set(digits(a-b))))==0;
count(n)={c=0; for(k=1, n-1, if(ok(n, k), c++)); c};
a(limit)=vector(limit, n, count(n));
CROSSREFS
Sequence in context: A006158 A340203 A135414 * A356992 A099479 A120508
KEYWORD
nonn,base
AUTHOR
Lars Blomberg, Oct 20 2019
STATUS
approved