cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 11-18 of 18 results.

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

Views

Author

Amiram Eldar, May 04 2023

Keywords

Comments

Equivalently, the set of divisors can be defined by {d | k, BitAnd(k, d) = d}.
Analogous to harmonic (or Ore) numbers (A001599) where the divisors d of k are restricted by BitOr(k, d) = k or BitAnd(k, d) = d.
If k is a term then so is 2*k. The primitive terms are in A362805. Thus, this sequence includes all the powers of 2 (A000079), all the numbers of the form 3*2^m and 15*2^m for m >= 1, and all the numbers of the form 7*2^m for m >= 2.
All the even perfect numbers (A000396) are terms: if k = 2^(p-1)*(2^p-1) is a perfect number (where p is a Mersenne exponent, A000043), then the only divisors of k such that BitOr(k, d) = k are 2^(p-1) and k itself, and the harmonic mean of 2^(p-1) and 2^(p-1)*(2^p-1) is 2^p - 1.
Are 1 and 45 the only odd terms in this sequence?

Crossrefs

Subsequences: A000079, A007283 \ {3}, A005009 \ {7, 14}, A110286 \ {15}, A362805.
Similar sequences: A001599, A006086, A063947, A286325, A319745.

Programs

  • Mathematica
    q[n_] := IntegerQ[HarmonicMean[Select[Divisors[n], BitAnd[n, #] == # &]]]; Select[Range[10^4], q]
  • PARI
    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

Views

Author

Altug Alkan, Aug 18 2018

Keywords

Comments

This sequence has an approximate self-similar block structure, which is roughly described by A110286, see Links section.
a(0) = 0 by definition. The next 0 is a(970) = 0. What are the other numbers k such that a(k) = 0?

Crossrefs

Programs

  • Maple
    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
  • Mathematica
    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 *)
  • PARI
    a(n)=if(n<=2, n, if(n%2==1, (n-1)/2-2*a((n-1)/2), a(n-1)-a(n/2)));
    
  • PARI
    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

Views

Author

Paul Curtz, Dec 03 2018

Keywords

Crossrefs

Programs

  • GAP
    List([0..30],n->5*2^n-(-1)^n); # Muniru A Asiru, Dec 05 2018
    
  • Maple
    [5*2^n-(-1)^n$n=0..30]; # Muniru A Asiru, Dec 05 2018
  • Mathematica
    a[n_] := 5*2^n - (-1)^n; Array[a, 30, 0] (* Amiram Eldar, Dec 03 2018 *)
  • PARI
    Vec((4 + 7*x) / ((1 + x)*(1 - 2*x)) + O(x^40)) \\ Colin Barker, Dec 04 2018
    
  • Python
    for n in range(0,30): print(5*2**n - (-1)**n) # Stefano Spezia, Dec 05 2018

Formula

a(n+2) - a(n) = a(n+1) + a(n) = 15*2^n, n >= 0.
a(n) - 2*a(n-1) = period 2: repeat [3, -3], n > 0, a(0)=4, a(1)=11.
a(n+1) = 10*A051049(n) + period 2: repeat [1, 9].
a(n) = 12*2^n - A321483(n), n >= 0.
a(n) = 2^(n+2) + 3*A001045(n), n >= 0.
a(n) == A070366(n+4) (mod 9).
From Colin Barker, Dec 04 2018: (Start)
G.f.: (4 + 7*x) / ((1 + x)*(1 - 2*x)).
a(n) = a(n-1) + 2*a(n-2) for n > 1. (End)
E.g.f.: exp(-x)*(5*exp(3*x) - 1). - Elmo R. Oliveira, Aug 17 2024

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

Views

Author

Amiram Eldar, Sep 06 2019

Keywords

Comments

Analogous to untouchable numbers (A005114) with Dedekind psi function (A001615) instead of the sum of divisors function, sigma (A000203).
te Riele named these numbers psi_1-untouchable. He calculated the first 2896 terms (terms below 20000). He proved that this sequence is infinite by showing that all the numbers of the form 2^k*3*5 (k >= 1, A110286(k) except for k = 0) are psi-untouchables.

Crossrefs

Programs

  • Mathematica
    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

Views

Author

Keywords

Comments

For k > 0, each term m = 2^(k+3) - 1 is the end of a run of A083593(k-1) consecutive terms. For k = 4, from a(13) = 120 up to a(20) = 2^7-1 = 127, there are A083593(3) = 8 consecutive terms corresponding to 1111000, 1111001, 1111010, 1111011, 1111100, 1111101, 111110 and 1111111. - Bernard Schott, Feb 20 2022

Crossrefs

Binary expansion contains k adjacent 1s: A000027 (1), A004780 (2), A004781 (3), this sequence (4).
Subsequences: A110286, A195744.

Programs

  • Maple
    q:= n-> verify([1$4], Bits[Split](n), 'sublist'):
    select(q, [$0..400])[];  # Alois P. Heinz, Oct 22 2021
  • Mathematica
    Select[Range[300], StringContainsQ[IntegerString[#, 2], "1111"] &] (* Amiram Eldar, Oct 22 2021 *)
  • PARI
    is(n)=n=bitand(n,n<<2); !!bitand(n,n<<1);
    
  • Python
    def ok(n): return "1111" in bin(n)
    print([k for k in range(319) if ok(k)]) # Michael S. Branicky, Oct 22 2021

Formula

a(n) ~ n.
a(n+1) <= a(n) + 16.

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

Views

Author

Valentin Bakoev, Jul 27 2022

Keywords

Comments

The sequence in the n-th row of the triangle is denoted by row(n). It contains the values in the range 0..2^n-1 corresponding to the binary vectors of length n. The integers in row (n), considered as characteristic vectors of the set B_n = {b_n, b_(n-1), ..., b_2, b_1}, whose elements are linearly ordered: b_n < b_(n-1) < ... < b_2 < b_1, define all subsets of B_n in lexicographic order. To obtain row(n) we reason inductively as follows. Obviously, row(0) = 0 = a(0) and corresponds to the empty set {}. Assume that the sequence row(n-1) = i_0, i_1, ..., i_(2^(n-1)-1) is obtained. It defines a lexicographic order of the subsets of B_(n-1) = {b_(n-1) , ..., b_2, b_1} - note that its elements linearly ordered. Then row (n) = i_0, 2^(n-1) + i_0, 2^(n-1) + i_1, ..., 2^(n-1) + i_(2^(n-1)-1), i_1, ..., i_(2^(n-1)-1) defines all subsets of B_n in lexicographic order. In other words, row(n) = 0, (row(n-1) + 2^(n-1)), (row(n-1) without the first term 0), i.e., row(n-1) is taken twice: first, all terms of row(n-1) are incremented by 2^(n-1) and second, the resulting sequence is inserted after the first term of row(n-1), which is always 0 and corresponds to {}.

Examples

			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,
  ...
		

References

  • Donald E. Knuth, The Art of Computer Programming, Volume 4A, Section 7.2.1.3 Exercise 19 (Binomial tree traversed in post-order).

Crossrefs

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.
Starting with the n-th term of row(n), columns 0..4 are: A000004, A131577 without 0, A007283, A135092, A110286.

Programs

  • Mathematica
    (* 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;
    ];

Formula

row(n) is defined as:
row(0) = 0;
row(n) = 0, (2^(n-1)+row(n-1)), (row(n-1)\{0}),
where (2^(n-1) + row(n-1)) means a subsequence obtained by adding 2^(n-1) to every term of row(n-1), and (row(n-1)\{0}) means a subsequence row(n-1) without its first term 0, for n = 0, 1, 2, ...).
Then a(n) is defined as:
a(2^m - 1) = 0, for m = 0, 1, 2, ..., and
a(2^m + k) = 2^(m-1) + a(2^(m-1) + k - 1), for k = 0, 1, ..., 2^(m-1) - 1, and
a(2^m + 2^(m-1) + k) = a(2^(m-1)+k), for k = 0, 1, ..., 2^(m-1) - 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

Views

Author

Philippe Deléham, Apr 02 2009

Keywords

Comments

Row 7 in square array A159016.
This sequence contains infinitely many squares. - Philippe Deléham, Apr 04 2009

Crossrefs

Extensions

More terms from Vincenzo Librandi, Apr 10 2009

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

Views

Author

Paul Curtz, May 09 2021

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1,2}, {4,1}, 28] (* Amiram Eldar, May 10 2021 *)

Formula

a(n+1) = 5*2^n - a(n) for n >= 0, with a(0) = 4.
a(n+2) = 5*2^n + a(n) for n >= 0, with a(0) = 4, a(1) = 1.
a(n+3) = 15*2^n - a(n) for n >= 0, with a(0) = 4, a(1) = 1, a(2) = 9.
a(n) = A001045(n+2) + A154879(n).
a(2*n+1) = A321421(n).
a(n) = a(n-1) + 2*a(n-2) for n >= 2. - Pontus von Brömssen, May 09 2021
G.f.: (4 - 3*x)/(1 - x - 2*x^2). - Stefano Spezia, May 10 2021
a(n) = 2*A014551(n) - A001045(n).
a(n) = abs(A156550(n)) - (-1)^n.
a(n+3) = a(n) + 7*A084214(n+1) for n >= 0, with a(0) = 4.
a(n) = 5*A001045(n+1) - A084214(n+1) for n >= 0.
a(n) = A084214(n+1) + 3*(-1)^n for n >= 0.
Previous Showing 11-18 of 18 results.