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

A320386 a(n) is the smallest positive integer such that the binary representation of n*a(n) is a "binary square" (i.e., a term of A020330).

Original entry on oeis.org

3, 5, 1, 9, 2, 6, 9, 17, 4, 1, 17, 3, 17, 17, 1, 33, 8, 2, 33, 33, 3, 24, 33, 22, 33, 33, 2, 33, 33, 22, 33, 65, 16, 4, 65, 1, 65, 65, 22, 52, 65, 22, 65, 12, 1, 65, 65, 11, 65, 52, 3, 40, 65, 1, 12, 65, 11, 65, 65, 11, 65, 65, 1, 129, 32, 8, 129, 2, 11, 39
Offset: 1

Views

Author

Jeffrey Shallit, Oct 12 2018

Keywords

Comments

a(n) exists because if n has t bits, then (2^t+1)*n is a binary square.

Examples

			a(5) = 2 because 5 is not a binary square, but 5*2 = 10 is (its binary representation is 1010).
		

Crossrefs

Cf. A020330.

Programs

  • Maple
    a:= proc(n) local k; for k while not (s-> (l->
          l::even and s[1..l/2]=s[l/2+1..l])(length(s)))(
          convert(convert(k*n, binary), string)) do od; k
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Oct 12 2018
  • PARI
    is(n) = my(L=#binary(n)\2); n>>L==bitand(n,2^L-1); \\ A020330
    a(n) = my(k=1); while (!is(k*n), k++); k; \\ Michel Marcus, Oct 12 2018

A330157 Decimal expansion of the sum of the reciprocals of A020330.

Original entry on oeis.org

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

Views

Author

Jeffrey Shallit, Dec 03 2019

Keywords

Comments

The sum is 0.67014568628363761... . It can be computed relatively efficiently using a variation of the method of Joseph S. Myers (see link).

Examples

			0.67014568628363761...
		

Crossrefs

Cf. A020330.

A343267 Numbers that are not the sum of four or fewer terms from A020330 (not necessarily distinct).

Original entry on oeis.org

1, 2, 4, 5, 7, 8, 11, 14, 17, 22, 27, 29, 32, 34, 37, 41, 44, 47, 53, 62, 95, 104, 107, 113, 116, 122, 125, 131, 134, 140, 143, 148, 155, 158, 160, 167, 407, 424, 441, 458, 475, 492, 509, 526, 552, 560, 569, 587, 599, 608, 613, 620, 638, 653, 671, 686
Offset: 1

Views

Author

Amiram Eldar, Apr 09 2021

Keywords

Comments

Madhusudan et al. (2018) proved that a(56) = 686 is the last term of this sequence.

Crossrefs

Programs

  • Mathematica
    v = Table[n + n * 2^Floor[Log2[n] + 1], {n, 0, 20}]; Complement[Range[0, 700], Plus @@@ Tuples[v, 4]]

A121016 Numbers whose binary expansion is properly periodic.

Original entry on oeis.org

3, 7, 10, 15, 31, 36, 42, 45, 54, 63, 127, 136, 153, 170, 187, 204, 221, 238, 255, 292, 365, 438, 511, 528, 561, 594, 627, 660, 682, 693, 726, 759, 792, 825, 858, 891, 924, 957, 990, 1023, 2047, 2080, 2145, 2184, 2210, 2275, 2340, 2405, 2457, 2470, 2535
Offset: 1

Views

Author

Jacob A. Siehler, Sep 08 2006

Keywords

Comments

A finite sequence is aperiodic if its cyclic rotations are all different. - Gus Wiseman, Oct 31 2019

Examples

			For example, 204=(1100 1100)_2 and 292=(100 100 100)_2 belong to the sequence, but 30=(11110)_2 cannot be split into repeating periods.
From _Gus Wiseman_, Oct 31 2019: (Start)
The sequence of terms together with their binary expansions and binary indices begins:
   3:         11 ~ {1,2}
   7:        111 ~ {1,2,3}
   10:      1010 ~ {2,4}
   15:      1111 ~ {1,2,3,4}
   31:     11111 ~ {1,2,3,4,5}
   36:    100100 ~ {3,6}
   42:    101010 ~ {2,4,6}
   45:    101101 ~ {1,3,4,6}
   54:    110110 ~ {2,3,5,6}
   63:    111111 ~ {1,2,3,4,5,6}
  127:   1111111 ~ {1,2,3,4,5,6,7}
  136:  10001000 ~ {4,8}
  153:  10011001 ~ {1,4,5,8}
  170:  10101010 ~ {2,4,6,8}
  187:  10111011 ~ {1,2,4,5,6,8}
  204:  11001100 ~ {3,4,7,8}
  221:  11011101 ~ {1,3,4,5,7,8}
  238:  11101110 ~ {2,3,4,6,7,8}
  255:  11111111 ~ {1,2,3,4,5,6,7,8}
  292: 100100100 ~ {3,6,9}
(End)
		

Crossrefs

A020330 is a subsequence.
Numbers whose binary expansion is aperiodic are A328594.
Numbers whose reversed binary expansion is Lyndon are A328596.
Numbers whose binary indices have equal run-lengths are A164707.

Programs

  • Mathematica
    PeriodicQ[n_, base_] := Block[{l = IntegerDigits[n, base]}, MemberQ[ RotateLeft[l, # ] & /@ Most@ Divisors@ Length@l, l]]; Select[ Range@2599, PeriodicQ[ #, 2] &]
  • PARI
    is(n)=n=binary(n);fordiv(#n,d,for(i=1,#n/d-1, for(j=1,d, if(n[j]!=n[j+i*d], next(3)))); return(d<#n)) \\ Charles R Greathouse IV, Dec 10 2013

A302291 a(n) is the period of the binary expansion of n.

Original entry on oeis.org

1, 1, 2, 1, 3, 3, 3, 1, 4, 4, 2, 4, 4, 4, 4, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 6, 6, 6, 6, 3, 6, 6, 6, 6, 6, 2, 6, 6, 3, 6, 6, 6, 6, 6, 6, 6, 6, 3, 6, 6, 6, 6, 6, 6, 6, 6, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
Offset: 0

Views

Author

Rémy Sigrist, Apr 04 2018

Keywords

Comments

Zero is assumed to be represented as 0; otherwise, leading zeros are ignored.
See A302295 for the variant where leading zeros are allowed.

Examples

			The first terms, alongside the binary expansion of n with periodic part in parentheses, are:
  n  a(n)    bin(n)
  -- ----    ------
   0    1    (0)
   1    1    (1)
   2    2    (10)
   3    1    (1)(1)
   4    3    (100)
   5    3    (101)
   6    3    (110)
   7    1    (1)(1)(1)
   8    4    (1000)
   9    4    (1001)
  10    2    (10)(10)
  11    4    (1011)
  12    4    (1100)
  13    4    (1101)
  14    4    (1110)
  15    1    (1)(1)(1)(1)
  16    5    (10000)
  17    5    (10001)
  18    5    (10010)
  19    5    (10011)
  20    5    (10100)
		

Crossrefs

Aperiodic compositions are counted by A000740.
Aperiodic binary words are counted by A027375.
The orderless period of prime indices is A052409.
Numbers whose binary expansion is periodic are A121016.
Periodic compositions are counted by A178472.
Numbers whose prime signature is aperiodic are A329139.
Compositions by number of distinct rotations are A333941.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Necklaces are A065609.
- Sum is A070939.
- Runs are counted by A124767.
- Rotational symmetries are counted by A138904.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Lyndon compositions are A275692.
- Co-Lyndon compositions are A326774.
- Aperiodic compositions are A328594.
- Rotational period is A333632.
- Co-necklaces are A333764.
- Reversed necklaces are A333943.

Programs

  • Mathematica
    Table[If[n==0,1,Length[Union[Array[RotateRight[IntegerDigits[n,2],#]&,IntegerLength[n,2]]]]],{n,0,50}] (* Gus Wiseman, Apr 19 2020 *)
  • PARI
    a(n) = my (l=max(1, #binary(n))); fordiv (l, w, if (#Set(digits(n, 2^w))<=1, return (w)))

Formula

a(n) = A070939(n) / A138904(n).
a(2^n) = n + 1 for any n >= 0.
a(2^n - 1) = 1 for any n >= 0.
a(A020330(n)) = a(n) for any n > 0.

A020331 Numbers whose base-3 representation is the juxtaposition of two identical strings.

Original entry on oeis.org

4, 8, 30, 40, 50, 60, 70, 80, 252, 280, 308, 336, 364, 392, 420, 448, 476, 504, 532, 560, 588, 616, 644, 672, 700, 728, 2214, 2296, 2378, 2460, 2542, 2624, 2706, 2788, 2870, 2952, 3034, 3116, 3198, 3280, 3362, 3444, 3526, 3608, 3690, 3772, 3854, 3936, 4018
Offset: 1

Views

Author

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

Keywords

Examples

			50_10 = 1212_3. - _Jon E. Schoenfield_, Feb 11 2021
		

Crossrefs

Programs

  • Mathematica
    b3iQ[n_]:=Module[{idn3=IntegerDigits[n,3],len},len=Length[idn3];EvenQ[ len] && Take[idn3,len/2]==Take[idn3,-len/2 ]]; Select[Range[5000],b3iQ] (* Harvey P. Dale, Feb 08 2015 *)
    a[n_] := n + n*3^Floor[Log[3, n] + 1]; Array[a, 50] (* Amiram Eldar, Apr 06 2021 *)

Formula

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

A020332 Numbers whose base-4 representation is the juxtaposition of two identical strings.

Original entry on oeis.org

5, 10, 15, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255, 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
Offset: 1

Views

Author

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

Keywords

Examples

			102_10 = 1212_4. - _Jon E. Schoenfield_, Feb 11 2021
		

Crossrefs

Programs

  • Mathematica
    a[n_] := n + n*4^Floor[Log[4, n] + 1]; Array[a, 50] (* Amiram Eldar, Apr 06 2021 *)
    b4jQ[n_]:=Module[{idn4=IntegerDigits[n,4],len},len=Length[idn4];EvenQ[len] && Take[ idn4,len/2]==Take[idn4,-len/2]]; Select[Range[3000],b4jQ] (* or *) Table[If[ #[[1]] == 0,Nothing,FromDigits[#,4]]&/@(Flatten[Join[{#,#}]]&/@Tuples[ {0,1,2,3},n]),{n,3}]//Flatten(* Harvey P. Dale, Sep 02 2022 *)

Formula

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

A020333 Numbers whose base-5 representation is the juxtaposition of two identical strings.

Original entry on oeis.org

6, 12, 18, 24, 130, 156, 182, 208, 234, 260, 286, 312, 338, 364, 390, 416, 442, 468, 494, 520, 546, 572, 598, 624, 3150, 3276, 3402, 3528, 3654, 3780, 3906, 4032, 4158, 4284, 4410, 4536, 4662, 4788, 4914, 5040, 5166, 5292, 5418, 5544, 5670, 5796, 5922, 6048
Offset: 1

Views

Author

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

Keywords

Examples

			182_10 = 1212_5. - _Jon E. Schoenfield_, Feb 11 2021
		

Crossrefs

Programs

  • Mathematica
    tis5Q[n_]:=Module[{idn=IntegerDigits[n,5],len},len=Length[idn];EvenQ[len] && Take[idn,len/2]==Take[idn,-len/2]]; Select[Range[6500],tis5Q]  (* or *) Flatten[Table[FromDigits[#,5]&/@Select[(Flatten[{#,#}]&/@Tuples[ Range[ 0,4],n]),#[[1]]!=0&],{n,3}]] (* The second program is significantly faster than the first. *) (* Harvey P. Dale, Apr 08 2013 *)
    a[n_] := n + n*5^Floor[Log[5, n] + 1]; Array[a, 50] (* Amiram Eldar, Apr 06 2021 *)
  • Python
    from itertools import count, product
    def agen():
        for d in count(1):
            for first in "1234":
                for p in product("01234", repeat=d-1):
                    yield int((first+"".join(p))*2, 5)
    g = agen()
    print([next(g) for n in range(1, 49)]) # Michael S. Branicky, Jun 12 2021

Formula

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

A020334 Numbers whose base-6 representation is the juxtaposition of two identical strings.

Original entry on oeis.org

7, 14, 21, 28, 35, 222, 259, 296, 333, 370, 407, 444, 481, 518, 555, 592, 629, 666, 703, 740, 777, 814, 851, 888, 925, 962, 999, 1036, 1073, 1110, 1147, 1184, 1221, 1258, 1295, 7812, 8029, 8246, 8463, 8680, 8897, 9114, 9331, 9548, 9765, 9982, 10199, 10416
Offset: 1

Views

Author

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

Keywords

Examples

			296_10 = 1212_6. - _Jon E. Schoenfield_, Feb 11 2021
		

Crossrefs

Programs

  • Mathematica
    jtiQ[n_]:=Module[{idn6=IntegerDigits[n,6],len},len=Length[idn6];EvenQ[ len] && Take[idn6,len/2]==Take[idn6,(-len/2)]]; Select[ Range[ 11000], jtiQ] (* Harvey P. Dale, May 29 2016 *)
    a[n_] := n + n*6^Floor[Log[6, n] + 1]; Array[a, 50] (* Amiram Eldar, Apr 06 2021 *)

Formula

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

A020335 Numbers whose base-7 representation is the juxtaposition of two identical strings.

Original entry on oeis.org

8, 16, 24, 32, 40, 48, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200, 1250, 1300, 1350, 1400, 1450, 1500, 1550, 1600, 1650, 1700, 1750, 1800, 1850, 1900, 1950, 2000, 2050, 2100, 2150, 2200, 2250, 2300, 2350
Offset: 1

Views

Author

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

Keywords

Examples

			450_10 = 1212_7. - _Jon E. Schoenfield_, Feb 12 2021
		

Crossrefs

Programs

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

Formula

a(n) = n*7^floor(log_7(n)+1) + n. - Ilya Gutkovskiy, Jan 26 2018
Previous Showing 11-20 of 37 results. Next