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

A036990 Numbers n such that, in the binary expansion of n, reading from right to left, the number of 1's never exceeds the number of 0's.

Original entry on oeis.org

0, 2, 4, 8, 10, 12, 16, 18, 20, 24, 32, 34, 36, 40, 42, 44, 48, 50, 52, 56, 64, 66, 68, 72, 74, 76, 80, 82, 84, 88, 96, 98, 100, 104, 112, 128, 130, 132, 136, 138, 140, 144, 146, 148, 152, 160, 162, 164, 168, 170, 172, 176, 178, 180, 184, 192, 194, 196, 200, 202, 204
Offset: 1

Views

Author

Keywords

Comments

A036989(a(n)) = 1. - Reinhard Zumkeller, Jul 31 2013

Crossrefs

Each term is 2^n * some term of A014486 (n >= 0).
Cf. A030308.

Programs

  • Haskell
    a036990 n = a036990_list !! (n-1)
    a036990_list = filter ((== 1) . a036989) [0..]
    -- Reinhard Zumkeller, Jul 31 2013
  • Mathematica
    fQ[n_] := Block[{od = ev = k = 0, id = Reverse@IntegerDigits[n, 2], lmt = Floor@Log[2, n] + 1}, While[k < lmt && od < ev + 1, If[OddQ@id[[k + 1]], od++, ev++ ]; k++ ]; If[k == lmt && od < ev + 1, True, False]]; Select[ Range[0, 204, 2], fQ@# &] (* Robert G. Wilson v, Jan 11 2007 *)
    (* b = A036989 *) b[0] = 1; b[n_?EvenQ] := b[n] = Max[b[n/2]-1, 1]; b[n_] := b[n] = b[(n-1)/2]+1; Select[Range[0, 300, 2], b[#] == 1 &] (* Jean-François Alcover, Nov 05 2013, after Reinhard Zumkeller *)

Formula

Extensions

More terms from Erich Friedman.

A003160 a(1) = a(2) = 1, a(n) = n - a(a(n-1)) - a(a(n-2)).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Sequence of indices n where a(n-1) < a(n) appears to be given by A003156. - Joerg Arndt, May 11 2010
The number n appears A080426(n+1) times. - John Keith, Dec 31 2020

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a003160 n = a003160_list !! (n-1)
    a003160_list = 1 : 1 : zipWith (-) [3..] (zipWith (+) xs $ tail xs)
       where xs = map a003160 a003160_list
    -- Reinhard Zumkeller, Aug 02 2013
    
  • Mathematica
    Block[{a = {1, 1}}, Do[AppendTo[a, i - a[[ a[[-1]] ]] - a[[ a[[-2]] ]] ], {i, 3, 76}]; a] (* Michael De Vlieger, Dec 31 2020 *)
  • PARI
    a(n)=if(n<3,1,n-a(a(n-1))-a(a(n-2)))
    
  • SageMath
    @CachedFunction
    def a(n): return 1 if (n<3) else n - a(a(n-1)) - a(a(n-2))
    [a(n) for n in range(1, 81)] # G. C. Greubel, Nov 06 2022

Formula

a(n) is asymptotic to n/2.
Conjecture: a(n) = E/2 where we start with A := n + 1, B := 0, L := A085423(A), C := A000975(L-1), D := 0, E := C and until A = B consecutively apply B := A, A := 2*C - A - (L mod 2) + 2, L := A085423(A), C := A000975(L-1), D := D + 1, E := (1 + [A = B])*E + (-1)^D*C. - Mikhail Kurkov, May 12 2025

Extensions

Edited by Benoit Cloitre, Jan 01 2003

A095773 a(1)=1, a(n) = 1 + a(n - a(a(a(n-1)))).

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Jun 05 2004

Keywords

Comments

A generalization of Golomb's sequence.
a(10^n): 1, 6, 26, 124, 611, 2963, 14172, ...

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = 1 + a[n - a[a[a[n - 1]]]]; Table[ a[n], {n, 80}] (* Robert G. Wilson v, Jun 09 2004 *)
  • PARI
    v=vector(1000,j,1);for(n=2,1000,g=v[n-v[v[v[n-1]]]]+1;v[n]=g);a(n)=v[n]

Formula

Is a(n) asymptotic to r^(r-1)*n^r where r is the positive root of x^3+x=1 and so r=0.682327803828019327...?
Showing 1-3 of 3 results.