Displaying 1-10 of 16 results found.
Nonnegative integers, sorted by increasing value of A028897(n) = Sum d[i]*2^i for n = Sum d[i]*10^i, then value of n.
+20
4
0, 1, 2, 10, 3, 11, 4, 12, 20, 100, 5, 13, 21, 101, 6, 14, 22, 30, 102, 110, 7, 15, 23, 31, 103, 111, 8, 16, 24, 32, 40, 104, 112, 120, 200, 1000, 9, 17, 25, 33, 41, 105, 113, 121, 201, 1001, 18, 26, 34, 42, 50, 106, 114, 122, 130, 202, 210, 1002, 1010, 19, 27
COMMENTS
A028897(n) is the result of using the decimal digits of n, but weighting their position as in base 2. For sake of brevity we refer to this as the b-value of n in the sequel. This idea is found on the website given in links under the name "decibinary numbers".
The b-values increment by 1 at indices (of "records") 1, 2, 4, 6, 10, 14, 20, 26, 36, ... Prefixing an initial 0, the gaps between these, equal to the number of occurrences of a given b-value (0, 1, 2, ...), are 1, 1, 2, 2, 4, 4, 6, 6, 10, 10, 13, 13, ... = A072170(n,10). In this sequence each of (1, 2, 4, 6, 10, 13, 18, ...) is repeated twice.
EXAMPLE
The first terms of the sequence are as follows: (b = A028897)
n | 0 | 1 | 2 | 10 | 3 | 11 | 4 | 12 | 20 | 100 | 5 | 13 | 21 | 101 | ...
----+---+---+---+----+---+----+---+----+----+-----+---+----+----+-----+-----
b(n)| 0 | 1 | 2 | 2 | 3 | 3 | 4 | 4 | 4 | 4 | 5 | 5 | 5 | 5 | ...
For example, b(345) = 3*2^2 + 4*2 + 5 = 25.
MAPLE
N:= 30: # for all numbers with A028897(n) <= N
L:= {seq([i, i], i=0..9)}: Agenda:= {seq([i, i], i=1..9)}:
extend:= proc(p) local x; op(select(t -> t[2]<=N, [seq([10*p[1]+x, 2*p[2]+x], x=0..9)])); end proc:
sorter:= proc(p1, p2) if p1[2] <> p2[2] then p1[2] < p2[2] else p1[1] < p2[1] fi end proc:
while Agenda <> {} do
Agenda:= map(extend, Agenda);
L:= L union Agenda;
od:
L:= sort( convert(L, list), sorter):
PROG
(PARI) my( A028897(n)=fromdigits(digits(n), 2), S=[]); for(k=1, 2^10, (t= A028897(k))>9||S=setunion(S, [[t, k]])); apply(t->t[2], S)
0, 1, 2, 4, 6, 10, 14, 20, 26, 36, 46, 59, 72, 90, 108, 130, 152, 182, 212, 248, 284, 329, 374, 426, 478, 542, 606, 678, 750, 834, 918, 1011, 1104, 1214, 1324, 1446, 1568, 1708, 1848, 2002, 2156, 2333, 2510, 2702, 2894, 3108, 3322, 3552, 3782, 4040, 4298, 4575, 4852, 5156, 5460, 5784, 6108, 6464, 6820, 7196, 7572, 7977, 8382
COMMENTS
A322000 lists all nonnegative integers m ordered by increasing "decibinary" value N = A028897(m) = Sum d[i]*2^i where d[i] are the decimal digits of m. A072170(N,10) says in how many ways a given N can be written in that way. Accordingly, this is also the length of runs of identical values A028897( A322000(k)), and the partial sums, listed here as a(k), give the indices of A322000 where the decibinary value of the terms go up by one.
We have a(k) <= A000123(k-1) with equality for 1 <= k <= 10: the first differences of A000123 give back that sequence with terms duplicated, and this is the limiting column of A072170.
FORMULA
a(n) = Sum_{0 <= k < n} A072170(k,10).
PROG
A322003_vec=vector(99, k, s=if(k>1, s)+ A072170(k-1, 10)) \\ more efficient for computing a large vector. Excludes the initial a(0) = 0 to have 1-based indices of the vector match the indices of the components a(n), n >= 1.
The binary numbers (or binary words, or binary vectors, or binary expansion of n): numbers written in base 2.
(Formerly M4679)
+10
761
0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 10000, 10001, 10010, 10011, 10100, 10101, 10110, 10111, 11000, 11001, 11010, 11011, 11100, 11101, 11110, 11111, 100000, 100001, 100010, 100011, 100100, 100101, 100110, 100111
COMMENTS
List of binary numbers. (This comment is to assist people searching for that particular phrase. - N. J. A. Sloane, Apr 08 2016)
Or, numbers that are sums of distinct powers of 10.
Or, numbers having only digits 0 and 1 in their decimal representation.
Nonnegative integers with no decimal digit > 1.
Thus nonnegative integers n in base 10 such that kn can be calculated by normal addition (i.e., n + n + ... + n, with k n's (but not necessarily k + k + ... + k, with n k's)) or multiplication without requiring any carry operations for 0 <= k <= 9. (End)
For any integer n>=0, find the binary representation and then interpret as decimal representation giving a(n). - Michael Somos, Nov 15 2015
For n > 0, numbers whose largest decimal digit is 1. - Stefano Spezia, Nov 15 2023
REFERENCES
Heinz Gumin, "Herrn von Leibniz' 'Rechnung mit Null und Eins'", Siemens AG, 3. Auflage 1979 -- contains facsimiles of Leibniz's papers from 1679 and 1703.
Manfred R. Schroeder, "Fractals, Chaos, Power Laws", W. H. Freeman, 1991, p. 383.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
FORMULA
a(n) = Sum_{i=0..m} d(i)*10^i, where Sum_{i=0..m} d(i)*2^i is the base 2 representation of n.
a(n) = (1/2)*Sum_{i>=0} (1-(-1)^floor(n/2^i))*10^i. - Benoit Cloitre, Nov 20 2001
a(2n) = 10*a(n), a(2n+1) = a(2n)+1.
G.f.: 1/(1-x) * Sum_{k>=0} 10^k * x^(2^k)/(1+x^(2^k)) - for sequence as decimal integers. - Franklin T. Adams-Watters, Jun 16 2006
EXAMPLE
a(6)=110 because (1/2)*((1-(-1)^6)*10^0 + (1-(-1)^3)*10^1 + (1-(-1)^1)*10^2) = 10 + 100.
G.f. = x + 10*x^2 + 11*x^3 + 100*x^4 + 101*x^5 + 110*x^6 + 111*x^7 + 1000*x^8 + ...
.
000 The numbers < 2^n can be regarded as vectors with
001 a fixed length n if padded with zeros on the left
010 side. This represents the n-fold Cartesian product
011 over the set {0, 1}. In the example on the left,
100 n = 3. (See also the second Python program.)
101 Binary vectors in this format can also be seen as a
110 representation of the subsets of a set with n elements.
MATHEMATICA
Table[ FromDigits[ IntegerDigits[n, 2]], {n, 0, 39}]
PROG
(PARI) {a(n) = subst( Pol( binary(n)), x, 10)}; /* Michael Somos, Jun 07 2002 */
(PARI) {a(n) = if( n<=0, 0, n%2 + 10*a(n\2))}; /* Michael Somos, Jun 07 2002 */
(Haskell)
a007088 0 = 0
a007088 n = 10 * a007088 n' + m where (n', m) = divMod n 2
(Python)
def a(n): return int(bin(n)[2:])
(Python)
from itertools import product
n = 4
for p in product([0, 1], repeat=n): print(''.join(str(x) for x in p))
CROSSREFS
Cf. A028897 (convert binary to decimal).
Cf. A000042, A007089- A007095, A000695, A005836, A033042- A033052, A159918, A004290, A169965, A169966, A169967, A169964, A204093, A204094, A204095, A097256, A257773, A257770.
a(0)=1; thereafter a(n+1) = a(n) + number of 1's in binary representation of a(n).
+10
34
1, 2, 3, 5, 7, 10, 12, 14, 17, 19, 22, 25, 28, 31, 36, 38, 41, 44, 47, 52, 55, 60, 64, 65, 67, 70, 73, 76, 79, 84, 87, 92, 96, 98, 101, 105, 109, 114, 118, 123, 129, 131, 134, 137, 140, 143, 148, 151, 156, 160, 162, 165, 169, 173, 178, 182, 187, 193, 196, 199, 204
LINKS
Raoul Nakhmanson-Kulish, Graph of f(n), where f(n) = (a(n)-n*log_2(n)/2)/(n*sqrt(log_2(n)*log_2 log_2(n))) (see Stolarsky's estimate below).
FORMULA
a(n) = (n/2)*log n + O(n*sqrt(log n * loglog n)), where log means log_2. In particular, a(n) ~ (n/2)*log n. [Stolarsky]
EXAMPLE
a(7) = 14 because a(6) = 12, which is 1100 in binary (having 2 on bits), and 12 + 2 = 14.
a(8) = 17 because a(7) = 14, which is 1110 in binary (having 3 on bits), and 14 + 3 = 17.
MATHEMATICA
NestList[# + DigitCount[#, 2, 1] &, 1, 60] (* Alonso del Arte, Oct 26 2012 *)
PROG
(Haskell)
a010062 n = a010062_list !! n
(Magma) [n le 1 select 1 else Self(n-1)+&+Intseq(Self(n-1), 2): n in [1..61]]; // Bruno Berselli, Oct 27 2012
(Python)
from itertools import islice
def agen():
an = 1
while True: yield an; an += an.bit_count()
CROSSREFS
For the base-10 analog see A004207.
a(n) = n_n, where "N_b" denotes "N read in base b": if N = Sum c_i 10^i then N_b = Sum c_i b^i.
+10
33
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 40, 43, 46, 49, 52, 55, 58, 61, 64, 67, 90, 94, 98, 102, 106, 110, 114, 118, 122, 126, 160, 165, 170, 175, 180, 185, 190, 195, 200, 205, 250, 256, 262, 268, 274, 280, 286, 292, 298, 304, 360, 367, 374, 381, 388
COMMENTS
The definition applies even if b < 10. Examples: 23_45 = 2*45 + 3 = 93, 23_2 = 2*2 + 3 = 7.
REFERENCES
David Applegate, Marc LeBrun and N. J. A. Sloane, Descending Dungeons and Iterated Base-Changing, in "The Mathematics of Preference, Choice and Order: Essays in Honor of Peter Fishburn", edited by Steven Brams, William V. Gehrlein and Fred S. Roberts, Springer, 2009, pp. 393-402.
MAPLE
local dgs;
dgs := convert(n, base, 10) ;
add(op(i, dgs)*n^(i-1), i=1..nops(dgs)) ;
MATHEMATICA
f[n_] := FromDigits[ IntegerDigits@n, n]; Array[f, 64] (* Robert G. Wilson v, Sep 27 2006 *)
CROSSREFS
Differs from A083292 starting at n=100.
If n = Sum c_i * 10^i then a(n) = Sum c_i * Cat(i+1), where Cat(k) = A000108(k).
+10
10
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 5
COMMENTS
This sequence converts any number from various "Catalan Base number systems" (when represented as decimal numbers) back to the integer the numeral represents: e.g. we have a( A014418(n)) = n and a( A244159(n)) = n (except for the latter this is eventually broken by the shortcomings of the decimal representation used, while for the former it works for all n, because no digits larger than 3 will ever appear in the terms of A014418).
A197433 is similar, but replaces 2^k with A000108(k+1) in binary expansion of n.
MAPLE
local dgs, k ;
dgs := convert(n, base, 10) ;
add( op(k, dgs)* A000108(k), k=1..nops(dgs)) ;
PROG
(MIT/GNU Scheme) (define ( A244158 n) (let loop ((z 0) (i 1) (n n)) (if (zero? n) z (loop (+ z (* (modulo n 10) ( A000108 i))) (1+ i) (floor->exact (/ n 10))))))
CROSSREFS
Differs from A028897 and A081594 for the first time at n=100, which here is a(100) = 5.
Let n = 10x + y where 0 <= y <= 9, x >= 0. Then a(n) = 2x+y.
+10
8
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 20
LINKS
Index entries for linear recurrences with constant coefficients, signature (1, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1).
FORMULA
G.f.: -x*(7*x^9 -x^8 -x^7 -x^6 -x^5 -x^4 -x^3 -x^2 -x -1) / ((x -1)^2*(x +1)*(x^4 -x^3 +x^2 -x +1)*(x^4 +x^3 +x^2 +x +1)). - Colin Barker, Jun 23 2014
MATHEMATICA
CoefficientList[Series[-x (7 x^9 - x^8 - x^7 - x^6 - x^5 - x^4 - x^3 - x^2 - x - 1)/((x - 1)^2 (x + 1) (x^4 - x^3 + x^2 - x+1) (x^4 + x^3 + x^2 + x + 1)), {x, 0, 150}], x] (* Vincenzo Librandi, Jun 25 2014 *)
LinearRecurrence[{1, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1}, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2}, 110] (* or *) Table[Range[n, n+9], {n, 0, 26, 2}]//Flatten (* Harvey P. Dale, Jul 22 2021 *)
PROG
(MIT/GNU Scheme) (define ( A081594 n) (+ (* 2 (floor->exact (/ n 10))) (modulo n 10))) ;; Antti Karttunen, Jun 22 2014
(PARI) my(n, x, y); vector(200, n, y=(n-1)%10; x=(n-1-y)\10; 2*x+y) \\ Colin Barker, Jun 24 2014
(Magma) [(n+4*y)/5 where y is n mod 10: n in [0..100]]; // Bruno Berselli, Jun 24 2014
(Sage) [n-8*floor(n/10) for n in (0..100)] # Bruno Berselli, Jun 24 2014
a(n) = A010062(n) written in binary: a(n+1) = a(n) + hammingweight(a(n)) in binary.
+10
4
1, 10, 11, 101, 111, 1010, 1100, 1110, 10001, 10011, 10110, 11001, 11100, 11111, 100100, 100110, 101001, 101100, 101111, 110100, 110111, 111100, 1000000, 1000001, 1000011, 1000110, 1001001, 1001100, 1001111, 1010100, 1010111, 1011100, 1100000, 1100010, 1100101, 1101001, 1101101, 1110010, 1110110, 1111011, 10000001, 10000011
COMMENTS
Is there any way to tell by looking at a binary number whether or not it is a term of this sequence?
MATHEMATICA
s[0] = 1; s[n_] := s[n] = s[n-1] + DigitCount[s[n-1], 2, 1]; Table[FromDigits[IntegerDigits[s[n], 2]], {n, 0, 50}] (* Amiram Eldar, Jul 28 2023 *)
a(0) = 1, a(n) = sum of binary digits of all prior terms, expressed in binary.
+10
3
1, 1, 10, 11, 101, 111, 1010, 1100, 1110, 10001, 10011, 10110, 11001, 11100, 11111, 100100, 100110, 101001, 101100, 101111, 110100, 110111, 111100, 1000000, 1000001, 1000011, 1000110, 1001001, 1001100, 1001111, 1010100, 1010111, 1011100, 1100000, 1100010
MAPLE
b:= proc(n) option remember; `if`(n<2, 1, b(n-1)+
add(i, i=convert(a(n-1), base, 10)))
end:
a:= n-> convert(b(n), binary):
MATHEMATICA
s[0] = s[1] = 1; s[n_] := s[n] = s[n-1] + DigitCount[s[n-1], 2, 1]; Table[FromDigits[IntegerDigits[s[n], 2]], {n, 0, 50}] (* Amiram Eldar, Jul 28 2023 *)
PROG
(PARI) lista(nn) = {my(s = 1); my(t = 1); print1(t, ", "); for (i=1, nn, sb = binary(s); t = subst(Pol(sb), x, 10); print1(t, ", "); s += hammingweight(sb); ); }
Numbers whose binary representation is palindromic and in which all runs of 0's and 1's have length at least 2.
+10
3
3, 7, 15, 31, 51, 63, 99, 127, 195, 231, 255, 387, 455, 511, 771, 819, 903, 975, 1023, 1539, 1651, 1799, 1935, 2047, 3075, 3171, 3315, 3591, 3687, 3855, 3999, 4095, 6147, 6371, 6643, 7175, 7399, 7695, 7967, 8191, 12291, 12483, 12771, 13107, 13299, 14343, 14535, 14823, 15375, 15567, 15903, 16191, 16383, 24579
COMMENTS
These are the decimal representations of A061851 read as base-2 numbers.
The terms with an odd number L = 2k-1 of bits, i.e., 2^(L-1) < a(n) < 2^L, are given by the terms of A033015 with length k, shifted k-1 digits to the left and 'OR'ed with the binary reversal of the term. Terms with an even number L = 2k of digits are given as m*2^k + (binary reversal of m) where m runs over the k-bit terms from A033015 and the k-1 bit terms with the last bit negated appended). This explains the FORMULA for the number of terms of given size. - M. F. Hasler, Oct 17 2022
FORMULA
Intersection of A006995 and A033015: binary palindromes with no isolated digit.
There are A000045( A004526(k)) = Fibonacci(floor(k/2)) terms between 2^(k-1) and 2^k.
EXAMPLE
51 (base 10) = 110011 (base 2), which is a palindrome and has three runs all of length 2.
MATHEMATICA
brpalQ[n_]:=Module[{idn2=IntegerDigits[n, 2]}, idn2==Reverse[idn2] && Min[ Length/@ Split[idn2]]>1]; Select[Range[25000], brpalQ] (* Harvey P. Dale, May 21 2014 *)
PROG
(PARI) { A222813_row(n, s= A033015_row(n\/2))=apply( A030101, if(n%2, s\2, n>2, s=setunion([k*2+1-k%2|k<- A033015_row(n\2-1)], s), s=[1]))+s<<(n\2)} \\ Terms with n bits, i.e. between 2^(n-1) and 2^n. - M. F. Hasler, Oct 17 2022
Search completed in 0.013 seconds
|