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 22 results. Next

A366901 The number of exponentially odious divisors of n.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 3, 3, 4, 2, 6, 2, 4, 4, 4, 2, 6, 2, 6, 4, 4, 2, 6, 3, 4, 3, 6, 2, 8, 2, 4, 4, 4, 4, 9, 2, 4, 4, 6, 2, 8, 2, 6, 6, 4, 2, 8, 3, 6, 4, 6, 2, 6, 4, 6, 4, 4, 2, 12, 2, 4, 6, 4, 4, 8, 2, 6, 4, 8, 2, 9, 2, 4, 6, 6, 4, 8, 2, 8, 4, 4, 2, 12, 4, 4, 4
Offset: 1

Views

Author

Amiram Eldar, Oct 27 2023

Keywords

Comments

First differs from A049599 and A282446 at n = 32, from A365551 at n = 64, and from A353898 at n = 128.
The number of divisors of n that are exponentially odious numbers (A270428), i.e., numbers having only odious (A000069) exponents in their canonical prime factorization.
The sum of these divisors is A366903(n) and the largest of them is A366905(n).

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := Floor[e/2] + If[OddQ[e] || EvenQ[DigitCount[e + 1, 2, 1]], 1, 0] + 1; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
  • PARI
    s(n) = 1 + n\2 + (n%2 || hammingweight(n+1)%2==0); \\ after Charles R Greathouse IV at A115384
    a(n) = vecprod(apply(x -> s(x), factor(n)[, 2]));

Formula

Multiplicative with a(p^e) = A115384(e) + 1.
a(n) <= A000005(n), with equality if and only if n is a cubefree number (A004709).

A076826 a(n) = 2*(Sum_{k=0..n} A010060(k)) - n, where A010060 is a Thue-Morse sequence.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Nov 24 2002

Keywords

Comments

Is there any interesting sequence b(n) such that b(n) mod 3 = a(n)?
Fixed point of the morphism 0->012; 1->1; 2->210 starting with a(0) = 0. - Philippe Deléham, Mar 14 2004

Crossrefs

Cf. A000069 (odious numbers), A001969 (evil numbers).

Programs

  • Mathematica
    Nest[ Function[ l, {Flatten[(l /. {0 -> {0, 1, 2}, 1 -> {1}, 2 -> {2, 1, 0}}) ]}], {0}, 6] (* Robert G. Wilson v, Mar 03 2005 *)
    cnt=0; Join[{0}, Table[If[EvenQ[Count[IntegerDigits[n,2],1]], cnt--, cnt++ ]; cnt, {n,150}]] (* T. D. Noe, Jun 14 2007 *)
  • PARI
    a(n)=if(n<0,0,2*sum(k=1,n,subst(Pol(binary(k)),x,1)%2)-n)
    
  • PARI
    a(n)=if(n<1,0,if(n%2,1,if(n/2%2,2-a(n\4*2),a(n/2))))
    
  • Python
    def A076826(n): return 1 if n&1 else (n.bit_count()&1)<<1 # Chai Wah Wu, Mar 01 2023

Formula

a(2k+1) = 1, a(4k) = a(2k), a(4k+2) = 2-a(2k). - Michael Somos, Dec 04 2002
a(2n) = 2*A010060(n); a(2n+1) = 1. - Benoit Cloitre, Mar 08 2004
a(n) = 2*(A026430(n+1) - 1) mod 3. - Philippe Deléham, Mar 28 2004
a(n) = (number of odious numbers <= n) - (number of evil numbers <= n) for n>0. - T. D. Noe, Jun 14 2007
a(n) = 2*A115384(n) - n. - Vladimir Shevelev, May 31 2009
a(n) = 0 if n and A000120(n) are even; a(n) = 2 if n is even but A000120(n) is odd; a(n) = 1 if n is odd. - Vladimir Shevelev, May 31 2009

A246162 Permutation of natural numbers: a(1) = 1, a(A000069(n)) = A014580(a(n-1)), a(A001969(n)) = A091242(a(n-1)), where A000069 and A001969 are the odious and evil numbers, and A014580 resp. A091242 are the binary coded irreducible resp. reducible polynomials over GF(2).

Original entry on oeis.org

1, 2, 4, 3, 5, 8, 11, 7, 6, 9, 13, 14, 31, 47, 17, 25, 12, 10, 19, 15, 37, 59, 20, 21, 61, 185, 42, 319, 62, 24, 87, 137, 34, 18, 55, 16, 41, 97, 27, 22, 67, 229, 49, 415, 76, 28, 103, 29, 109, 425, 78, 1627, 222, 54, 283, 3053, 373, 79, 433, 33, 131, 647, 108, 1123, 166, 45, 203, 26, 91, 379, 71, 23
Offset: 1

Views

Author

Antti Karttunen, Aug 17 2014. Erroneous comment corrected Aug 20 2014

Keywords

Comments

This is an instance of entanglement-permutation, where the two complementary pairs to be entangled with each other are A000069/A001969 (odious and evil numbers) and A014580/A091242 (binary codes for irreducible and reducible polynomials over GF(2)).
Because 3 is the only evil number in A014580, it implies that, apart from a(4)=3, all other odious positions contain an odious number. There are also odious numbers in some of the evil positions, precisely all the terms of A246158 in some order, together with all evil numbers larger than 3. (Permutation A246164 has the same property, except there a(7)=3.) See comments in A246161 for more details how this affects the cycle structure of these permutations.

Crossrefs

Formula

a(1) = 1, and for n > 1, if A010060(n) = 1 [i.e. n is one of the odious numbers, A000069], a(n) = A014580(a(A115384(n)-1)), otherwise, a(n) = A091242(a(A245710(n))).
As a composition of related permutations:
a(n) = A245702(A233279(n)).
a(n) = A246202(A006068(n)).
a(n) = A246164(A234612(n)).
For all n > 1, A091225(a(n)) = A010060(n). [Maps odious numbers to binary representations of irreducible GF(2) polynomials (A014580) and evil numbers to the corresponding representations of reducible polynomials (A091242), in some order].

A246160 Inverse function to the injection A065621.

Original entry on oeis.org

0, 1, 2, 0, 4, 0, 0, 3, 8, 0, 0, 7, 0, 5, 6, 0, 16, 0, 0, 15, 0, 13, 14, 0, 0, 9, 10, 0, 12, 0, 0, 11, 32, 0, 0, 31, 0, 29, 30, 0, 0, 25, 26, 0, 28, 0, 0, 27, 0, 17, 18, 0, 20, 0, 0, 19, 24, 0, 0, 23, 0, 21, 22, 0, 64, 0, 0, 63, 0, 61, 62, 0, 0, 57, 58, 0, 60, 0, 0, 59, 0, 49, 50, 0, 52
Offset: 0

Views

Author

Antti Karttunen, Aug 18 2014

Keywords

Comments

Sequence has nonzero values a(n) = k at those points n for which A065621(k) = n and zeros at those positions n which are not present in A065621.
Equally, sequence is obtained when the negative terms of A065620 are replaced with zeros

Crossrefs

Programs

  • PARI
    a065620(n) = if(n<3, n, if(n%2, -2*a065620((n - 1)/2) + 1, 2*a065620(n/2)));
    a(n) = (hammingweight(n)%2)*a065620(n);
    for(n=0, 100, print1(a(n),", ")) \\ Indranil Ghosh, Jun 07 2017
    
  • Python
    def a065620(n): return n if n<3 else 2*a065620(n//2) if n%2==0 else -2*a065620((n - 1)//2) + 1
    def a(n): return (bin(n)[2:].count("1")%2)*a065620(n)
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 07 2017

Formula

a(n) = A010060(n) * A065620(n).
a(n) = A246159(n) + A065620(n).
a(0) = 0, and for n >= 1, a(n) = A010060(n) * (1 + A006068(A115384(n)-1)).
For all n, a(A065621(n)) = n.

A276444 Permutation of natural numbers: a(1) = 1; a(A001969(1+n)) = A088359(a(n)), a(A000069(1+n)) = A087686(1+a(n)), where A088359 & A087686 = numbers that occur only once & more than once in A004001, and A000069 & A001969 are odious & evil numbers.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 11, 14, 15, 13, 16, 17, 18, 21, 19, 24, 27, 22, 20, 26, 30, 25, 31, 28, 23, 29, 32, 33, 34, 38, 35, 42, 48, 39, 36, 45, 54, 43, 58, 49, 40, 51, 37, 47, 57, 46, 62, 55, 44, 56, 63, 59, 50, 60, 41, 53, 61, 52, 64, 65, 66, 71, 67, 76, 86, 72, 68, 80, 96, 77, 106, 87, 73, 90, 69, 83, 102, 81
Offset: 1

Views

Author

Antti Karttunen, Sep 03 2016

Keywords

Crossrefs

Inverse: A276443.
Similar or related permutations: A006068, A276442, A276446.

Programs

Formula

a(1) = 1, and for n > 1, if A010060(n) = 0 [when n is one of the evil numbers, A001969], a(n) = A088359(a(A245710(n))), otherwise a(n) = A087686(1+a(A115384(n)-1)).
As a composition of other permutations:
a(n) = A276442(A006068(n)).

A276446 Permutation of natural numbers: a(1) = 1; a(A000069(1+n)) = A088359(a(n)), a(A001969(1+n)) = A087686(1+a(n)), where A088359 & A087686 = numbers that occur only once & more than once in A004001, and A000069 & A001969 are odious & evil numbers.

Original entry on oeis.org

1, 3, 2, 6, 7, 4, 5, 11, 14, 15, 13, 8, 9, 10, 12, 20, 26, 30, 25, 31, 28, 23, 29, 16, 17, 18, 21, 19, 24, 27, 22, 37, 47, 57, 46, 62, 55, 44, 56, 63, 59, 50, 60, 41, 53, 61, 52, 32, 33, 34, 38, 35, 42, 48, 39, 36, 45, 54, 43, 58, 49, 40, 51, 70, 85, 105, 84, 120, 103, 82, 104, 126, 117, 98, 118, 79, 101, 119, 100, 127, 122, 108, 123, 89
Offset: 1

Views

Author

Antti Karttunen, Sep 03 2016

Keywords

Crossrefs

Inverse: A276445.
Similar or related permutations: A006068, A267112, A276444.

Programs

Formula

a(1) = 1, and for n > 1, if A010060(n) = 1 [when n is one of the odious numbers, A000069], a(n) = A088359(a(A115384(n)-1)), otherwise a(n) = A087686(1+a(A245710(n))).
As a composition of other permutations:
a(n) = A267112(A006068(n)).

A108804 Self-convolution of A010060 (Thue-Morse sequence).

Original entry on oeis.org

0, 0, 1, 2, 1, 2, 2, 0, 3, 4, 2, 2, 4, 2, 3, 8, 3, 4, 6, 2, 6, 6, 5, 8, 6, 4, 7, 10, 5, 10, 10, 0, 11, 12, 6, 10, 10, 6, 9, 16, 8, 8, 13, 10, 11, 14, 12, 8, 14, 12, 11, 18, 11, 14, 16, 8, 15, 20, 14, 10, 20, 10, 11, 32, 11, 12, 22, 10, 18, 22, 17, 16, 20, 16, 17, 26, 15, 22, 24, 8, 24, 24, 17
Offset: 0

Views

Author

N. J. A. Sloane, Jul 09 2005

Keywords

Crossrefs

Programs

  • Haskell
    a108804 n = a108804_list !! n
    a108804_list = f [head a010060_list] $ tail a010060_list where
       f xs (z:zs) = (sum $ zipWith (*) xs (reverse xs)) : f (z : xs) zs
    -- Reinhard Zumkeller, Sep 14 2014
    
  • Mathematica
    Table[Sum[ThueMorse[k]*ThueMorse[n-k], {k, 0, n}], {n, 0, 85}] (* G. C. Greubel, Apr 03 2019 *)
  • PARI
    a(n)=sum(k=0,n,(subst(Pol(binary(k)),x,1)%2)*(subst(Pol(binary(n-k)),x,1)%2)) /* Ralf Stephan, Aug 23 2013 */
    
  • PARI
    {a(n)=sum(k=0,n, (hammingweight(k)*hammingweight(n-k))%2)};
    vector(85, n, n--; a(n)) \\ G. C. Greubel, Apr 03 2019
    
  • Sage
    [sum(sloane.A010060(k)*sloane.A010060(n-k) for k in (0..n)) for n in (0..85)] # G. C. Greubel, Apr 03 2019

Formula

a(2n+1) = (1/2) * (A115384(n) - 2a(n)). - Ralf Stephan, Aug 23 2013
G.f.: (1/4)*(1/(1 - x) - Product_{k>=0} (1 - x^(2^k)))^2. - Ilya Gutkovskiy, Apr 03 2019
a(n) = Sum_{k=0..n} A010060(k)*A010060(n-k), for n>=0. - G. C. Greubel, Apr 03 2019

A269855 a(0) = 1, a(1) = 2, after which, a(nth_odious_number_larger_than_one(n)) = A250469(a(n)), a(nth_evil_number_larger_than_zero(n)) = 2*a(n).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 9, 7, 10, 12, 15, 16, 21, 25, 18, 11, 14, 20, 27, 24, 33, 35, 30, 32, 45, 55, 42, 49, 50, 36, 51, 13, 22, 28, 39, 40, 57, 65, 54, 48, 69, 85, 66, 77, 70, 60, 87, 64, 93, 115, 90, 91, 110, 84, 123, 121, 98, 100, 147, 72, 105, 125, 102, 17, 26, 44, 63, 56, 81, 95, 78, 80, 117, 145, 114, 119, 130, 108, 159, 96
Offset: 0

Views

Author

Antti Karttunen, Mar 07 2016

Keywords

Comments

Permutation of natural numbers obtained from the sieve of Eratosthenes, combined with the inverse of Gray code. Note the indexing: Domain starts from 0, range from 1.

Crossrefs

Inverse: A269856.
Related or similar permutations: A006068, A252755, A269851.

Formula

a(0) = 1, a(1) = 2, for n > 1, if A010060(n) = 1 [when n is one of the odious numbers A000069], a(n) = A250469(a(A115384(n)-1)), otherwise [when n is one of the evil numbers A001969], a(n) = 2*a(A245710(n)).
As a composition of other permutations:
a(n) = A252755(A006068(n)).

A115382 Correlation triangle for Thue-Morse sequence A010060(n+1).

Original entry on oeis.org

1, 1, 1, 0, 2, 0, 1, 1, 1, 1, 0, 1, 2, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 3, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 0, 1, 3, 1, 0, 2, 0, 0, 1, 1, 2, 1, 1, 2, 1, 1, 0, 1, 0, 2, 1, 1, 3, 1, 1, 2, 0, 1, 0, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 0, 1, 1, 0, 2, 1, 1, 4, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 1, 2, 1, 1, 1
Offset: 0

Views

Author

Paul Barry, Jan 21 2006

Keywords

Comments

Row sums are A115383. T(2n,n) gives A115384(n+1).

Examples

			Triangle begins
1,
1, 1,
0, 2, 0,
1, 1, 1, 1,
0, 1, 2, 1, 0,
0, 1, 1, 1, 1, 0,
1, 0, 1, 3, 1, 0, 1,
1, 1, 1, 1, 1, 1, 1, 1,
0, 2, 0, 1, 3, 1, 0, 2, 0,
0, 1, 1, 2, 1, 1, 2, 1, 1, 0,
1, 0, 2, 1, 1, 3, 1, 1, 2, 0, 1,
0, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 0,
1, 1, 0, 2, 1, 1, 4, 1, 1, 2, 0, 1, 1,
1, 1, 1, 2, 1, 2, 2, 2, 2, 1, 2, 1, 1, 1,
0, 2, 1, 0, 2, 1, 1, 5, 1, 1, 2, 0, 1, 2, 0,
1, 1, 1, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 1, 1, 1,
0, 1, 2, 2, 0, 2, 2, 1, 5, 1, 2, 2, 0, 2, 2, 1, 0
		

Formula

G.f.: A(x)A(x*y)/(1-x^2*y) where A(x) is the g.f. of A010060(n+1). Number triangle T(n, k)=sum{j=0..n, if(j<=k, A010060(k-j+1), 0)*if(j<=(n-k), A010060(n-k-j+1), 0)}.

A135585 a(n) = Sum_{i=1..n} (floor(S2(i)/3) mod 2), where S2(i) = A000120(i).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 4, 5, 5, 5, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 13, 14, 15, 16, 16, 16, 16, 17, 17, 18, 19, 20, 20, 21, 22, 23, 24, 25, 26, 27, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 41, 41, 41, 41, 42
Offset: 0

Views

Author

Ctibor O. Zizka, Feb 25 2008

Keywords

Comments

Sequence A115384 is a(n) = Sum_{i=1..n} (floor(S2(n)*1/1) mod 2) = Sum_{i=1..n} (S2(n) mod 2).

Crossrefs

Programs

  • Maple
    A000120 := proc(n) local i ; add(i,i=convert(n,base,2)) : end: A135585 := proc(n) add(floor(A000120(i)/3) mod 2,i=1..n) ; end: seq(A135585(n),n=0..80) ; # R. J. Mathar, Apr 22 2008
  • Mathematica
    f[n_] := n - Sum[Floor[n/2^k], {k, 1, Infinity}]; Table[Sum[Mod[Floor[f[i]/3], 2], {i,1,n}], {n,0,25}] (* G. C. Greubel, Oct 20 2016 *)
  • PARI
    a(n) = sum(i=1, n, hammingweight(i)\3 % 2); \\ Michel Marcus, Sep 19 2015

Extensions

Definition corrected by R. J. Mathar, Apr 22 2008
Previous Showing 11-20 of 22 results. Next