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

A007013 Catalan-Mersenne numbers: a(0) = 2; for n >= 0, a(n+1) = 2^a(n) - 1.

Original entry on oeis.org

2, 3, 7, 127, 170141183460469231731687303715884105727
Offset: 0

Views

Author

N. J. A. Sloane, Nik Lygeros (webmaster(AT)lygeros.org)

Keywords

Comments

The next term is too large to include.
Orbit of 2 under iteration of the "Mersenne operator" M: n -> 2^n-1 (0 and 1 are fixed points of M). - M. F. Hasler, Nov 15 2006
Also called the Catalan sequence. - Artur Jasinski, Nov 25 2007
a(n) divides a(n+1)-1 for every n. - Thomas Ordowski, Apr 03 2016
Proof: if 2^a == 2 (mod a), then 2^a = 2 + ka for some k, and 2^(2^a-1) = 2^(1 + ka) = 2*(2^a)^k == 2 (mod 2^a-1). Given that a(1) = 3 satisfies 2^a == 2 (mod a), that gives you all 2^a(n) == 2 (mod a(n)), and since a(n+1) - 1 = 2^a(n) - 2 that says a(n) | a(n+1) - 1. - Robert Israel, Apr 05 2016
All terms shown are primes, the status of the next term is currently unknown. - Joerg Arndt, Apr 03 2016
The next term is a prime or a Fermat pseudoprime to base 2 (i.e., a member of A001567). If it is a pseudoprime, then all succeeding terms are pseudoprimes. - Thomas Ordowski, Apr 04 2016
a(n) is the least positive integer that requires n+1 steps to reach 1 under iteration of the binary weight function A000120. - David Radcliffe, Jun 25 2018
If the next term were prime, it would be a counterexample to the New Mersenne conjecture. It is known that (2^a(4) + 1) / 3 is composite, with factor 886407410000361345663448535540258622490179142922169401 = 5209834514912200*a(4)+1. - William Hu, Jul 30 2024
a(n) is the smallest number of additive persistence n+1 in base 2. (Similar to A006050 but for binary instead of decimal.) - J. Beach, Nov 17 2024

References

  • P. Ribenboim, The Book of Prime Number Records. Springer-Verlag, NY, 2nd ed., 1989, p. 81.
  • W. Sierpiński, A Selection of Problems in the Theory of Numbers. Macmillan, NY, 1964, p. 91.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

Formula

a(n) = M(a(n-1)) = M^n(2) with M: n-> 2^n-1. - M. F. Hasler, Nov 15 2006
A180094(a(n)) = n + 1.

Extensions

Edited by Henry Bottomley, Nov 07 2002
Amended title name by Marc Morgenegg, Apr 14 2016

A381962 Irregular triangle read by rows, where row n lists the iterates of f(x), starting at x = n until f(x) <= 1, where f(x) is the Hamming weight of x (A000120).

Original entry on oeis.org

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

Views

Author

Paolo Xausa, Mar 11 2025

Keywords

Examples

			Triangle begins:
  n\k|  0  1  2  3
  ----------------
   0 |  0;
   1 |  1;
   2 |  2, 1;
   3 |  3, 2, 1;
   4 |  4, 1;
   5 |  5, 2, 1;
   6 |  6, 2, 1;
   7 |  7, 3, 2, 1;
   8 |  8, 1;
   9 |  9, 2, 1;
  10 | 10, 2, 1;
  ...
		

Crossrefs

Cf. A000120, A078627 (row lengths), A078677 (row sums), A180094.

Programs

  • Mathematica
    A381962row[n_] := NestWhileList[DigitSum[#, 2] &, n, # > 1 &];
    Array[A381962row, 30, 0]
  • Python
    def row(n):
        out = [n] if n > 1 else []
        while (n:=n.bit_count()) > 1:
            out += [n]
        return out + [n]
    print([e for n in range(27) for e in row(n)]) # Michael S. Branicky, Mar 12 2025

Formula

T(n,0) = n and, for k = 1..A180094(n), T(n,k) = A000120(T(n,k-1)).

A078627 Write n in binary; repeatedly sum the "digits" until reaching 1; a(n) = 1 + number of steps required.

Original entry on oeis.org

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

Views

Author

Frank Schwellinger (nummer_eins(AT)web.de), Dec 12 2002

Keywords

Comments

The terms a(n) are unbounded. The smallest n with a(n) = m, n_min(m), however may be exorbitantly large, even for small m. It can be calculated by the following recurrence: n_min(1) = 1; n_min(2) = 2; n_min(m) = 2^n_min(m-1) - 1 {if m > 2};

Examples

			a(13) = 4 because 13 = (1101) -> (1+1+0+1 = 11) -> (1+1 = 10) -> (1+0 = 1) = 1. (Three iterations were required to reach 1.)
		

Crossrefs

Cf. A000120.
One more than A180094. Row lengths of A381962.

Programs

  • Maple
    for n from 1 to 500 do h := n:a[n] := 1:while(h>1) do a[n] := a[n]+1: b := convert(h,base,2):h := sum(b[j],j=1..nops(b)):od:od:seq(a[j],j=1..500);
  • Mathematica
    Table[Length[NestWhileList[Total[IntegerDigits[#,2]]&,n,#>1&]],{n,110}] (* Harvey P. Dale, Oct 10 2011 *)
  • PARI
    A078627(n) = { my(k=1); while(n>1, n = hammingweight(n); k += 1); (k); }; \\ Antti Karttunen, Jul 09 2017
    
  • Python
    def a(n):
        c = 1 if n > 1 else 0
        while (n:=n.bit_count()) > 1:
            c += 1
        return c + 1
    print([a(n) for n in range(1, 106)]) # Michael S. Branicky, Mar 12 2025

Formula

a(1) = 1; for n > 1, a(n) = 1 + a(A000120(n)), where A000120 gives the number of occurrences of digit 1 in binary representation of n.
a(n) = 1 + A180094(n). - Antti Karttunen, Jul 09 2017

Extensions

Description corrected by Antti Karttunen, Jul 09 2017

A078677 Write n in binary; repeatedly sum the "digits" until reaching 1; a(n) = sum of these sums (including '1' and n itself).

Original entry on oeis.org

1, 3, 6, 5, 8, 9, 13, 9, 12, 13, 17, 15, 19, 20, 20, 17, 20, 21, 25, 23, 27, 28, 28, 27, 31, 32, 32, 34, 34, 35, 39, 33, 36, 37, 41, 39, 43, 44, 44, 43, 47, 48, 48, 50, 50, 51, 55, 51, 55, 56, 56, 58, 58, 59, 63, 62, 62, 63, 67, 65, 69, 70, 72, 65, 68, 69, 73, 71, 75, 76, 76, 75
Offset: 1

Views

Author

Frank Schwellinger (nummer_eins(AT)web.de), Dec 17 2002

Keywords

Examples

			a(13) = 19 because 13 = (1101) -> (1+1+0+1 = 11) -> (1+1 = 10) -> (1+0 = 1) = 1 and 1101+11+10+1 (binary) = 19 (decimal).
		

Crossrefs

Row sums of A381962.

Programs

  • Mathematica
    A078677[n_] := Total[NestWhileList[DigitSum[#, 2] &, n, # > 1 &]];
    Array[A078677, 100] (* Paolo Xausa, Mar 11 2025 *)
  • Python
    def a(n):
        s = n if n > 1 else 0
        while (n:=n.bit_count()) > 1:
            s += n
        return s + 1
    print([a(n) for n in range(1, 73)]) # Michael S. Branicky, Mar 12 2025

Formula

a(1) = 1; for n > 1, a(n) = n + a(A000120(n)).
a(n) = Sum_{k = 0..A180094(n)} A381962(n,k). - Paolo Xausa, Mar 12 2025
Showing 1-4 of 4 results.