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.

A091926 Least k<=n such that A002487(k)=A002487(n).

Original entry on oeis.org

1, 1, 3, 1, 5, 3, 5, 1, 9, 5, 11, 3, 11, 5, 9, 1, 11, 9, 19, 5, 21, 11, 19, 3, 19, 11, 21, 5, 19, 9, 11, 1, 33, 11, 35, 9, 37, 19, 39, 5, 37, 21, 43, 11, 45, 19, 35, 3, 35, 19, 45, 11, 43, 21, 37, 5, 39, 19, 37, 9, 35, 11, 33, 1, 19, 33, 37, 11, 69, 35, 43, 9, 73, 37, 75, 19, 77, 39, 43, 5
Offset: 1

Views

Author

Benoit Cloitre, Mar 11 2004

Keywords

Comments

a(n)=n for n=1,3,5,9,11,19,21,33,....

Crossrefs

Cf. A091945.

Programs

A091948 Number of values of k, 0 <= k <= n, satisfying A002487(k) = A002487(n).

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Mar 11 2004

Keywords

Comments

This sequence is the ordinal transform of A002487. - Rémy Sigrist, Dec 28 2022

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n<2, n,
          (q-> b(q)+(n-2*q)*b(n-q))(iquo(n, 2)))
        end:
    p:= proc() 0 end:
    a:= proc(n) option remember; local t;
          t:= b(n); p(t):= p(t)+1
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Dec 31 2022
  • Mathematica
    b[n_] := b[n] = If[n < 2, n,
       Function[q, b[q] + (n - 2*q)*b[n - q]][Quotient[n, 2]]];
    p[_] = 0;
    a[n_] := a[n] = With[{t = b[n]}, p[t] = p[t]+1];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, May 20 2024, after Alois P. Heinz *)
  • PARI
    \\ See Links section.

Formula

a(n) = 1 iff n belongs to A091945. - Rémy Sigrist, Dec 28 2022

Extensions

a(0) = 1 prepended and name adapted by Rémy Sigrist, Dec 28 2022

A295087 Distinct values in A002487 in the order of appearance.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Nov 14 2017

Keywords

Comments

This sequence is a permutation of the nonnegative integers, with inverse A295088.

Examples

			The first terms of this sequence, alongside the first terms of A002487, are:
n   a(n)    fusc(k) k
--  ----    ------- --
1   0       0       0
2   1       1       1
.   .       1       2
3   2       2       3
.   .       1       4
4   3       3       5
.   .       2       6
.   .       3       7
.   .       1       8
5   4       4       9
.   .       3       10
6   5       5       11
.   .       2       12
.   .       5       13
.   .       3       14
.   .       4       15
.   .       1       16
.   .       5       17
.   .       4       18
7   7       7       19
.   .       3       20
8   8       8       21
.   .       5       22
.   .       7       23
		

Crossrefs

Programs

  • PARI
    fusc(n)=local(a=1, b=0); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); b \\ after Charles R Greathouse IV at A002487
    s=0; for (n=0, 621, v=fusc(n); if(!bittest(s,v), print1(v", "); s+=2^v))
    
  • Python
    from functools import reduce
    from itertools import count, islice
    def A295087_gen(): # generator of terms
        s = {0}
        yield 0
        for n in count(1):
            if (m:=sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(n)[-1:2:-1],(1,0)))) not in s:
                yield m
                s.add(m)
    A295087_list = list(islice(A295087_gen(),20)) # Chai Wah Wu, May 18 2023

Formula

a(n) = A002487(A091945(n)).

Extensions

Formula adapted after change in A091945 by Rémy Sigrist, Dec 07 2022

A385991 a(n) is the number of distinct values among A002487(0), ..., A002487(n).

Original entry on oeis.org

1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 16
Offset: 0

Views

Author

Rémy Sigrist, Jul 14 2025

Keywords

Comments

This sequence exhibits large runs of consecutive equal values.

Examples

			Sequence begins:
  n   a(n)  A002487(n)
  --  ----  ----------
   0     1           0
   1     2           1
   2     2           1
   3     3           2
   4     3           1
   5     4           3
   6     4           2
   7     4           3
   8     4           1
   9     5           4
  10     5           3
  11     6           5
  12     6           2
  13     6           5
  14     6           3
  15     6           4
  16     6           1
  17     6           5
  18     6           4
  19     7           7
		

Crossrefs

See A061069, A061070 and A061071 for similar sequences.

Programs

  • PARI
    \\ See Links section.
    
  • Python
    def A385991(n):
        if n==0: return 1
        a, b, s, c = 0, 1, {0,1}, 2
        for i in range(n-1):
            a, b = b, ((a//b<<1)+1)*b-a
            if b not in s:
                c += 1
                s.add(b)
        return c # Chai Wah Wu, Jul 17 2025

Formula

a(A091945(n)) = n (this is the first occurrence of n in the sequence).
a(2*n) = a(2*n-1) for any n > 0.
Showing 1-4 of 4 results.