A362804
Numbers k such that the set of divisors {d | k, BitOr(k, d) = k} has an integer harmonic mean.
Original entry on oeis.org
1, 2, 4, 6, 8, 12, 16, 24, 28, 30, 32, 45, 48, 56, 60, 64, 90, 96, 112, 120, 128, 180, 192, 224, 240, 256, 360, 384, 448, 480, 496, 512, 720, 768, 896, 960, 992, 1024, 1440, 1536, 1792, 1920, 1984, 2048, 2880, 3072, 3584, 3840, 3968, 4096, 5760, 6144, 7168, 7680
Offset: 1
-
q[n_] := IntegerQ[HarmonicMean[Select[Divisors[n], BitAnd[n, #] == # &]]]; Select[Range[10^4], q]
-
div(n) = select(x->(bitor(x, n) == n), divisors(n));
is(n) = {my(d = div(n)); denominator(#d/sum(i = 1, #d, 1/d[i])) == 1;}
A305299
a(0) = 0, a(1) = 1, a(2) = 2; for n >= 2, a(2*n-1) = n - 2*a(n-1) - 1, a(2*n) = a(2*n-1) - a(n).
Original entry on oeis.org
0, 1, 2, -1, -3, -2, -1, 5, 8, 10, 12, 9, 10, 8, 3, -3, -11, -8, -18, -11, -23, -14, -23, -7, -17, -8, -16, -3, -6, 8, 11, 21, 32, 38, 46, 33, 51, 54, 65, 41, 64, 66, 80, 49, 72, 68, 75, 37, 54, 58, 66, 41, 57, 58, 61, 33, 39, 40, 32, 13, 2, 8, -13, -11, -43, -32, -70, -43, -89, -58, -91, -31, -82, -66, -120, -71, -136, -92
Offset: 0
-
f:= proc(n) option remember;
if n::odd then (n-1)/2-2*procname((n-1)/2)
else procname(n-1)-procname(n/2)
fi
end proc:
f(0):= 0: f(1):= 1: f(2):= 2:
map(f, [$0..77]); # after Robert Israel at A294044
-
a[0] = 0; a[1] = 1; a[2] = 2; a[n_] := If[EvenQ[n], a[n - 1] - a[n/2], (n - 1)/2 - 2 a[(n - 1)/2]]; Table[a[n], {n, 0, 77}] (* after Ilya Gutkovskiy at A294044 *)
-
a(n)=if(n<=2, n, if(n%2==1, (n-1)/2-2*a((n-1)/2), a(n-1)-a(n/2)));
-
a = vector(77); print1 (0", "); for (k=1, #a, print1 (a[k]=if (k<=2, k, my (n=k\2); if (k%2==0, a[2*n-1]-a[n], n-2*a[n]))", ")) \\ after Rémy Sigrist at A303028
A321643
a(n) = 5*2^n - (-1)^n.
Original entry on oeis.org
4, 11, 19, 41, 79, 161, 319, 641, 1279, 2561, 5119, 10241, 20479, 40961, 81919, 163841, 327679, 655361, 1310719, 2621441, 5242879, 10485761, 20971519, 41943041, 83886079, 167772161, 335544319, 671088641, 1342177279, 2684354561, 5368709119, 10737418241, 21474836479
Offset: 0
-
List([0..30],n->5*2^n-(-1)^n); # Muniru A Asiru, Dec 05 2018
-
[5*2^n-(-1)^n$n=0..30]; # Muniru A Asiru, Dec 05 2018
-
a[n_] := 5*2^n - (-1)^n; Array[a, 30, 0] (* Amiram Eldar, Dec 03 2018 *)
-
Vec((4 + 7*x) / ((1 + x)*(1 - 2*x)) + O(x^40)) \\ Colin Barker, Dec 04 2018
-
for n in range(0,30): print(5*2**n - (-1)**n) # Stefano Spezia, Dec 05 2018
A325449
Psi-untouchable numbers: impossible values for A306927(n) = A001615(n) - n.
Original entry on oeis.org
30, 38, 58, 60, 66, 94, 98, 102, 118, 120, 132, 138, 146, 158, 174, 178, 188, 190, 204, 206, 222, 238, 240, 246, 262, 264, 276, 278, 282, 290, 292, 298, 306, 318, 322, 326, 338, 348, 354, 374, 380, 390, 398, 402, 406, 408, 426, 430, 444, 458, 462, 474, 476, 478
Offset: 1
-
f[1] = 0; f[n_] := n*(Times @@ (1 + 1/FactorInteger[n][[;; , 1]]) - 1); m = 300; v = Table[0, {m}]; Do[j = f[k]; If[2 <= j <= m, v[[j]]++], {k, 1, m^2}]; Rest[Position[v, _?(# == 0 &)] // Flatten]
A348556
Binary expansion contains 4 adjacent 1's.
Original entry on oeis.org
15, 30, 31, 47, 60, 61, 62, 63, 79, 94, 95, 111, 120, 121, 122, 123, 124, 125, 126, 127, 143, 158, 159, 175, 188, 189, 190, 191, 207, 222, 223, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 271, 286, 287, 303, 316, 317, 318
Offset: 1
-
q:= n-> verify([1$4], Bits[Split](n), 'sublist'):
select(q, [$0..400])[]; # Alois P. Heinz, Oct 22 2021
-
Select[Range[300], StringContainsQ[IntegerString[#, 2], "1111"] &] (* Amiram Eldar, Oct 22 2021 *)
-
is(n)=n=bitand(n,n<<2); !!bitand(n,n<<1);
-
def ok(n): return "1111" in bin(n)
print([k for k in range(319) if ok(k)]) # Michael S. Branicky, Oct 22 2021
A356120
Irregular triangle read by rows: the n-th row lists the values 0..2^n-1 representing all subsets of a set of n elements. When its elements are linearly ordered, the subsets are lexicographically ordered.
Original entry on oeis.org
0, 0, 1, 0, 2, 3, 1, 0, 4, 6, 7, 5, 2, 3, 1, 0, 8, 12, 14, 15, 13, 10, 11, 9, 4, 6, 7, 5, 2, 3, 1, 0, 16, 24, 28, 30, 31, 29, 26, 27, 25, 20, 22, 23, 21, 18, 19, 17, 8, 12, 14, 15, 13, 10, 11, 9, 4, 6, 7, 5, 2, 3, 1, 0, 32, 48, 56, 60, 62, 63, 61, 58, 59, 57, 52, 54, 55, 53, 50, 51, 49, 40, 44, 46, 47, 45, 42
Offset: 0
For n = 1, 2, 3, the sets B_n, their subsets (the column under B_n), binary characteristic words (column bin.) and corresponding integers (column dec.) are:
B_1 = {c} bin. dec. | B_2 = {b, c} bin. dec. | B_3 = {a, b, c} bin. dec.
{} 0 0 | {} 00 0 | {} 000 0
{c} 1 1 | {b} 10 2 | {a} 100 4
| {b, c} 11 3 | {a, b} 110 6
| {c} 01 1 | {a, b, c} 111 7
| {a, c} 101 5
| {b} 010 2
| {b, c} 011 3
| {c} 001 1
As seen, when B = {a, b, c}, its subsets {}, {a}, {a, b}, {a, b, c}, {a, c}, {b}, {b, c}, {c} are in lexicographic order, the corresponding binary words of length 3 are 000, 100, 110, 111, 101, 010, 011, 001, and so row(3) = 0, 4, 6, 7, 5, 2, 3, 1.
Triangle T(n,k) begins:
k=0 1 2 3 4 5 6 7 ...
n=0: 0;
n=1: 0, 1;
n=2: 0, 2, 3, 1;
n=3: 0, 4, 6, 7, 5, 2, 3, 1;
n=4: 0, 8, 12, 14, 15, 13, 10, 11, 9, 4, 6, 7, 5, 2, 3, 1;
n=5: 0, 16, 24, 28, 30, 31, 29, 26, 27, 25, 20, 22, 23, 21, 18, 19, 17, 8, 12, 14, 15, 13, 10, 11, 9, 4, 6, 7, 5, 2, 3, 1,
...
- Donald E. Knuth, The Art of Computer Programming, Volume 4A, Section 7.2.1.3 Exercise 19 (Binomial tree traversed in post-order).
- Valentin Bakoev, Table of n, a(n) for n = 0..1023
- Joerg Arndt, Matters Computational (The Fxtbook), section 1.26 "Binary words in lexicographic order for subsets", pp. 70-74.
- Joerg Arndt, Subset-lex: did we miss an order?, arXiv:1405.6503 [math.CO], 2014-2015.
- Valentin Bakoev, An Algorithm for Generating All Subsets in Lexicographic Order, ICAI 2022, pp. 271-275.
Cf.
A006516 (row sums),
A000225 (main diagonal, the n-th term of row(n)).
row(n) without leading 0, when read in reverse order, gives the first 2^n-1 terms of
A108918.
-
(* computing row(n) *)
n = 5;
Array[row, 2^n];
row[0] = 0; row[1] = 1;
len = 2;
For[i = 2, i <= n, i++,
For[j = 1, j < len, j++, row[j + len] = row[j]];
For[j = len, j > 0, j--, row[j] = row[j - 1] + len];
len = len*2;
];
A159025
a(0)=71; a(n) = a(n-1) + floor(sqrt(a(n-1))), n > 0.
Original entry on oeis.org
71, 79, 87, 96, 105, 115, 125, 136, 147, 159, 171, 184, 197, 211, 225, 240, 255, 270, 286, 302, 319, 336, 354, 372, 391, 410, 430, 450, 471, 492, 514, 536, 559, 582, 606, 630, 655, 680, 706, 732, 759, 786, 814, 842, 871, 900, 930, 960, 990, 1021, 1052, 1084, 1116, 1149, 1182, 1216
Offset: 0
A344109
a(n) = (5*2^n + 7*(-1)^n)/3.
Original entry on oeis.org
4, 1, 9, 11, 29, 51, 109, 211, 429, 851, 1709, 3411, 6829, 13651, 27309, 54611, 109229, 218451, 436909, 873811, 1747629, 3495251, 6990509, 13981011, 27962029, 55924051, 111848109, 223696211, 447392429, 894784851, 1789569709, 3579139411, 7158278829, 14316557651, 28633115309, 57266230611, 114532461229, 229064922451
Offset: 0
- Élis Gardel da Costa Mesquita, Eudes Antonio Costa, Paula M. M. C. Catarino, and Francisco R. V. Alves, Jacobsthal-Mulatu Numbers, Latin Amer. J. Math. (2025) Vol. 4, No. 1, 23-45. See pp. 24, 26, 43.
- Index entries for linear recurrences with constant coefficients, signature (1,2).
-
LinearRecurrence[{1,2}, {4,1}, 28] (* Amiram Eldar, May 10 2021 *)
Comments