Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Search: a295277 -id:a295277
     Sort: relevance | references | number | modified | created      Format: long | short | data
a(n) = 1 + number of distinct earlier terms that have common one bits with n in binary representation.
+10
2
1, 1, 2, 1, 2, 2, 3, 1, 3, 3, 4, 2, 4, 4, 5, 1, 4, 3, 5, 3, 5, 5, 6, 1, 4, 4, 6, 4, 6, 6, 7, 1, 5, 5, 7, 5, 7, 7, 8, 2, 6, 6, 8, 6, 8, 8, 9, 1, 6, 5, 8, 5, 8, 7, 9, 3, 7, 7, 9, 7, 9, 9, 10, 1, 6, 6, 9, 5, 8, 8, 10, 4, 8, 8, 10, 8, 10, 10, 11, 1, 7, 7, 10, 5, 9
OFFSET
1,3
COMMENTS
This sequence is a variant of A295277: here we count earlier terms with common one bits, there without common one bits.
The scatterplot of this sequence shares features with that of A295277 (see scatterplot in Links section).
Empirically, this sequence and A295277 have tight connections:
- let c be the sequence defined for any n > 0 by c(n) = a(n) + A295277(n),
- we have for any n > 0, c(n) <= c(n+1) <= c(n) + 1,
- let u be the sequence defined for any n > 0 by u(n) = least k such that a(k) = n,
- let v be the sequence defined for any n >= 0 by v(n) = least k such that A295277(k) = n,
- we have for any n > 0, u(n) + 1 = v(n).
LINKS
Rémy Sigrist, Colored scatterplot of the first 2^20 terms (where the color is function of min(A000120(a(n)),A000120((Max_{k=1..n-1} a(k))+2-a(n))))
FORMULA
a(2^n) = 0 for any n >= 0.
EXAMPLE
The first terms, alongside the distinct earlier terms with common one bits with n, are:
n a(n) Distinct earlier terms with common one bits with n
-- ---- --------------------------------------------------
1 1 {}
2 1 {}
3 2 {1}
4 1 {}
5 2 {1}
6 2 {2}
7 3 {1, 2}
8 1 {}
9 3 {1, 3}
10 3 {2, 3}
11 4 {1, 2, 3}
12 2 {4}
13 4 {1, 3, 4}
14 4 {2, 3, 4}
15 5 {1, 2, 3, 4}
16 1 {}
17 4 {1, 3, 5}
18 3 {2, 3}
19 5 {1, 2, 3, 5}
20 3 {4, 5}
PROG
(PARI) mx = 0; for (n=1, 85, v = 1 + sum(i=1, mx, bitand(i, n)!=0); print1 (v ", "); mx = max(mx, v))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Nov 19 2017
STATUS
approved
a(n) = 1 + the number of distinct earlier terms that are coprime to n.
+10
0
1, 2, 3, 3, 4, 2, 5, 4, 5, 3, 6, 3, 7, 4, 5, 5, 8, 4, 9, 5, 6, 6, 10, 4, 9, 6, 8, 5, 11, 4, 12, 7, 8, 7, 10, 5, 13, 8, 9, 7, 14, 5, 15, 8, 9, 9, 16, 6, 15, 7, 12, 8, 17, 7, 14, 9, 13, 10, 18, 6, 19, 11, 12, 11, 16, 7, 20, 10, 15, 8, 21, 8, 22, 12, 13, 11, 18
OFFSET
1,2
COMMENTS
This sequence combines features from A096216 and from A295277.
For any n > 0, a(n) <= 1 + pi(n), with equality iff n is not composite (pi(n) = A000720(n)).
EXAMPLE
The first terms, alongside the earlier terms coprime to n, are:
n a(n) Earlier terms coprime to n
-- ---- --------------------------
1 1 {}
2 2 {1}
3 3 {1, 2}
4 3 {1, 3}
5 4 {1, 2, 3}
6 2 {1}
7 5 {1, 2, 3, 4}
8 4 {1, 3, 5}
9 5 {1, 2, 4, 5}
10 3 {1, 3}
11 6 {1, 2, 3, 4, 5}
12 3 {1, 5}
13 7 {1, 2, 3, 4, 5, 6}
14 4 {1, 3, 5}
15 5 {1, 2, 4, 7}
16 5 {1, 3, 5, 7}
17 8 {1, 2, 3, 4, 5, 6, 7}
18 4 {1, 5, 7}
19 9 {1, 2, 3, 4, 5, 6, 7, 8}
20 5 {1, 3, 7, 9}
PROG
(PARI) pv = Set(); for (n=1, 77, v = 1 + sum(i=1, #pv, gcd(pv[i], n)==1); print1 (v ", "); pv = setunion(pv, Set(v)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Nov 19 2017
STATUS
approved

Search completed in 0.004 seconds