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.

Showing 1-10 of 33 results. Next

A351172 Natural numbers that can be written as the quotient of two antipalindromic numbers (A035928).

Original entry on oeis.org

1, 5, 6, 15, 17, 18, 19, 20, 21, 24, 26, 28, 51, 59, 61, 63, 65, 66, 67, 68, 69, 70, 71, 72, 74, 75, 78, 82, 83, 84, 85, 87, 89, 92, 94, 96, 102, 106, 116, 120, 191, 195, 203, 211, 219, 221, 231, 233, 235, 239, 243, 245, 247, 249, 251, 253, 255, 257, 258, 260
Offset: 1

Views

Author

Jeffrey Shallit, Feb 04 2022

Keywords

Examples

			18 belongs to the sequence because 18 = 936/52, and the base-2 representation of 936 is 1110101000, while the base-2 representation of 52 is 110100, both antipalindromes.
		

Crossrefs

Cf. A035928. Complement of A351173.

A278465 Numbers that are the sum of one or two terms of A035928.

Original entry on oeis.org

2, 4, 10, 12, 14, 20, 22, 24, 38, 40, 42, 44, 48, 50, 52, 54, 56, 58, 62, 64, 66, 68, 76, 80, 84, 90, 94, 98, 104, 108, 112, 142, 144, 150, 152, 154, 160, 162, 170, 172, 178, 180, 182, 184, 188, 190, 192, 194, 198, 202, 204, 206, 208, 212, 214, 216, 220, 222, 224, 226, 230, 232, 234, 240, 242, 244, 246, 250, 252, 254, 256, 260
Offset: 1

Views

Author

Jeffrey Shallit, Nov 22 2016

Keywords

Crossrefs

Cf. A035928.

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    bcr:= proc(n) local L,m;
      L:= convert(n,base,2);
      m:= nops(L);
      add((1-L[i])*2^(m-i),i=1..m)
    end proc:
    A035928:= select(`<=`,{seq(seq(x*2^d + bcr(x), x=2^(d-1)..2^d-1),d=1..(ilog2(N)+1)/2)},N):
    sort(convert(A035928 union {seq(seq(A035928[i]+t, t = select(`<=`,A035928[i..-1], N-A035928[i])),i=1..nops(A035928))},list)); # Robert Israel, Nov 23 2016
  • Mathematica
    max = 1000;
    bcrQ[n_] := Module[{idn2 = IntegerDigits[n, 2]}, Reverse[idn2 /. {1 -> 0, 0 -> 1}] == idn2];
    A035928 = Select[Range[max], bcrQ];
    Union[Total /@ Tuples[A035928, 2], A035928] // Select[#, # <= max&]& (* Jean-François Alcover, Jul 29 2020, after Harvey P. Dale in A035928 *)

A318569 a(n) is the smallest positive integer such that n*a(n) is a "binary antipalindrome" (i.e., an element of A035928).

Original entry on oeis.org

2, 1, 4, 3, 2, 2, 6, 7, 62, 1, 62, 1, 4, 3, 10, 15, 10, 31, 2, 12, 2, 31, 26, 10, 6, 2, 116, 2, 8, 5, 18, 31, 254, 5, 78, 26, 18, 1, 24, 6, 18, 1, 70, 86, 11894, 13, 254, 5, 46, 3, 4, 1, 4, 58, 264, 1, 850, 4, 162, 4, 16, 9, 34, 63, 38, 127, 56, 3, 42, 39, 2
Offset: 1

Views

Author

Jeffrey Shallit, Oct 12 2018

Keywords

Comments

a(n) exists: write n = r*2^i, where r is odd. Then r divides 2^phi(r) - 1, where phi is the Euler phi function. Choose k such that k phi(r) >= i.
Then n divides (2^{k*phi(r)} - 1)*2^{k*phi(r)}, which is a binary antipalindrome.

Crossrefs

Programs

  • PARI
    See Links section.
    
  • Python
    def comp(s): z, o = ord('0'), ord('1'); return s.translate({z:o, o:z})
    def BCR(n): return int(comp(bin(n)[2:])[::-1], 2)
    def a(n):
        kn = n
        while BCR(kn) != kn: kn += n
        return kn//n
    print([a(n) for n in range(1, 72)]) # Michael S. Branicky, Mar 20 2022

A342582 a(n) is the least multiple of n that is a "binary antipalindrome" (i.e., an element of A035928).

Original entry on oeis.org

2, 2, 12, 12, 10, 12, 42, 56, 558, 10, 682, 12, 52, 42, 150, 240, 170, 558, 38, 240, 42, 682, 598, 240, 150, 52, 3132, 56, 232, 150, 558, 992, 8382, 170, 2730, 936, 666, 38, 936, 240, 738, 42, 3010, 3784, 535230, 598, 11938, 240, 2254, 150, 204, 52, 212, 3132
Offset: 1

Views

Author

Rémy Sigrist, Mar 15 2021

Keywords

Comments

This sequence has similarities with A141709.

Examples

			For n = 42:
- 42 is a binary antipalindrome,
- so a(42) = 42.
		

Crossrefs

Programs

  • PARI
    See Links section.
    
  • Python
    def comp(s): z, o = ord('0'), ord('1'); return s.translate({z:o, o:z})
    def BCR(n): return int(comp(bin(n)[2:])[::-1], 2)
    def bin_anti_pal(n): return BCR(n) == n
    def a(n):
        kn = n
        while not bin_anti_pal(kn): kn += n
        return kn
    print([a(n) for n in range(1, 55)]) # Michael S. Branicky, Mar 15 2021

Formula

a(n) = n * A318569(n).

A351173 Natural numbers that cannot be represented as the quotient of two antipalindromic numbers (A035928).

Original entry on oeis.org

2, 3, 4, 7, 8, 9, 10, 11, 12, 13, 14, 16, 22, 23, 25, 27, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 53, 54, 55, 56, 57, 58, 60, 62, 64, 73, 76, 77, 79, 80, 81, 86, 88, 90, 91, 93, 95, 97, 98, 99, 100, 101, 103
Offset: 1

Views

Author

Jeffrey Shallit, Feb 04 2022

Keywords

Crossrefs

Cf. A035928. Complement of A351172.

A351175 Natural numbers k such that there are infinitely many representations k = A/B with A, B in A035928.

Original entry on oeis.org

1, 6, 15, 18, 19, 20, 24, 28, 51, 59, 61, 63, 66, 67, 68, 71, 72, 74, 75, 78, 82, 83, 84, 87, 94, 96, 120, 191, 195, 203, 211, 231, 235, 243, 247, 251, 253, 255, 258, 260, 262, 263, 264, 265, 266, 267, 271, 272, 274, 275, 278, 279, 285, 288, 292, 293, 298, 299
Offset: 1

Views

Author

Jeffrey Shallit, Feb 04 2022

Keywords

Comments

This sequence and A351176 form a disjoint partition of A351172.

Crossrefs

A278546 Even numbers that cannot be expressed as a sum of 3 or fewer terms of A035928.

Original entry on oeis.org

8, 18, 28, 130, 134, 138, 148, 158, 176, 318, 530, 538, 548, 576, 644, 1300, 2170, 2202, 2212, 2228, 2230, 2248, 8706, 8938, 8948, 34970, 35082
Offset: 1

Views

Author

Jeffrey Shallit, Nov 23 2016

Keywords

Comments

This is conjectured to be the complete list. There are no other examples smaller than 16773120.

Crossrefs

Programs

  • Mathematica
    nn = 10^5; Complement[Range[2, nn, 2], Union@ Map[Total, Rest@ Tuples[{0}~Join~#, 3]] &@ Select[Range@ nn, Function[k, Reverse[# /. {1 -> 0, 0 -> 1}] == # &@ IntegerDigits[k, 2]]]] (* Michael De Vlieger, Nov 23 2016, after Harvey P. Dale at A035928 *)

A351325 Numbers k with exactly one solution to the equation A = B*k, where A and B are antipalindromic numbers (members of A035928).

Original entry on oeis.org

5, 21, 26, 69, 85, 89, 92, 102, 106, 116, 219, 221, 233, 239, 245, 249, 261, 269, 276, 284, 291, 301, 306, 319, 323, 324, 333, 341, 344, 356, 361, 364, 369, 426, 434, 460, 468, 488, 843, 869, 879, 919, 925, 971, 981, 997, 1015, 1042, 1044, 1046, 1052, 1053
Offset: 1

Views

Author

Jeffrey Shallit, Feb 07 2022

Keywords

Examples

			For k = 233 we have A = 8532926, B = 36622, which is the only solution in antipalindromes.
		

Crossrefs

A000740 Number of 2n-bead balanced binary necklaces of fundamental period 2n, equivalent to reversed complement; also Dirichlet convolution of b_n=2^(n-1) with mu(n); also number of components of Mandelbrot set corresponding to Julia sets with an attractive n-cycle.

Original entry on oeis.org

1, 1, 3, 6, 15, 27, 63, 120, 252, 495, 1023, 2010, 4095, 8127, 16365, 32640, 65535, 130788, 262143, 523770, 1048509, 2096127, 4194303, 8386440, 16777200, 33550335, 67108608, 134209530, 268435455, 536854005, 1073741823, 2147450880
Offset: 1

Views

Author

Keywords

Comments

Also number of compositions of n into relatively prime parts (that is, the gcd of all the parts is 1). Also number of subsets of {1,2,..,n} containing n and consisting of relatively prime numbers. - Vladeta Jovovic, Aug 13 2003
Also number of perfect parity patterns that have exactly n columns (see A118141). - Don Knuth, May 11 2006
a(n) is odd if and only if n is squarefree (Tim Keller). - Emeric Deutsch, Apr 27 2007
a(n) is a multiple of 3 for all n>=3 (see Problem 11161 link). - Emeric Deutsch, Aug 13 2008
Row sums of triangle A143424. - Gary W. Adamson, Aug 14 2008
a(n) is the number of monic irreducible polynomials with nonzero constant coefficient in GF(2)[x] of degree n. - Michel Marcus, Oct 30 2016
a(n) is the number of aperiodic compositions of n, the number of compositions of n with relatively prime parts, and the number of compositions of n with relatively prime run-lengths. - Gus Wiseman, Dec 21 2017

Examples

			For n=4, there are 6 compositions of n into coprime parts: <3,1>, <2,1,1>, <1,3>, <1,2,1>, <1,1,2>, and <1,1,1,1>.
From _Gus Wiseman_, Dec 19 2017: (Start)
The a(6) = 27 aperiodic compositions are:
  (11112), (11121), (11211), (12111), (21111),
  (1113), (1122), (1131), (1221), (1311), (2112), (2211), (3111),
  (114), (123), (132), (141), (213), (231), (312), (321), (411),
  (15), (24), (42), (51),
  (6).
The a(6) = 27 compositions into relatively prime parts are:
  (111111),
  (11112), (11121), (11211), (12111), (21111),
  (1113), (1122), (1131), (1212), (1221), (1311), (2112), (2121), (2211), (3111),
  (114), (123), (132), (141), (213), (231), (312), (321), (411),
  (15), (51).
The a(6) = 27 compositions with relatively prime run-lengths are:
  (11112), (11121), (11211), (12111), (21111),
  (1113), (1131), (1212), (1221), (1311), (2112), (2121), (3111),
  (114), (123), (132), (141), (213), (231), (312), (321), (411),
  (15), (24), (42), (51),
  (6).
(End)
		

References

  • H. O. Peitgen and P. H. Richter, The Beauty of Fractals, Springer-Verlag; contribution by A. Douady, p. 165.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Equals A027375/2.
See A056278 for a variant.
First differences of A085945.
Column k=2 of A143325.
Row sums of A101391.

Programs

  • Maple
    with(numtheory): a[1]:=1: a[2]:=1: for n from 3 to 32 do div:=divisors(n): a[n]:=2^(n-1)-sum(a[n/div[j]],j=2..tau(n)) od: seq(a[n],n=1..32); # Emeric Deutsch, Apr 27 2007
    with(numtheory); A000740:=n-> add(mobius(n/d)*2^(d-1), d in divisors(n)); # N. J. A. Sloane, Oct 18 2012
  • Mathematica
    a[n_] := Sum[ MoebiusMu[n/d]*2^(d - 1), {d, Divisors[n]}]; Table[a[n], {n, 1, 32}] (* Jean-François Alcover, Feb 03 2012, after PARI *)
  • PARI
    a(n) = sumdiv(n,d,moebius(n/d)*2^(d-1))
    
  • Python
    from sympy import mobius, divisors
    def a(n): return sum([mobius(n // d) * 2**(d - 1) for d in divisors(n)])
    [a(n) for n in range(1, 101)]  # Indranil Ghosh, Jun 28 2017

Formula

a(n) = Sum_{d|n} mu(n/d)*2^(d-1), Mobius transform of A011782. Furthermore, Sum_{d|n} a(d) = 2^(n-1).
a(n) = A027375(n)/2 = A038199(n)/2.
a(n) = Sum_{k=0..n} A051168(n,k)*k. - Max Alekseyev, Apr 09 2013
Recurrence relation: a(n) = 2^(n-1) - Sum_{d|n,d>1} a(n/d). (Lafayette College Problem Group; see the Maple program and Iglesias eq (6)). - Emeric Deutsch, Apr 27 2007
G.f.: Sum_{k>=1} mu(k)*x^k/(1 - 2*x^k). - Ilya Gutkovskiy, Oct 24 2018
G.f. satisfies Sum_{n>=1} A( (x/(1 + 2*x))^n ) = x. - Paul D. Hanna, Apr 02 2025

Extensions

Connection with Mandelbrot set discovered by Warren D. Smith and proved by Robert Munafo, Feb 06 2000
Ambiguous term a(0) removed by Max Alekseyev, Jan 02 2012

A036044 BCR(n): write in binary, complement, reverse.

Original entry on oeis.org

1, 0, 2, 0, 6, 2, 4, 0, 14, 6, 10, 2, 12, 4, 8, 0, 30, 14, 22, 6, 26, 10, 18, 2, 28, 12, 20, 4, 24, 8, 16, 0, 62, 30, 46, 14, 54, 22, 38, 6, 58, 26, 42, 10, 50, 18, 34, 2, 60, 28, 44, 12, 52, 20, 36, 4, 56, 24, 40, 8, 48, 16, 32, 0, 126, 62, 94, 30, 110, 46, 78, 14, 118, 54, 86
Offset: 0

Views

Author

Keywords

Comments

a(0) could be considered to be 0 if the binary representation of zero were chosen to be the empty string. - Jason Kimberley, Sep 19 2011
From Bernard Schott, Jun 15 2021: (Start)
Except for a(0) = 1, every term is even.
For each q >= 0, there is one and only one odd number h such that a(n) = 2*q iff n = h*2^m-1 for m >= 1 when q = 0, and for m >= 0 when q >= 1 (see A345401 and some examples below).
a(n) = 0 iff n = 2^m-1 for m >= 1 (Mersenne numbers) (A000225).
a(n) = 2 iff n = 3*2^m-1 for m >= 0 (A153893).
a(n) = 4 iff n = 7*2^m-1 for m >= 0 (A086224).
a(n) = 6 iff n = 5*2^m-1 for m >= 0 (A153894).
a(n) = 8 iff n = 15*2^m-1 for m >= 0 (A196305).
a(n) = 10 iff n = 11*2^m-1 for m >= 0 (A086225).
a(n) = 12 iff n = 13*2^m-1 for m >= 0 (A198274).
For k >= 1, a(n) = 2^k iff n = (2^(k+1)-1)*2^m - 1 for m >= 0.
Explanation for a(n) = 2:
For m >= 0, A153893(m) = 3*2^m-1 -> 1011...11 -> 0100...00 -> 10 -> 2 where 1011...11_2 is 10 followed by m 1's. (End)

Examples

			4 -> 100 -> 011 -> 110 -> 6.
		

Crossrefs

Cf. A035928 (fixed points), A195063, A195064, A195065, A195066.
Indices of terms 0, 2, 4, 6, 8, 10, 12, 14, 18, 22, 26, 30: A000225 \ {0}, A153893, A086224, A153894, A196305, A086225, A198274, A052996\{1,3}, A291557, A198276, A171389, A198275.

Programs

  • Haskell
    import Data.List (unfoldr)
    a036044 0 = 1
    a036044 n = foldl (\v d -> 2 * v + d) 0 (unfoldr bc n) where
       bc 0 = Nothing
       bc x = Just (1 - m, x') where (x',m) = divMod x 2
    -- Reinhard Zumkeller, Sep 16 2011
    
  • Magma
    A036044:=func; // Jason Kimberley, Sep 19 2011
    
  • Maple
    A036044 := proc(n)
        local bcr ;
        if n = 0 then
            return 1;
        end if;
        convert(n,base,2) ;
        bcr := [seq(1-i,i=%)] ;
        add(op(-k,bcr)*2^(k-1),k=1..nops(bcr)) ;
    end proc:
    seq(A036044(n),n=0..200) ; # R. J. Mathar, Nov 06 2017
  • Mathematica
    dtn[ L_ ] := Fold[ 2#1+#2&, 0, L ]; f[ n_ ] := dtn[ Reverse[ 1-IntegerDigits[ n, 2 ] ] ]; Table[ f[ n ], {n, 0, 100} ]
    Table[FromDigits[Reverse[IntegerDigits[n,2]/.{1->0,0->1}],2],{n,0,80}] (* Harvey P. Dale, Mar 08 2015 *)
  • PARI
    a(n)=fromdigits(Vecrev(apply(n->1-n,binary(n))),2) \\ Charles R Greathouse IV, Apr 22 2015
    
  • Python
    def comp(s): z, o = ord('0'), ord('1'); return s.translate({z:o, o:z})
    def BCR(n): return int(comp(bin(n)[2:])[::-1], 2)
    print([BCR(n) for n in range(75)]) # Michael S. Branicky, Jun 14 2021
    
  • Python
    def A036044(n): return -int((s:=bin(n)[-1:1:-1]),2)-1+2**len(s) # Chai Wah Wu, Feb 04 2022

Formula

a(2n) = 2*A059894(n), a(2n+1) = a(2n) - 2^floor(log_2(n)+1). - Ralf Stephan, Aug 21 2003
Conjecture: a(n) = (-1)^A023416(n)*b(n) for n > 0 with a(0) = 1 where b(2^m) = (-1)^m*(2^(m+1) - 2) for m >= 0, b(2n+1) = b(n) for n > 0, b(2n) = b(n) + b(n - 2^f(n)) + b(2n - 2^f(n)) for n > 0 and where f(n) = A007814(n) (see A329369). - Mikhail Kurkov, Dec 13 2024
Showing 1-10 of 33 results. Next