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 21-30 of 37 results. Next

A020336 Numbers whose base-8 representation is the juxtaposition of two identical strings.

Original entry on oeis.org

9, 18, 27, 36, 45, 54, 63, 520, 585, 650, 715, 780, 845, 910, 975, 1040, 1105, 1170, 1235, 1300, 1365, 1430, 1495, 1560, 1625, 1690, 1755, 1820, 1885, 1950, 2015, 2080, 2145, 2210, 2275, 2340, 2405, 2470, 2535, 2600, 2665, 2730, 2795, 2860, 2925, 2990, 3055
Offset: 1

Views

Author

David W. Wilson, Melia Aldridge (ma38(AT)spruce.evansville.edu)

Keywords

Examples

			650_10 = 1212_8. - _Jon E. Schoenfield_, Feb 12 2021
		

Crossrefs

Programs

  • Mathematica
    a[n_] := n + n*8^Floor[Log[8, n] + 1]; Array[a, 50] (* Amiram Eldar, Apr 06 2021 *)

Formula

a(n) = n*8^floor(log_8(n)+1) + n. - Ilya Gutkovskiy, Jan 26 2018

A020337 Numbers whose base-9 representation is the juxtaposition of two identical strings.

Original entry on oeis.org

10, 20, 30, 40, 50, 60, 70, 80, 738, 820, 902, 984, 1066, 1148, 1230, 1312, 1394, 1476, 1558, 1640, 1722, 1804, 1886, 1968, 2050, 2132, 2214, 2296, 2378, 2460, 2542, 2624, 2706, 2788, 2870, 2952, 3034, 3116, 3198, 3280, 3362, 3444, 3526, 3608, 3690, 3772
Offset: 1

Views

Author

David W. Wilson, Melia Aldridge (ma38(AT)spruce.evansville.edu)

Keywords

Examples

			902_10 = 1212_9. - _Jon E. Schoenfield_, Feb 12 2021
		

Crossrefs

Programs

  • Mathematica
    a[n_] := n + n*9^Floor[Log[9, n] + 1]; Array[a, 50] (* Amiram Eldar, Apr 06 2021 *)

Formula

a(n) = n*9^floor(log_9(n)+1) + n. - Ilya Gutkovskiy, Jan 26 2018

A246830 T(n,k) is the concatenation of n-k and n+k in binary; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

0, 3, 2, 10, 7, 4, 15, 20, 13, 6, 36, 29, 22, 15, 8, 45, 38, 31, 40, 25, 10, 54, 47, 72, 57, 42, 27, 12, 63, 104, 89, 74, 59, 44, 29, 14, 136, 121, 106, 91, 76, 61, 46, 31, 16, 153, 138, 123, 108, 93, 78, 63, 80, 49, 18, 170, 155, 140, 125, 110, 95, 144, 113, 82, 51, 20
Offset: 0

Views

Author

Alois P. Heinz, Sep 04 2014

Keywords

Examples

			Triangle T(n,k) begins:
   0
   3  2
  10  7  4
  15 20 13  6
  36 29 22 15  8
  45 38 31 40 25 10
  54 47 72 57 42 27 12
Triangle T(n,k) written in binary (with | denoting the concat operation) begins:
     |0
    1|1      |10
   10|10    1|11     |100
   11|11   10|100   1|101    |110
  100|100  11|101  10|110   1|111    |1000
  101|101 100|110  11|111  10|1000  1|1001  |1010
  110|110 101|111 100|1000 11|1001 10|1010 1|1011 |1100
		

Crossrefs

Column k=0 gives A020330.
T(n+1,n) gives A080565(n+1).
T(2n,n) gives A246831.
Main diagonal gives A005843.
Cf. A007088, A030308, A051162, A025581, A246520 (row maxima).

Programs

  • Haskell
    import Data.Function (on)
    a246830 n k = a246830_tabl !! n !! k
    a246830_row n = a246830_tabl !! n
    a246830_tabl = zipWith (zipWith f) a051162_tabl a025581_tabl where
       f x y = foldr (\b v -> 2 * v + b) 0 $ x |+| y
       (|+|) = (++) `on` a030308_row
    -- Reinhard Zumkeller, Sep 04 2014
    
  • Maple
    f:= proc(i, j) local r, h, k; r:=0; h:=0; k:=j;
          while k>0 do r:=r+2^h*irem(k, 2, 'k'); h:=h+1 od; k:=i;
          while k>0 do r:=r+2^h*irem(k, 2, 'k'); h:=h+1 od; r
        end:
    T:= (n, k)-> f(n-k, n+k):
    seq(seq(T(n, k), k=0..n), n=0..14);
  • Mathematica
    f[i_, j_] := Module[{r, h, k, m}, r=0; h=0; k=j; While[k>0, {k, m} = QuotientRemainder[k, 2]; r = r+2^h*m; h = h+1]; k=i; While[k>0, {k, m} = QuotientRemainder[k, 2]; r = r+2^h*m; h = h+1]; r]; T[n_, k_] := f[n-k, n+k]; Table[Table[T[n, k], {k, 0, n}], {n, 0, 14}] // Flatten (* Jean-François Alcover, Oct 03 2016, adapted from Maple *)
  • Python
    A246830 = []
    for n in range(10**2):
        for k in range(n):
            A246830.append(int(bin(n-k)[2:]+bin(n+k)[2:],2))
        A246830.append(2*n) # Chai Wah Wu, Sep 05 2014

A320441 Numbers whose binary expansion is quasiperiodic.

Original entry on oeis.org

3, 7, 10, 15, 21, 31, 36, 42, 45, 54, 63, 73, 85, 91, 109, 127, 136, 146, 153, 170, 173, 181, 182, 187, 204, 219, 221, 238, 255, 273, 292, 307, 341, 365, 375, 409, 438, 443, 477, 511, 528, 546, 561, 585, 594, 614, 627, 660, 682, 685, 693, 725, 726, 731, 750
Offset: 1

Views

Author

Rémy Sigrist, Jan 09 2019

Keywords

Comments

The binary representation of a term (ignoring leading zeros) can be covered by (possibly overlapping) occurrences of one of its proper prefix.
This sequence contains A121016.
For any k > 0, there are A320434(k)/2 terms with binary length k.

Examples

			The first terms, alongside their binary representations and prefixes, are:
  n   a(n)  bin(a(n))  prefix
  --  ----  ---------  ------
   1     3         11       1
   2     7        111       1
   3    10       1010      10
   4    15       1111       1
   5    21      10101     101
   6    31      11111       1
   7    36     100100     100
   8    42     101010      10
   9    45     101101     101
  10    54     110110     110
  11    63     111111       1
  12    73    1001001    1001
		

Crossrefs

Programs

  • PARI
    isok(w) = { my (tt=0); for (l=1, oo, my (t=w%(2^l)); if (t!=tt, if (t==w, return (0)); my (r=w, g=l); while (g-->=0 && r>=t, r \= 2; if (r%(2^l)==t, if (r==t, return (1), g=l))); tt = t)) }
    
  • Python
    def qp(w):
        for i in range(1, len(w)):
            prefix, covered = w[:i], set()
            for j in range(len(w)-i+1):
                if w[j:j+i] == prefix:
                    covered |= set(range(j, j+i))
            if covered == set(range(len(w))):
                return True
        return False
    def ok(n): return qp(bin(n)[2:])
    print([k for k in range(751) if ok(k)]) # Michael S. Branicky, Mar 20 2022

Formula

A020330(a(n)) belongs to the sequence for any n > 0.
A297405(a(n)) belongs to the sequence for any n > 0.

A337222 a(n) is the least number that can be obtained by replacing some square XX in the binary expansion of n by X.

Original entry on oeis.org

0, 1, 2, 1, 2, 5, 2, 3, 4, 5, 2, 5, 4, 5, 6, 3, 4, 9, 10, 9, 4, 5, 10, 11, 8, 9, 6, 11, 12, 13, 6, 7, 8, 9, 18, 17, 4, 9, 18, 19, 8, 9, 10, 11, 20, 5, 22, 11, 12, 17, 18, 19, 12, 13, 6, 23, 24, 25, 14, 27, 12, 13, 14, 7, 8, 17, 18, 19, 34, 17, 34, 35, 8, 9, 18
Offset: 0

Views

Author

Rémy Sigrist, Aug 19 2020

Keywords

Comments

Leading zeros in binary expansions are ignored.
There are four fixed points: 0, 1, 2 and 5; their binary expansion is a squarefree string.

Examples

			The first terms, in decimal and in binary, are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     2      10         10
   3     1      11          1
   4     2     100         10
   5     5     101        101
   6     2     110         10
   7     3     111         11
   8     4    1000        100
   9     5    1001        101
  10     2    1010         10
  11     5    1011        101
  12     4    1100        100
  13     5    1101        101
  14     6    1110        110
  15     3    1111         11
  16     4   10000        100
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(A020330(n)) = n for any n > 0.

A246834 A(n,k) is the concatenation of n and k*n in binary; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

0, 0, 1, 0, 3, 2, 0, 6, 10, 3, 0, 7, 20, 15, 4, 0, 12, 22, 30, 36, 5, 0, 13, 40, 57, 72, 45, 6, 0, 14, 42, 60, 76, 90, 54, 7, 0, 15, 44, 63, 144, 95, 108, 63, 8, 0, 24, 46, 114, 148, 180, 210, 126, 136, 9, 0, 25, 80, 117, 152, 185, 216, 245, 272, 153, 10
Offset: 0

Views

Author

Alois P. Heinz, Sep 04 2014

Keywords

Examples

			Square array A(n,k) begins:
  0,   0,   0,   0,   0,   0,   0,   0,    0, ...
  1,   3,   6,   7,  12,  13,  14,  15,   24, ...
  2,  10,  20,  22,  40,  42,  44,  46,   80, ...
  3,  15,  30,  57,  60,  63, 114, 117,  120, ...
  4,  36,  72,  76, 144, 148, 152, 156,  288, ...
  5,  45,  90,  95, 180, 185, 190, 355,  360, ...
  6,  54, 108, 210, 216, 222, 420, 426,  432, ...
  7,  63, 126, 245, 252, 483, 490, 497,  504, ...
  8, 136, 272, 280, 544, 552, 560, 568, 1088, ...
		

Crossrefs

Columns k=0,1,3 give: A001477, A020330, A246831.
Rows n=0, 1 give: A000004, A004760(k+1).

Programs

  • Maple
    f:= proc(i, j) local r, h, k; r:=0; h:=0; k:=j;
          while k>0 do r:=r+2^h*irem(k, 2, 'k'); h:=h+1 od; k:=i;
          while k>0 do r:=r+2^h*irem(k, 2, 'k'); h:=h+1 od; r
        end:
    A:= (n, k)-> f(n, k*n):
    seq(seq(A(n, d-n), n=0..d), d=0..14);

A297405 Binary "cubes"; numbers whose binary representation consists of three consecutive identical blocks.

Original entry on oeis.org

7, 42, 63, 292, 365, 438, 511, 2184, 2457, 2730, 3003, 3276, 3549, 3822, 4095, 16912, 17969, 19026, 20083, 21140, 22197, 23254, 24311, 25368, 26425, 27482, 28539, 29596, 30653, 31710, 32767, 133152, 137313, 141474, 145635, 149796, 153957, 158118, 162279, 166440, 170601, 174762, 178923, 183084, 187245
Offset: 1

Views

Author

Jeffrey Shallit, Dec 29 2017

Keywords

Comments

Alternatively, numbers of the form k*(4^n + 2^n + 1), where 2^(n-1) <= k < 2^n.

Examples

			42 in base 2 is 101010, which consists of three copies of the block "10".
		

Crossrefs

Cf. A020330, which is the corresponding sequence for squares.
Subsequence of A121016.

Programs

  • Maple
    a:= n-> (p-> n*(1+2^p+4^p))(1+ilog2(n)):
    seq(a(n), n=1..50);  # Alois P. Heinz, Dec 29 2017
  • Mathematica
    bc[n_]:=FromDigits[Join[n,n,n],2]; Flatten[Table[bc/@Select[Tuples[ {1,0},n],#[[1]] == 1&],{n,6}]]//Union (* Harvey P. Dale, Oct 09 2021 *)
  • PARI
    a(n) = n=binary(n); fromdigits(concat([n, n, n]) , 2) \\ Iain Fox, Jul 04 2022
  • Python
    def a(n): return int(bin(n)[2:]*3, 2)
    print([a(n) for n in range(1, 46)]) # Michael S. Branicky, Jul 04 2022
    # Alternative:
    def A297405(n):
        p = n.bit_length()
        return n * (1 + 2**p + 4**p)
    print([A297405(n) for n in range(1, 46)])  # Peter Luschny, Jul 05 2022
    

Formula

a(n) = n*(1 + 2^p + 4^p) with p = 1 + floor(log_2(n)). - Alois P. Heinz, Dec 29 2017
G.f.: (7*x + Sum_{n>=1} (4^n + 3*8^n + (2^n + 2*4^n - 3*8^n)*x)*x^(2^n))/(1-x)^2. - Robert Israel, Dec 31 2017

A267508 Smallest number "c-equivalent" to n.

Original entry on oeis.org

1, 2, 3, 4, 5, 5, 7, 8, 9, 10, 11, 9, 11, 11, 15, 16, 17, 18, 19, 18, 21, 21, 23, 17, 19, 21, 23, 19, 23, 23, 31, 32, 33, 34, 35, 36, 37, 37, 39, 34, 37, 42, 43, 37, 43, 43, 47, 33, 35, 37, 39, 37, 43, 43, 47, 35, 39, 43, 47, 39, 47, 47, 63, 64, 65, 66, 67, 68, 69, 69, 71, 68, 73
Offset: 1

Views

Author

Jörgen Backelin, Jan 16 2016

Keywords

Comments

For c-equivalence, see the comments to A233249. Briefly put, two positive integers m and n are c-equivalent in the sense of Vladimir Shevelev, if they have ordinary binary representations with the same multisets of substrings resulting from cutting the full strings immediately before each bit 1. A(n) is defined as the smallest positive integer, which is c-equivalent to n. Alternatively, in the manners of A114994, the lengths of these substrings can be considered as representing ways to write integers as sums of positive integers with arbitrarily ordered sums, and a(n) as the unique integer whose corresponding substring lengths form the corresponding integer partition.
For instance, the ordinary binary representations of 11, 13, and 14 are 1011, 1101, and 1110, respectively, which yields the equal multisets {"10","1","1"}, and {"1","10","1"}, and {"1","1","10"} of strings, respectively; whence 11, 13, and 14 are c-equivalent.
A(n) is an odd number if and only if the substring "1" appears at least once in the multiset. Since this is the case if and only if it also holds for the binary representation of n concatenated with itself, and A233312(n) = a(m) for the number m whose binary representation is this concatenation, we have a(n) == A233312(n) (mod 2) for all n. Moreover, empirical data has suggested that perhaps A233312(n)+1 == A171791(n+1) (mod 2) for all n >= 1. This relation holds in general if and only if a(n)+1 == A171791(n+1) for the same n, which in its turn is true if and only if the relation with fibbinary numbers first empirically observed by Paul D. Hanna in the comments to A171791 holds in general.
The sequence A163382 also maps n to a c-equivalent integer <=n; however, here, only cyclic permutations of the sequences of substrings are allowed. Thus, a more restricted equivalence relation is used; whence a(n) <= A163382(n) for all n. Equality holds for infinitely many n, including n = 1..37.

Examples

			The set of integers c-equivalent to 38 is {37,38,41,44,50,52} (with the binary representations 100101, 100110, 101001, 101100, 110010, and 110100, respectively). The smallest of these numbers is 37. Thus, a(38) = 37. Alternatively, the substrings of 100110_binary = 38 correspond to writing 6 as the sum of 3+1+2, which is a permutation of the partition 6 = 3+2+1, where the right hand side corresponds to 37. (On the other hand, only 41 and 52 may be achieved from 38 by cyclic permutations of the bits, whence A163382(38) = 38.)
		

Crossrefs

A114994 = range(a), A233312(n) = a(A020330(n)).

A321226 Describe the binary representation of n in binary and convert back to decimal.

Original entry on oeis.org

2, 3, 14, 5, 28, 59, 22, 7, 30, 115, 238, 117, 44, 91, 30, 9, 56, 123, 462, 229, 476, 955, 470, 119, 46, 179, 366, 181, 60, 123, 38, 11, 58, 227, 494, 245, 924, 1851, 918, 231, 478, 1907, 3822, 1909, 940, 1883, 478, 233, 88, 187, 718, 357, 732, 1467, 726, 183
Offset: 0

Views

Author

Rémy Sigrist, Nov 10 2018

Keywords

Comments

This sequence is a binary variant of the "Look and Say" sequence A045918.
There is only one fixed point: a(7) = 7.

Examples

			For n = 67:
- the binary representation of 67 is "1000011",
- we see, in binary: "1" "1", "100" "0", "10" "1",
- hence the binary representation of a(67) is "111000101",
- and a(67) = 453 in decimal.
		

Crossrefs

Programs

  • PARI
    a(n, b=2) = if (n==0, return (b)); my (d=digits(b*n, b), v=0, w=0); d[#d] = -1; for (i=1, #d-1, w++; if (d[i]!=d[i+1], v = b*(v*b^#digits(w, b) + w) + d[i]; w = 0)); v

Formula

a(2^n - 1) = 2*n + 1 for any n > 0.
a(4*n + 1) = 4*a(2*n) + 3 for any n > 0.
a(4*n + 2) = 4*a(2*n + 1) + 2 for any n >= 0.
a(A020330(2*n)) = A020330(a(2*n)) for any n > 0.
a(A049190(n)) = A049190(n+1) for any n > 0.

A344259 For any number n with binary expansion (b(1), ..., b(k)), the binary expansion of a(n) is (b(1), ..., b(ceiling(k/2))).

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10
Offset: 0

Views

Author

Rémy Sigrist, May 13 2021

Keywords

Comments

Leading zeros are ignored.

Examples

			The first terms, alongside their binary expansion, are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     1      10          1
   3     1      11          1
   4     2     100         10
   5     2     101         10
   6     3     110         11
   7     3     111         11
   8     2    1000         10
   9     2    1001         10
  10     2    1010         10
  11     2    1011         10
  12     3    1100         11
  13     3    1101         11
  14     3    1110         11
  15     3    1111         11
		

Crossrefs

Programs

  • Mathematica
    Array[FromDigits[First@Partition[l=IntegerDigits[#,2],Ceiling[Length@l/2]],2]&,100,0] (* Giorgos Kalogeropoulos, May 14 2021 *)
  • PARI
    a(n) = n\2^(#binary(n)\2)
    
  • Python
    def a(n): b = bin(n)[2:]; return int(b[:(len(b)+1)//2], 2)
    print([a(n) for n in range(85)]) # Michael S. Branicky, May 14 2021

Formula

a(A020330(n)) = n.
a(A006995(n+1)) = A162751(n).
a(n XOR A344220(n)) = a(n) (where XOR denotes the bitwise XOR operator).
Previous Showing 21-30 of 37 results. Next