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

A344342 Numbers k such that k and k + 1 are both Gray-code Niven numbers (A344341).

Original entry on oeis.org

1, 2, 3, 6, 7, 8, 14, 15, 27, 30, 31, 32, 39, 44, 51, 56, 62, 63, 75, 99, 104, 111, 123, 126, 127, 128, 135, 144, 155, 159, 174, 175, 184, 185, 195, 204, 207, 215, 224, 231, 234, 235, 243, 244, 248, 254, 255, 264, 275, 284, 294, 300, 304, 305, 315, 335, 354, 375
Offset: 1

Views

Author

Amiram Eldar, May 15 2021

Keywords

Examples

			1 is a term since 1 and 2 are both Gray-code Niven numbers.
		

Crossrefs

Subsequence of: A344341.
Subsequences: A344343 and A344344.
Similar sequences: A330927 (decimal), A328205 (factorial), A328209 (Zeckendorf), A328213 (lazy Fibonacci), A330931 (binary), A331086 (negaFibonacci), A333427 (primorial), A334309 (base phi), A331820 (negabinary), A342427 (base 3/2).

Programs

  • Mathematica
    gcNivenQ[n_] := Divisible[n, DigitCount[BitXor[n, Floor[n/2]], 2, 1]]; Select[Range[400], And @@ gcNivenQ[# + {0, 1}] &]

A344343 Starts of runs of 3 consecutive Gray-code Niven numbers (A344341).

Original entry on oeis.org

1, 2, 6, 7, 14, 30, 31, 62, 126, 127, 174, 184, 234, 243, 254, 304, 474, 483, 510, 511, 534, 543, 544, 783, 784, 903, 904, 954, 963, 1022, 1134, 1144, 1253, 1264, 1448, 1475, 1504, 1895, 1914, 1923, 1974, 2046, 2047, 2093, 2094, 2104, 2814, 2888, 2944, 3054, 3064
Offset: 1

Views

Author

Amiram Eldar, May 15 2021

Keywords

Examples

			1 is a term since 1, 2 and 3 are all Gray-code Niven numbers.
		

Crossrefs

Subsequence of A344341 and A344342.
Subsequences: A344344.
Similar sequences: A154701 (decimal), A328206 (factorial), A328210 (Zeckendorf), A328214 (lazy Fibonacci), A330932 (binary), A331087 (negaFibonacci), A333428 (primorial), A334310 (base phi), A331822 (negabinary), A342428 (base 3/2).

Programs

  • Mathematica
    gcNivenQ[n_] := Divisible[n, DigitCount[BitXor[n, Floor[n/2]], 2, 1]]; Select[Range[3000], AllTrue[# + {0, 1, 2}, gcNivenQ] &]

A344344 Starts of runs of 4 consecutive Gray-code Niven numbers (A344341).

Original entry on oeis.org

1, 6, 30, 126, 510, 543, 783, 903, 2046, 2093, 3773, 3903, 7133, 7743, 8190, 8223, 8703, 10087, 12303, 12543, 14343, 14463, 15423, 15903, 16143, 16263, 20167, 22687, 27727, 30247, 30653, 30783, 32766, 35629, 40327, 47509, 47887, 49133, 50407, 57533, 60071, 60487
Offset: 1

Views

Author

Amiram Eldar, May 15 2021

Keywords

Comments

Are there 5 consecutive Gray-code Niven numbers? There are no such numbers below 10^10.

Examples

			1 is a term since 1, 2, 3 and 4 are all Gray-code Niven numbers.
		

Crossrefs

Subsequence of A344341, A344342 and A344343.
Similar sequences: A141769 (decimal), A328207 (factorial), A328211 (Zeckendorf), A328215 (lazy Fibonacci), A330933 (binary), A334311 (base phi), A331824 (negabinary), A342429 (base 3/2).

Programs

  • Mathematica
    gcNivenQ[n_] := Divisible[n, DigitCount[BitXor[n, Floor[n/2]], 2, 1]]; Select[Range[60000], AllTrue[# + {0, 1, 2, 3}, gcNivenQ] &]

A050605 Column/row 2 of A050602: a(n) = add3c(n,2).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 22 1999

Keywords

Comments

It seems that (n - Sum_{k=1..n} a(k) )/log(n) is bounded. - Benoit Cloitre, Oct 03 2002
2^a(n-1) is the highest power of 2 dividing the triangular number A000217(n) = n*(n+1)/2, for n >= 1. - Benoit Cloitre, Oct 03 2002 [corrected and rewritten by Wolfdieter Lang, Nov 21 2019]
a(n) is the number of trailing 0's in the binary reflected Gray code of n+1 (A014550). - Amiram Eldar, May 15 2021

Crossrefs

Bisection gives column/row 1 of A050602: A007814.

Programs

  • Magma
    [Valuation(n*(n+1)/2, 2): n in [1..120]]; // Vincenzo Librandi, Aug 11 2017
  • Maple
    with(Bits): add3c := proc(a, b) option remember; `if`(0 = And(a, b), 0, 1 + add3c(Xor(a, b), 2*And(a, b))) end: A050605 := n -> add3c(n, 2):
    seq(A050605(n), n=0..80); # Johannes W. Meijer, Jun 18 2009; updated by Peter Luschny, Jul 12 2019
  • Mathematica
    Table[IntegerExponent[(n + 1)(n + 2)/2, 2], {n, 0, 100}] (* Jean-François Alcover, Mar 04 2016 *)
  • PARI
    a(n)=valuation(n*(n+1)/2,2)
    

Formula

a(4*n+2) = A001511(n). - Johannes W. Meijer, Jun 18 2009
a(n) = A007814(n+1) + A007814(n+2) - 1. - Ridouane Oudra, Oct 08 2019

A047521 Numbers that are congruent to {0, 7} mod 8.

Original entry on oeis.org

0, 7, 8, 15, 16, 23, 24, 31, 32, 39, 40, 47, 48, 55, 56, 63, 64, 71, 72, 79, 80, 87, 88, 95, 96, 103, 104, 111, 112, 119, 120, 127, 128, 135, 136, 143, 144, 151, 152, 159, 160, 167, 168, 175, 176, 183, 184, 191, 192, 199, 200, 207, 208, 215, 216, 223, 224, 231, 232
Offset: 1

Views

Author

Keywords

Comments

Numbers such that the n-th triangular number is divisible by 4. - Charles R Greathouse IV, Apr 07 2011
Except for 0, numbers whose binary reflected Gray code (A014550) ends with 00. - Amiram Eldar, May 17 2021

Crossrefs

Union of A008590 and A004771.

Programs

  • Mathematica
    {#,#+7}&/@(8*Range[0,30])//Flatten (* or *) LinearRecurrence[{1,1,-1},{0,7,8},60] (* Harvey P. Dale, Oct 30 2016 *)
  • PARI
    a(n) = 4*n - 5/2 + 3*(-1)^n/2; \\ David Lovler, Jul 25 2022
  • R
    kmax <- 10 # by choice
    a <- c(0,7)
    for(k in 3:kmax) a <- c(a, a + 2^k)
    a
    # Yosu Yurramendi, Jan 18 2022
    

Formula

a(n) = 8*n - a(n-1) - 9 (with a(1)=0). - Vincenzo Librandi, Aug 06 2010
From R. J. Mathar, Oct 08 2011: (Start)
a(n) = 3*(-1)^n/2 - 5/2 + 4*n.
G.f.: x^2*(7+x) / ( (1+x)*(x-1)^2 ). (End)
a(n+1) = Sum_{k>=0} A030308(n,k)*b(k) with b(0)=7 and b(k)=2^(k+2) for k > 0. - Philippe Deléham, Oct 17 2011
Sum_{n>=2} (-1)^n/a(n) = log(2)/2 + sqrt(2)*log(sqrt(2)+1)/8 - (sqrt(2)+1)*Pi/16. - Amiram Eldar, Dec 18 2021
E.g.f.: 1 + ((8*x -5)*exp(x) + 3*exp(-x))/2. David Lovler, Aug 22 2022

Extensions

More terms from Vincenzo Librandi, Aug 06 2010

A047457 Numbers that are congruent to {3, 4} mod 8.

Original entry on oeis.org

3, 4, 11, 12, 19, 20, 27, 28, 35, 36, 43, 44, 51, 52, 59, 60, 67, 68, 75, 76, 83, 84, 91, 92, 99, 100, 107, 108, 115, 116, 123, 124, 131, 132, 139, 140, 147, 148, 155, 156, 163, 164, 171, 172, 179, 180, 187, 188, 195, 196, 203, 204, 211, 212, 219, 220, 227
Offset: 1

Views

Author

Keywords

Comments

Union of A017101 and A017113. - Michel Marcus, Feb 25 2014
Numbers whose binary reflected Gray code (A014550) has a single trailing zero. - Amiram Eldar, May 17 2021

Crossrefs

Programs

Formula

a(n) = 8*n - a(n-1) - 9 (with a(1) = 3). - Vincenzo Librandi, Aug 06 2010
G.f.: x*(3+x+4*x^2)/((1-x)^2*(1+x)). - Colin Barker, May 13 2012
a(n) = (-5 - 3*(-1)^n + 8*n)/2. - Colin Barker, May 14 2012
A000120(a(n)-1) = A000120(a(n)+1) = A063787(n). - Ilya Lopatin and Juri-Stepan Gerasimov, Feb 25 2014
Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(2)-1)*Pi/16 + log(2)/4 - sqrt(2)*log(sqrt(2)+1)/8. - Amiram Eldar, Dec 18 2021

A280998 Numbers with a prime number of 1's in their binary reflected Gray code representation.

Original entry on oeis.org

2, 4, 5, 6, 8, 9, 11, 12, 13, 14, 16, 17, 19, 21, 23, 24, 25, 27, 28, 29, 30, 32, 33, 35, 37, 39, 41, 43, 45, 47, 48, 49, 51, 53, 55, 56, 57, 59, 60, 61, 62, 64, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 96, 97, 99, 101, 103
Offset: 1

Views

Author

Indranil Ghosh, Jan 12 2017

Keywords

Comments

From Emeric Deutsch, Jan 28 2018: (Start)
Also the indices of the compositions that have a prime number of parts. For the definition of the index of a composition see A298644.
For example, 27 is in the sequence since its binary form is 11011 and the composition [2,1,2] has 3 parts.
On the other hand, 58 is not in the sequence since its binary form is 111010 and the composition [3,1,1,1] has 4 parts.
The command c(n) from the Maple program yields the composition having index n. (End)

Examples

			27 is in the sequence because the binary reflected Gray code representation of 27 is 10110 which has 3 1's, and 3 is prime.
		

Crossrefs

Programs

  • Maple
    Runs := proc (L) local j, r, i, k: j := 1: r[j] := L[1]:
    for i from 2 to nops(L) do if L[i] = L[i-1] then r[j] := r[j], L[i] else j := j+1:
    r[j] := L[i] end if end do: [seq([r[k]], k = 1 .. j)] end proc:
    RunLengths := proc (L) map(nops, Runs(L)) end proc:
    c := proc (n) ListTools:-Reverse(convert(n, base, 2)): RunLengths(%) end proc:
    A := {}: for n to 175 do if isprime(nops(c(n))) = true then A := `union`(A, {n}) else end if end do: A;
    # most of the program is due to W. Edwin Clark. # Emeric Deutsch, Jan 28 2018
  • Mathematica
    Select[Range[100], PrimeQ[DigitCount[BitXor[#, Floor[#/2]], 2, 1]] &] (* Amiram Eldar, May 01 2021 *)
  • PARI
    is(n)=isprime(hammingweight(bitxor(n, n>>1))) \\ Charles R Greathouse IV, Jan 12 2017

A280999 Numbers with a prime number of 0's in their binary reflected Gray code representation.

Original entry on oeis.org

7, 8, 12, 14, 15, 16, 17, 19, 23, 24, 25, 27, 28, 29, 30, 33, 34, 35, 36, 38, 39, 40, 44, 46, 47, 49, 50, 51, 52, 54, 55, 57, 58, 59, 61, 63, 64, 66, 68, 69, 70, 72, 73, 75, 76, 77, 78, 80, 81, 83, 87, 88, 89, 91, 92, 93, 94, 96, 98, 100, 101, 102, 104, 105, 107
Offset: 1

Views

Author

Indranil Ghosh, Jan 12 2017

Keywords

Examples

			27 is in the sequence because the binary reflected Gray Code representation of 27 is 10110 which has 2 0's and 2 is prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[100], PrimeQ[DigitCount[BitXor[#, Floor[#/2]], 2, 0]] &] (* Amiram Eldar, May 01 2021 *)
  • PARI
    is(n)=isprime(logint(n,2)-hammingweight(bitxor(n, n>>1))+1) \\ Charles R Greathouse IV, Jan 13 2017

A281379 Numbers which are palindromic in their binary reflected Gray code representation.

Original entry on oeis.org

0, 1, 2, 5, 6, 10, 14, 18, 21, 25, 30, 34, 42, 54, 62, 66, 77, 85, 90, 102, 105, 113, 126, 130, 146, 170, 186, 198, 214, 238, 254, 258, 285, 301, 306, 330, 341, 357, 378, 390, 409, 425, 438, 462, 465, 481, 510, 514, 546, 594, 626, 650, 682, 730, 762, 774, 806, 854, 886, 910, 942
Offset: 1

Views

Author

Indranil Ghosh, Jan 21 2017

Keywords

Comments

A281378 is a subsequence of this sequence.

Examples

			34 is in the sequence because the binary reflected Gray code representation of 34 is '110011', which is palindromic.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 10^3], Reverse@ # == # &@ Abs[Prepend[Most@ #, 0] - #] &@
    IntegerDigits[#, 2] &] (* Michael De Vlieger, Jan 21 2017 *)
  • Python
    def G(n):
        return bin(n^(n//2))[2:]
    i=0
    j=1
    while j<=10000:
        if G(i)==G(i)[::-1]:
            print(str(j)+" "+str(i))
            j+=1
        i+=1

A281388 Write n in binary reflected Gray code and sum the positions where there is a '1' followed immediately to the right by a '0', counting the leftmost digit as position 1.

Original entry on oeis.org

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

Views

Author

Indranil Ghosh, Jan 21 2017

Keywords

Examples

			For n = 11, the binary reflected Gray code for 11 is '1110'. In '1110', the position of '1' followed immediately to the right by '0' counting from left is 3. So, a(11) = 3.
For n = 12, the binary reflected Gray code for 12 is '1010'. In '1010', the positions of '1' followed immediately to the right by '0' counting from left are 1 and 3. So, a(12) = 1 + 3 = 4.
		

Crossrefs

Programs

  • Python
    def g(n):
        return bin(n^(n//2))[2:]
    def a(n):
        x=g(n)
        s=0
        for i in range(1, len(x)):
            if x[i-1]=="1" and x[i]=="0":
                s+=i
        return s

Formula

a(n) = A049501(A003188(n)).
Previous Showing 11-20 of 30 results. Next