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-6 of 6 results.

A092246 Odd "odious" numbers (A000069).

Original entry on oeis.org

1, 7, 11, 13, 19, 21, 25, 31, 35, 37, 41, 47, 49, 55, 59, 61, 67, 69, 73, 79, 81, 87, 91, 93, 97, 103, 107, 109, 115, 117, 121, 127, 131, 133, 137, 143, 145, 151, 155, 157, 161, 167, 171, 173, 179, 181, 185, 191, 193, 199, 203, 205, 211, 213, 217, 223, 227, 229, 233
Offset: 1

Views

Author

Benoit Cloitre, Feb 23 2004

Keywords

Comments

In other words, numbers having a binary representation ending in 1, and an odd number of 1's overall. It follows that by decrementing an odd odious number, one gets an even evil number (A125592). - Ralf Stephan, Aug 27 2013
The members of the sequence may be called primitive odious numbers because every odious number is a power of 2 times one of these numbers. Note that the difference between consecutive terms is either 2, 4, or 6. - T. D. Noe, Jun 06 2007
From Gary W. Adamson, Apr 06 2010: (Start)
a(n) = A026147(n)-th odd number, where A026147 = (1, 4, 6, 7, 10, 11, ...); e.g.,
n: 1 2 3 4 5 6 7 8 9 10 11
n-th odd: 1 3 5 7 9 11 13 15 17 19 21
a(n): 1 7 11 13 19 21
etc. (End)
Numbers m, such that when merge-sorting lists of length m, the maximal number of comparisons is even: A003071(a(n)) = A230720(n). - Reinhard Zumkeller, Oct 28 2013
Fixed points of permutation pair A268717/A268718. - Antti Karttunen, Feb 29 2016

Crossrefs

Cf. A230709 (complement).

Programs

  • Haskell
    a092246 n = a092246_list !! (n - 1)
    a092246_list = filter odd a000069_list
    -- Reinhard Zumkeller, Oct 28 2013
    
  • Mathematica
    Table[If[n < 1, 0, 2 n - 1 - Mod[First@ DigitCount[n - 1, 2], 2]], {n, 120}] /. n_ /; EvenQ@ n -> Nothing (* Michael De Vlieger, Feb 29 2016 *)
    Select[Range[1, 1001, 2], OddQ[Total[IntegerDigits[#, 2]]]&] (* Jean-François Alcover, Mar 15 2016 *)
  • PARI
    is(n)=n%2&&hammingweight(n)%2 \\ Charles R Greathouse IV, Mar 21 2013
    
  • PARI
    a(n)=4*n-if(hammingweight(n-1)%2,1,3) \\ Charles R Greathouse IV, Mar 22 2013
    
  • Python
    def A092246(n): return (n<<2)-(1 if (n-1).bit_count()&1 else 3) # Chai Wah Wu, Mar 03 2023

Formula

a(n) = 4*n + 2*A010060(n-1) - 3;
a(n) = 2*A001969(n-1) + 1.

A228495 Characteristic function of the odd odious numbers (A092246).

Original entry on oeis.org

0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0
Offset: 0

Views

Author

Ralf Stephan, Aug 23 2013

Keywords

Comments

The following sequences all appear to have the same parity: A003071, A029886, A061297, A092524, A093431, A102393, A104258, A122248, A128975. - Jeremy Gardiner, Dec 28 2008.
a(n+1) is the characteristic function of the even evil numbers (A125592). - Jeremy Gardiner, Feb 06 2015

Crossrefs

Programs

  • Mathematica
    a[n_] := If[OddQ[n] && OddQ[DigitCount[n, 2, 1]], 1, 0]; Array[a, 100, 0] (* Amiram Eldar, Aug 06 2023 *)
  • PARI
    a(n)=if(n%2==0,0,subst(Pol(binary((n-1)/2)),x,1)%2==0)
    
  • PARI
    A228495(n) = ((n%2)&&(hammingweight(n)%2)); \\ Antti Karttunen, Jan 12 2019
    
  • Python
    def A228495(n): return n.bit_count()&1&n # Chai Wah Wu, Mar 03 2023

Formula

a(2n) = 0, a(2n+1) = A092436(n).
a(n) = A000035(n) * A010060(n). - Antti Karttunen, Jan 12 2019

A367803 Exponentially evil squares.

Original entry on oeis.org

1, 64, 729, 1024, 4096, 15625, 46656, 59049, 117649, 262144, 531441, 746496, 1000000, 1048576, 1771561, 2985984, 3779136, 4826809, 7529536, 9765625, 11390625, 16000000, 16777216, 24137569, 34012224, 47045881, 60466176, 64000000, 85766121, 113379904, 120472576, 148035889
Offset: 1

Views

Author

Amiram Eldar, Dec 01 2023

Keywords

Comments

Numbers whose prime factorization contains only exponents that are even evil numbers (A125592).
Also, squares of exponentially evil numbers (A262675).
Also, numbers with an equal number of exponentially odious and exponentially evil divisors, i.e., numbers k such that A366901(k) = A366902(k). - Amiram Eldar, Feb 26 2024

Crossrefs

Intersection of A000290 and A262675.

Programs

  • Mathematica
    evilQ[n_] := EvenQ[DigitCount[n, 2, 1]]; Select[Range[10^4]^2, #== 1 || AllTrue[FactorInteger[#][[;;, 2]], evilQ] &]
  • PARI
    isexpevil(n) = {my(f = factor(n)); for (i = 1, #f~, if(hammingweight(f[i, 2])%2, return (0))); 1;}
    is(n) = issquare(n) && isexpevil(n);

Formula

a(n) = A262675(n)^2.
Sum_{n>=1} 1/a(n) = Product_{p prime} (1 + Sum_{k>=1} 1/p^A125592(k)) = Product_{p prime} f(1/p) = 1.01833932269003592136..., where f(x) = (2/(1-x^2) + Product_{k>=0} (1 - x^(2^k)) + Product_{k>=0} (1 - (-x)^(2^k)))/4.

A375850 The maximum even exponent in the prime factorization of n!, or 0 if no such exponent exists.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 4, 4, 2, 4, 8, 8, 10, 10, 2, 6, 6, 6, 16, 16, 18, 18, 4, 4, 22, 22, 10, 6, 6, 6, 26, 26, 14, 4, 32, 32, 34, 34, 8, 18, 38, 38, 6, 6, 6, 10, 42, 42, 46, 46, 22, 12, 12, 12, 50, 50, 26, 4, 54, 54, 56, 56, 28, 30, 30, 30, 64, 64, 66, 66, 32, 32, 70
Offset: 0

Views

Author

Amiram Eldar, Aug 31 2024

Keywords

Comments

The sequence of indices of record values, 0, 6, 10, 12, 18, 20, 24, 30, 34, 36, 40, ..., are the evil numbers (A001969) multiplied by 2 (A125592).

Crossrefs

Programs

  • Mathematica
    a[n_] := Max[0, Max[Select[FactorInteger[n!][[;; , 2]], EvenQ]]]; Array[a, 100, 0]
  • PARI
    a(n) = {my(e = select(x -> !(x % 2), factor(n!)[, 2])); if(#e == 0, 0, vecmax(e));}
    
  • Python
    from collections import Counter
    from sympy import factorint
    def A375850(n): return max(filter(lambda x: x&1^1,sum((Counter(factorint(i)) for i in range(2,n+1)),start=Counter()).values()),default=0) # Chai Wah Wu, Aug 31 2024

Formula

a(n) = A375033(n!).
max(a(n), A375849(n)) = A011371(n).

A084682 Even evil numbers with an even digital sum.

Original entry on oeis.org

0, 6, 20, 24, 40, 46, 48, 60, 66, 68, 80, 86, 114, 116, 130, 132, 136, 150, 154, 156, 170, 172, 178, 190, 192, 198, 202, 204, 222, 226, 228, 240, 246, 260, 264, 282, 284, 288, 312, 318, 330, 332, 338, 350, 354, 356, 374, 378, 390, 394, 396, 402, 404, 408, 420
Offset: 1

Views

Author

Jason Earls, Jun 30 2003

Keywords

Crossrefs

Cf. A001969.
Intersection of A054683 and A125592.

Programs

  • Maple
    filter:= n -> convert(convert(n,base,2),`+`)::even and convert(convert(n,base,10),`+`)::even:
    select(filter, [seq(i,i=2..10000,2)]); # Robert Israel, Dec 31 2024
  • Mathematica
    eee[n_] :=  And @@ EvenQ /@ {n, Count[IntegerDigits[n, 2], 1], Total[IntegerDigits[n]]};
    Select[Range[0, 420], eee] (* Jake L Lande, Jun 30 2024 *)
  • PARI
    is(n)={ bitand(n,1)==0 && bitand(sumdigits(n),1)==0 && bitand(hammingweight(n),1)==0 }
    select(is, [0..500]) \\ Joerg Arndt, Jun 30 2024

Extensions

Offset changed by Andrew Howroyd, Sep 18 2024

A348416 For n >= 1; a(n) = gcd(n,w(n)) where w(n) is the binary weight of n, A000120(n).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 3, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 5, 1, 1, 2, 1, 4, 1, 1, 3, 1, 1, 2, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 3, 1, 1, 3
Offset: 1

Views

Author

Ctibor O. Zizka, Oct 19 2021

Keywords

Comments

a(n) is even for n in A125592, a(n) = 1 for n in A094387.

Examples

			n = 6; gcd(6, A000120(6)) = 2, thus a(6) = 2.
		

Crossrefs

Programs

  • Mathematica
    Array[GCD[#, Total@ IntegerDigits[#, 2]] &, 105] (* Michael De Vlieger, Oct 19 2021 *)
  • PARI
    a(n) = gcd(n, hammingweight(n)); \\ Michel Marcus, Oct 19 2021

Formula

a(n) = gcd(n, A000120(n)).
a(n) = A000120(n) if and only if n is in A049445. - Amiram Eldar, Oct 19 2021
Showing 1-6 of 6 results.