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

A137671 a(n+1) is the number of preceding terms having in binary representation the same number of ones as a(n), starting with a(1) = 1.

Original entry on oeis.org

1, 1, 2, 3, 1, 4, 5, 2, 6, 3, 4, 7, 1, 8, 9, 5, 6, 7, 2, 10, 8, 11, 3, 9, 10, 11, 4, 12, 12, 13, 5, 14, 6, 15, 1, 13, 7, 8, 14, 9, 16, 15, 2, 16, 17, 17, 18, 19, 10, 20, 21, 11, 12, 22, 13, 14, 15, 3, 23, 4, 18, 24, 25, 16, 19, 17, 26, 18, 27, 5, 28, 19, 20, 29, 6, 30, 7, 21, 22, 23, 8
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 05 2008

Keywords

Examples

			n=4: a(3) = 2 = '10', A000120(2) = 1, therefore: a(4) = #{a(1)=1='1', a(2)=1, a(3)=2='10'} = 3;
n=5: a(4) = 3 = '11', A000120(3) = 2, therefore: a(5) = #{a(4)} = 1;
n=6: a(5) = 1 = '1', A000120(1) = 1, therefore: a(6) = #{a(1)=1='1', a(2)=1, a(3)=2='10', a(5)} = 4.
		

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = Count[Array[s, n-1], s[n-1]]; s[n_] := s[n] = DigitCount[a[n], 2, 1]; Array[a, 100] (* Amiram Eldar, Jul 27 2023 *)
  • PARI
    lista(nn) = my(va = vector(nn)); va[1] = 1; for (n=2, nn, va[n] = #select(x->hammingweight(x)==hammingweight(va[n-1]), Vec(va, n-1));); va; \\ Michel Marcus, Jul 28 2023

Formula

A137672(n) = A000120(a(n)).
a(A137673(n)) = n and a(m) < n for m < A137673(n).
a(n) = 1 iff a(n-1) = 2^k - 1: a(A137674(n)) = 1.

Extensions

Name edited by Michel Marcus, Jul 28 2023

A137674 Numbers m such that A137671(m) = 1.

Original entry on oeis.org

1, 2, 5, 13, 35, 84, 198, 414, 960, 1898, 4263, 8556, 18473, 37490, 79526, 159956, 338873, 680306, 1438941, 2869908, 6057397, 12038460, 25300258, 50460684, 105275708, 211424744, 437486956, 879869316, 1810901110, 3642407379, 7495644753, 15038540180, 30957576741
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 05 2008

Keywords

Crossrefs

Programs

  • C
    See Links section.
  • Mathematica
    b[1] = 1; b[n_] := b[n] = Count[Array[s, n - 1], s[n - 1]]; s[n_] := s[n] = DigitCount[b[n], 2, 1]; Select[Range[10000], b[#] == 1 &] (* Amiram Eldar, Jul 27 2023 *)

Formula

A137671(a(n)) = 1.
A137672(a(n)) = 1.
For n > 1: A137671(a(n)-1) = 2^(n-1)-1 = A000225(n-1), A137672(a(n)-1) = n-1, and a(n) = A137673(A137671(a(n)-1)) + 1.

Extensions

More terms from Rémy Sigrist, Jun 28 2019
Showing 1-2 of 2 results.