A086141
Permutation of A025487 (least prime signatures) which, when values are factored, exhibit self-similarity (cf. A008687).
Original entry on oeis.org
1, 2, 4, 6, 8, 12, 36, 30, 16, 24, 72, 60, 216, 180, 900, 210, 32, 48, 144, 120, 432, 360, 1800, 420, 1296, 1080, 5400, 1260, 27000, 6300, 44100, 2310, 64, 96, 288, 240, 864, 720, 3600, 840, 2592, 2160, 10800, 2520, 54000, 12600, 88200, 4620, 7776, 6480
Offset: 1
Factored sequences are
1
0 2 0 3 0 3 0 5 0 3 0 5 0 5 0 7 ...
0 0 4 2 0 0 9 3 0 0 9 3 0 0 25 5 ...
0 0 0 0 8 4 4 2 0 0 0 0 27 9 9 3 ...
0 0 0 0 0 0 0 0 16 8 8 4 8 4 4 2 ...
yielding
1 2 4 6 8 12 36 30 16 24 72 60 216 180 900 210 ...
A127904
Smallest m such that A008687(m) = n.
Original entry on oeis.org
0, 1, 3, 5, 9, 17, 33, 65, 129, 257, 513, 1025, 2049, 4097, 8193, 16385, 32769, 65537, 131073, 262145, 524289, 1048577, 2097153, 4194305, 8388609, 16777217, 33554433, 67108865, 134217729, 268435457, 536870913, 1073741825, 2147483649
Offset: 0
-
m:=30; R:=PowerSeriesRing(Rationals(), m); [0] cat Coefficients(R!(x*(1-2*x^2)/((1-x)*(1-2*x)))); // G. C. Greubel, Apr 30 2018
-
Join[{0,1},LinearRecurrence[{3,-2},{3,5},40]] (* or *) Join[{0,1},2^Range[ 40]+1] (* Harvey P. Dale, Jan 16 2013 *)
-
x='x+O('x^30); concat([0], Vec(x*(1-2*x^2)/((1-x)*(1-2*x)))) \\ G. C. Greubel, Apr 30 2018
-
a(n) = if(n<2,n,2^(n-1)+1); \\ Altug Alkan, May 01 2018
A023416
Number of 0's in binary expansion of n.
Original entry on oeis.org
1, 0, 1, 0, 2, 1, 1, 0, 3, 2, 2, 1, 2, 1, 1, 0, 4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 5, 4, 4, 3, 4, 3, 3, 2, 4
Offset: 0
- N. J. A. Sloane, Table of n, a(n) for n = 0..10000
- Franklin T. Adams-Watters and Frank Ruskey, Generating Functions for the Digital Sum and Other Digit Counting Sequences, JIS 12 (2009) 09.5.6.
- Jean-Paul Allouche and Jeffrey O. Shallit, Infinite products associated with counting blocks in binary strings, J. London Math. Soc.39 (1989) 193-204.
- Jean-Paul Allouche and Jeffrey Shallit, Sums of digits and the Hurwitz zeta function, in: K. Nagasaka and E. Fouvry (eds.), Analytic Number Theory, Lecture Notes in Mathematics, Vol. 1434, Springer, Berlin, Heidelberg, 1990, pp. 19-30.
- Alex S. A. Alochukwu, Audace A. V. Dossou-Olory, Fadekemi J. Osaye, Valisoa R. M. Rakotonarivo, Shashank Ravichandran, Sarah J. Selkirk, Hua Wang, and Hays Whitlatch, Characterization of Trees with Maximum Security, arXiv:2411.19188 [math.CO], 2024. See p. 12.
- Khodabakhsh Hessami Pilehrood and Tatiana Hessami Pilehrood, Vacca-Type Series for Values of the Generalized Euler Constant Function and its Derivative, J. Integer Sequences, 13 (2010), Article 10.7.3.
- Vladimir Shevelev, The number of permutations with prescribed up-down structure as a function of two variables, INTEGERS, Vol. 12 (2012), #A1. - From _N. J. A. Sloane_, Feb 07 2013
- Ralf Stephan, Some divide-and-conquer sequences with (relatively) simple ordinary generating functions, 2004.
- Ralf Stephan, Table of generating functions.
- Ralf Stephan, Divide-and-conquer generating functions. I. Elementary sequences, arXiv:math/0307027 [math.CO], 2003.
- Index entries for sequences related to binary expansion of n
With initial zero and shifted right, same as
A080791.
-
a023416 0 = 1
a023416 1 = 0
a023416 n = a023416 n' + 1 - m where (n', m) = divMod n 2
a023416_list = 1 : c [0] where c (z:zs) = z : c (zs ++ [z+1,z])
-- Reinhard Zumkeller, Feb 19 2012, Jun 16 2011, Mar 07 2011
-
A023416 := proc(n)
if n = 0 then
1;
else
add(1-e,e=convert(n,base,2)) ;
end if;
end proc: # R. J. Mathar, Jul 21 2012
-
Table[ Count[ IntegerDigits[n, 2], 0], {n, 0, 100} ]
DigitCount[Range[0,110],2,0] (* Harvey P. Dale, Jan 10 2013 *)
-
a(n)=if(n==0,1,n=binary(n); sum(i=1, #n, !n[i])) \\ Charles R Greathouse IV, Jun 10 2011
-
a(n)=if(n==0,1,#binary(n)-hammingweight(n)) \\ Charles R Greathouse IV, Nov 20 2012
-
a(n) = if(n == 0, 1, 1+logint(n,2) - hammingweight(n)) \\ Gheorghe Coserea, Sep 01 2015
-
def A023416(n): return n.bit_length()-n.bit_count() if n else 1 # Chai Wah Wu, Mar 13 2023
A083318
a(0) = 1; for n>0, a(n) = 2^n + 1.
Original entry on oeis.org
1, 3, 5, 9, 17, 33, 65, 129, 257, 513, 1025, 2049, 4097, 8193, 16385, 32769, 65537, 131073, 262145, 524289, 1048577, 2097153, 4194305, 8388609, 16777217, 33554433, 67108865, 134217729, 268435457, 536870913, 1073741825, 2147483649
Offset: 0
From _Omar E. Pol_, Feb 24 2008: (Start)
------------------------------
n .... a(n) .. a(n) in base 2
------------------------------
0 ..... 1 ..... 1
1 ..... 3 ..... 11
2 ..... 5 ..... 101
3 ..... 9 ..... 1001
4 .... 17 ..... 10001
5 .... 33 ..... 100001
6 .... 65 ..... 1000001
7 ... 129 ..... 10000001
8 ... 257 ..... 100000001
9 ... 513 ..... 1000000001
(End)
G.f. = 1 + 3*x + 5*x^2 + 9*x^3 + 17*x^4 + 33*x^5 + 65*x^6 + 129*x^7 + ... - _Michael Somos_, Jun 04 2016
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Ramon Carbó-Dorca, Boolean Hypercubes: The Origin of a Tagged Recursive Logic and the Limits of Artificial Intelligence, Universitat de Girona (Spain, 2020).
- Quynh Nguyen, Jean Pedersen, and Hien T. Vu, New Integer Sequences Arising From 3-Period Folding Numbers, Vol. 19 (2016), Article 16.3.1. Cites this sequence.
- Index entries for linear recurrences with constant coefficients, signature (3,-2).
Except for the leading term, the same as
A000051.
-
Concatenation([1], List([1..40], n-> 2^n +1)); # G. C. Greubel, Nov 20 2019
-
[2^n+1-0^n : n in [0..40]]; // Vincenzo Librandi, Sep 01 2011
-
seq(`if`(n=0, 1, 2^n + 1), n=0..40); # G. C. Greubel, Nov 20 2019
-
Join[{1},2^Range[40]+1] (* Harvey P. Dale, May 17 2013 *)
-
{a(n) = if( n<1, n==0, 2^n + 1)}; /* Michael Somos, Jun 04 2016 */
-
[1]+[2^n +1 for n in (1..40)] # G. C. Greubel, Nov 20 2019
A228369
Triangle read by rows in which row n lists the compositions (ordered partitions) of n in lexicographic order.
Original entry on oeis.org
1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 3, 2, 1, 1, 2, 2, 3, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 3, 1, 2, 1, 1, 1, 2, 2, 1, 3, 1, 1, 4, 2, 1, 1, 1, 2, 1, 2, 2, 2, 1, 2, 3, 3, 1, 1, 3, 2, 4, 1, 5, 1, 1, 1, 1, 1, 1
Offset: 1
Illustration of initial terms:
-----------------------------------
n j Diagram Composition j
-----------------------------------
. _
1 1 |_| 1;
. _ _
2 1 | |_| 1, 1,
2 2 |_ _| 2;
. _ _ _
3 1 | | |_| 1, 1, 1,
3 2 | |_ _| 1, 2,
3 3 | |_| 2, 1,
3 4 |_ _ _| 3;
. _ _ _ _
4 1 | | | |_| 1, 1, 1, 1,
4 2 | | |_ _| 1, 1, 2,
4 3 | | |_| 1, 2, 1,
4 4 | |_ _ _| 1, 3,
4 5 | | |_| 2, 1, 1,
4 6 | |_ _| 2, 2,
4 7 | |_| 3, 1,
4 8 |_ _ _ _| 4;
.
Triangle begins:
[1];
[1,1],[2];
[1,1,1],[1,2],[2,1],[3];
[1,1,1,1],[1,1,2],[1,2,1],[1,3],[2,1,1],[2,2],[3,1],[4];
[1,1,1,1,1],[1,1,1,2],[1,1,2,1],[1,1,3],[1,2,1,1],[1,2,2],[1,3,1],[1,4],[2,1,1,1],[2,1,2],[2,2,1],[2,3],[3,1,1],[3,2],[4,1],[5];
...
-
a228369 n = a228369_list !! (n - 1)
a228369_list = concatMap a228369_row [1..]
a228369_row 0 = []
a228369_row n
| 2^k == 2 * n + 2 = [k - 1]
| otherwise = a228369_row (n `div` 2^k) ++ [k] where
k = a007814 (n + 1) + 1
-- Peter Kagey, Jun 27 2016
-
Table[Sort[Join@@Permutations/@IntegerPartitions[n],OrderedQ[PadRight[{#1,#2}]]&],{n,5}] (* Gus Wiseman, Dec 14 2017 *)
-
gen_comp(n)=
{ /* Generate compositions of n as lists of parts (order is lex): */
my(ct = 0);
my(m, z, pt);
\\ init:
my( a = vector(n, j, 1) );
m = n;
while ( 1,
ct += 1;
pt = vector(m, j, a[j]);
/* for A228369 print composition: */
for (j=1, m, print1(pt[j],", ") );
\\ /* for A228525 print reversed (order is colex): */
\\ forstep (j=m, 1, -1, print1(pt[j],", ") );
if ( m<=1, return(ct) ); \\ current is last
a[m-1] += 1;
z = a[m] - 2;
a[m] = 1;
m += z;
);
return(ct);
}
for(n=1, 12, gen_comp(n) );
\\ Joerg Arndt, Sep 02 2013
-
a = [[[]], [[1]]]
for s in range(2, 9):
a.append([])
for k in range(1, s+1):
for ss in a[s-k]:
a[-1].append([k]+ss)
print(a)
# Andrey Zabolotskiy, Jul 19 2017
Original entry on oeis.org
1, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1
-
GS:=proc(i,j,M) local a,n; a:=array(1..2*M+1); a[1]:=1;
for n from 1 to M do
a[2*n] :=[0,1,a[n],a[n]+1,2*a[n],2*a[n]+1][i];
a[2*n+1]:=[0,1,a[n],a[n]+1,2*a[n],2*a[n]+1][j];
od: a:=convert(a,list); RETURN(a); end;
GS(1,5,200):
-
i = 1; j = 5; Clear[a]; a[1] = 1; a[n_?EvenQ] := a[n] = {0, 1, a[n/2], a[n/2]+1, 2*a[n/2], 2*a[n/2]+1}[[i]]; a[n_?OddQ] := a[n] = {0, 1, a[(n-1)/2], a[(n-1)/2]+1, 2*a[(n-1)/2], 2*a[(n-1)/2]+1}[[j]]; Array[a, 105] (* Jean-François Alcover, Sep 12 2013 *)
-
A048298(n) = if(!n,0,if(!bitand(n,n-1),n,0));
A135416(n) = (A048298(n+1)/2); \\ Antti Karttunen, Jul 22 2018
-
def A135416(n): return int(not(n&(n+1)))*(n+1)>>1 # Chai Wah Wu, Jul 06 2022
A004754
Numbers n whose binary expansion starts 10.
Original entry on oeis.org
2, 4, 5, 8, 9, 10, 11, 16, 17, 18, 19, 20, 21, 22, 23, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 128, 129, 130, 131
Offset: 1
10 in binary is 1010, so 10 is in sequence.
Apart from initial terms, same as
A004761.
-
import Data.List (transpose)
a004754 n = a004754_list !! (n-1)
a004754_list = 2 : concat (transpose [zs, map (+ 1) zs])
where zs = map (* 2) a004754_list
-- Reinhard Zumkeller, Dec 04 2015
-
w = {1, 0}; Select[Range[2, 131], If[# < 2^(Length@ w - 1), True, Take[IntegerDigits[#, 2], Length@ w] == w] &] (* Michael De Vlieger, Aug 08 2016 *)
-
a(n)=n+2^floor(log(n)/log(2))
-
is(n)=n>1 && !binary(n)[2] \\ Charles R Greathouse IV, Sep 23 2012
-
def A004754(n): return n+(1<Chai Wah Wu, Jul 13 2022
A125106
Enumeration of partitions by binary representation: each 1 is a part; the part size is 1 more than the number of 0's in the rest of the number.
Original entry on oeis.org
1, 2, 1, 1, 3, 2, 1, 2, 2, 1, 1, 1, 4, 3, 1, 3, 2, 2, 1, 1, 3, 3, 2, 2, 1, 2, 2, 2, 1, 1, 1, 1, 5, 4, 1, 4, 2, 3, 1, 1, 4, 3, 3, 2, 1, 3, 2, 2, 2, 1, 1, 1, 4, 4, 3, 3, 1, 3, 3, 2, 2, 2, 1, 1, 3, 3, 3, 2, 2, 2, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1
Offset: 1
Row 4:
1000 [4]
1001 [3,1]
1010 [3,2]
1011 [2,1,1]
1100 [3,3]
1101 [2,2,1]
1110 [2,2,2]
1111 [1,1,1,1]
-
b:= proc(n) local c, l, m; l:=[][]; m:= n; c:=1;
while m>0 do if irem(m, 2, 'm')=0 then c:= c+1
else l:= c, l fi
od; l
end:
T:= n-> seq(b(i), i=2^(n-1)..2^n-1):
seq(T(n), n=1..7); # Alois P. Heinz, Sep 25 2015
-
f[k_] := (bits = IntegerDigits[k, 2]; zerosCount = Reverse[ Accumulate[ 1-Reverse[bits] ] ] + 1; Select[ Transpose[ {bits, zerosCount} ], First[#] == 1 & ][[All, 2]]); row[n_] := Table[ f[k], {k, 2^(n-1), 2^n-1}]; Flatten[ Table[ row[n], {n, 1, 5}]] (* Jean-François Alcover, Jan 24 2012 *)
scc[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
Table[Reverse[scc[n]-Range[Length[scc[n]]]+1],{n,0,20}] (* Gus Wiseman, Jan 17 2023 *)
A242628
Irregular table enumerating partitions; n-th row has partitions in previous row with each part incremented, followed by partitions in previous row with an additional part of size 1.
Original entry on oeis.org
1, 2, 1, 1, 3, 2, 2, 2, 1, 1, 1, 1, 4, 3, 3, 3, 2, 2, 2, 2, 3, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 5, 4, 4, 4, 3, 3, 3, 3, 4, 2, 3, 3, 2, 3, 2, 2, 2, 2, 2, 2, 4, 1, 3, 3, 1, 3, 2, 1, 2, 2, 2, 1, 3, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 6, 5, 5, 5, 4, 4, 4, 4, 5, 3, 4, 4, 3, 4, 3, 3, 3, 3, 3, 3, 5, 2
Offset: 1
The table starts:
1;
2; 1,1;
3; 2,2; 2,1; 1,1,1;
4; 3,3; 3,2; 2,2,2; 3,1 2,2,1 2,1,1 1,1,1,1;
...
First element in each row is
A008687.
Last element in each row is
A065120.
-
b:= proc(n) option remember; `if`(n=1, [[1]],
[map(x-> map(y-> y+1, x), b(n-1))[],
map(x-> [x[], 1], b(n-1))[]])
end:
T:= n-> map(x-> x[], b(n))[]:
seq(T(n), n=1..7); # Alois P. Heinz, Sep 25 2015
-
T[1] = {{1}};
T[n_] := T[n] = Join[T[n-1]+1, Append[#, 1]& /@ T[n-1]];
Array[T, 7] // Flatten (* Jean-François Alcover, Jan 25 2021 *)
-
apart(n) = local(r=[1]); while(n>1,if(n%2==0,for(k=1,#r,r[k]++),r=concat(r,[1]));n\=2);r \\ Generates n-th partition.
A290251
a(n) is the number of parts in the integer partition having viabin number n.
Original entry on oeis.org
0, 1, 2, 1, 3, 2, 2, 1, 4, 3, 3, 2, 3, 2, 2, 1, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 7, 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4
Offset: 0
a(9) = 3. Indeed, the binary form of 9 is 1001; with an additional 0 at the end, it leads to the path ENNEN, where E=(1,0), N=(0,1); this path is the southeast border of the Ferrers board of the integer partition [2,1,1], having 3 parts.
From _Omar E. Pol_, Jul 24 2017: (Start)
Written as an irregular triangle the sequence begins:
0;
1;
2,1;
3,2,2,1;
4,3,3,2,3,2,2,1;
5,4,4,3,4,3,3,2,4,3,3,2,3,2,2,1;
6,5,5,4,5,4,4,3,5,4,4,3,4,3,3,2,5,4,4,3,4,3,3,2,4,3,3,2,3,2,2,1;
...(End)
Cf.
A000120,
A001222,
A008687,
A011782,
A023416,
A048881,
A063787,
A070939,
A163511,
A290252,
A366275.
-
a := proc (n) if n < 2 then n elif `mod`(n, 2) = 0 then 1+a((1/2)*n) else a((1/2)*n-1/2) end if end proc: seq(a(n), n = 0 .. 150);
-
a[n_] := a[n] = Which[n < 2, n, EvenQ[n], 1+a[n/2], True, a[(n-1)/2]];
Table[a[n], {n, 0, 105}] (* Jean-François Alcover, Aug 06 2024 *)
-
A290251(n) = ((n>0)+#binary(n)-hammingweight(n)); \\ Antti Karttunen, Oct 06 2023
Showing 1-10 of 16 results.
Comments