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

A108686 Increasing sequence all of whose successive digits are the digits of A108202.

Original entry on oeis.org

0, 10, 21, 30, 42, 51, 63, 70, 84, 92, 1501, 1613, 1720, 1834, 1942, 115510, 611176, 1183119
Offset: 0

Views

Author

Alexandre Wajnberg, Jun 18 2005

Keywords

Comments

The even-indexed digits are the digits of the "natural counting digits": 1, 2, 3, ... 8, 9, 1, 0, 1, 1, 1, 2, 1, 3 ...

Examples

			a(11)=1501 and not 150 because then the sequence grows quicker: 150 1161 31720 183419 421155 1061117 6118311 ...
		

Crossrefs

A025480 a(2n) = n, a(2n+1) = a(n).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

These are the Grundy values or nim-values for heaps of n beans in the game where you're allowed to take up to half of the beans in a heap. - R. K. Guy, Mar 30 2006. See Levine 2004/2006 for more about this. - N. J. A. Sloane, Aug 14 2016
When n > 0 is written as (2k+1)*2^j then k = a(n-1) and j = A007814(n), so: when n is written as (2k+1)*2^j-1 then k = a(n) and j = A007814(n+1), when n > 1 is written as (2k+1)*2^j+1 then k = a(n-2) and j = A007814(n-1). - Henry Bottomley, Mar 02 2000 [sequence id corrected by Peter Munn, Jun 22 2022]
According to the comment from Deuard Worthen (see Example section), this may be regarded as a triangle where row r=1,2,3,... has length 2^(r-1) and values T(r,2k-1)=T(r-1,k), T(r,2k)=2^(r-1)+k-1; i.e., previous row gives 1st, 3rd, 5th, ... term and 2nd, 4th, ... terms are numbers 2^(r-1),...,2^r-1 (i.e., those following the last one from the previous row). - M. F. Hasler, May 03 2008
Let StB be a Stern-Brocot tree hanging between (pseudo)fractions Left and Right, then StB(1) = mediant(Left,Right) and for n>1: StB(n) = if a(n-1)<>0 and a(n)<>0 then mediant(StB(a(n-1)),StB(a(n))) else if a(n)=0 then mediant(StB(a(n-1)),Right) else mediant(Left,StB(a(n-1))), where mediant(q1,q2) = ((numerator(q1)+numerator(q2)) / (denominator(q1)+denominator(q2))). - Reinhard Zumkeller, Dec 22 2008
This sequence is the unique fixed point of the function (a(0), a(1), a(2), ...) |--> (0, a(0), 1, a(1), 2, a(2), ...) which interleaves the nonnegative integers between the elements of a sequence. - Cale Gibbard (cgibbard(AT)gmail.com), Nov 18 2009
Also the number of remaining survivors in a Josephus problem after the person originally first in line has been eliminated (see A225381). - Marcus Hedbring, May 18 2013
A fractal sequence - see Levine 2004/2006. - N. J. A. Sloane, Aug 14 2016
From David James Sycamore, Apr 29 2020: (Start)
One of a family of fractal sequences, S_k; defined as follows for k >= 2: a(k*n) = n, a(k*n+r) = a((k-1)*n + (r-1)), r = 1..(k-1). S_2 is A025480; S_3 gives: a(3*n) = n, a(3*n + 1) = a(2*n), a(3*n + 2) = a(2*n + 1), which is A263390.
The subsequence of all nonzero terms is A131987. (End)
Similar to but different from A108202. - N. J. A. Sloane, Nov 26 2020
This sequence can be otherwise defined in two alternative (but related) ways, with a(0)=0, as follows: (i) If a(n) is a novel term, then a(n+1) = a(a(n)); if a(n) has been seen before, most recently at a(m), then a(n+1) = n-m (as in A181391). (ii) As above for novel a(n), then if a(n) has been seen before, a(n+1) = smallest k < a(n) which is not already a term. - David James Sycamore, Jul 13 2021
From a binary perspective, the sequence can be seen as even,odd pairs where the odd value is the previous even value, dropping the rightmost bits up to and including the lowest zero bit, aka right-shifted past the lowest clear bit. E.g., (5)101 -> 1, (17)10001 -> (4)100, (29)11101 -> (7)111, (39)100111 -> (2)10. - Joe Nellis, Oct 09 2022

Examples

			From Deuard Worthen (deuard(AT)raytheon.com), Jan 27 2006: (Start)
The sequence can be constructed as a triangle as:
  0
  0  1
  0  2  1  3
  0  4  2  5  1  6  3  7
  0  8  4  9  2 10  5 11  1 12  6 13  3 14  7 15
  ...
At each stage we interleave the next 2^m numbers in the previous row. (End)
Left=0/1, Right=1/0: StB=A007305/A047679; Left=0/1, Right=1/1: StB=A007305/A007306; Left=1/3, Right=2/3: StB=A153161/A153162. - _Reinhard Zumkeller_, Dec 22 2008
		

References

  • L. Levine, Fractal sequences and restricted Nim, Ars Combin. 80 (2006), 113-127.

Crossrefs

Programs

  • Haskell
    import Data.List
    interleave xs ys = concat . transpose $ [xs,ys]
    a025480 = interleave [0..] a025480
    -- Cale Gibbard, Nov 18 2009
    
  • Haskell
    Cf. comments by Worthen and Hasler.
    import Data.List (transpose)
    a025480 n k = a025480_tabf !! n !! k
    a025480_row n = a025480_tabf !! n
    a025480_tabf = iterate (\xs -> concat $
       transpose [xs, [length xs .. 2 * length xs - 1]]) [0]
    a025480_list = concat $ a025480_tabf
    -- Reinhard Zumkeller, Apr 29 2012
    
  • Maple
    A025480 := proc(n)
        option remember ;
        if type(n,'even') then
            n/2 ;
        else
            procname((n-1)/2) ;
        end if;
    end proc:
    seq(A025480(n),n=0..100) ; # R. J. Mathar, Jul 16 2020
  • Mathematica
    a[n_] := a[n] = If[OddQ@n, a[(n - 1)/2], n/2]; Table[ a[n], {n, 0, 83}] (* Robert G. Wilson v, Mar 30 2006 *)
    Table[BitShiftRight[n, IntegerExponent[n, 2] + 1], {n, 100}] (* IWABUCHI Yu(u)ki, Oct 13 2012 *)
  • PARI
    a(n)={while(n%2,n\=2);n\2} \\ M. F. Hasler, May 03 2008
    
  • PARI
    A025480(n)=n>>valuation(n*2+2,2) \\ M. F. Hasler, Apr 12 2012
    
  • Python
    def A025480(n): return n>>((~(n+1)&n).bit_length()+1) # Chai Wah Wu, Jul 13 2022
  • Sage
    A025480 = lambda n: odd_part(n+1)//2
    [A025480(n) for n in (0..83)] # Peter Luschny, May 20 2014
    

Formula

a(n) = A003602(n+1) - 1. [Corrected by Max Alekseyev, May 05 2022]
a(n) = (A000265(n+1)-1)/2 = ((n+1)/A006519(n+1)-1)/2.
a(n) = A153733(n)/2. - Reinhard Zumkeller, Dec 31 2008
2^A007814(n+1)*(2*a(n)+1) = n+1. (See functions hd, tl and cons in [Paul Tarau 2009].) - Paul Tarau (paul.tarau(AT)gmail.com), Mar 21 2010
a(3*n + 1) = A173732(n). - Reinhard Zumkeller, Apr 29 2012
a((2*n+1)*2^p-1) = n, p >= 0 and n >= 0. - Johannes W. Meijer, Jan 24 2013
a(n) = n - A225381(n). - Marcus Hedbring, May 18 2013
G.f.: -1/(1-x) + Sum_{k>=0} x^(2^k-1)/(1-2*x^2^(k+1)+x^2^(k+2)). - Ralf Stephan, May 19 2013
a(n) = A049084(A181363(n+1)). - Reinhard Zumkeller, Mar 22 2014
a(n) = floor(n / 2^A001511(n+1)). - Adam Shelly, Mar 05 2019
Recursion: a(0) = 0; a(n + 1) = a(a(n)) if a(n) is a first occurrence of a term, else a(n + 1) = n - a(n-1). - David James Sycamore, Apr 29 2020
a(n) * 2^(A007814(n+1)+1) + 2^A007814(n+1) - 1 = n (equivalent to the formula given in the comment by Paul Tarau). - Ruud H.G. van Tol, Apr 14 2023
Sum_{k=1..n} a(k) = n^2/6 + O(n). - Amiram Eldar, Aug 07 2023

Extensions

Edited by M. F. Hasler, Mar 16 2018

A108685 Hidden fractal sequence: increasing sequence all of whose successive digits are the digits of the fractal sequence A025480 (which is built upon the natural counting numbers).

Original entry on oeis.org

0, 10, 21, 30, 42, 51, 63, 70, 84, 92, 105, 111, 126, 133, 147, 150, 168, 174, 189, 192, 2010, 2152, 2112, 3124, 12256, 26132, 73281, 429730, 1531032, 1633834, 1735436, 1837938, 1939240, 2041104, 2214354, 4224511
Offset: 0

Views

Author

Alexandre Wajnberg, Jun 18 2005

Keywords

Crossrefs

A108712 A fractal sequence, defined by a(2n-1) = A007376(n) (the almost-natural numbers), a(2n) = a(n).

Original entry on oeis.org

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

Views

Author

Eric Angelini, Jun 20 2005

Keywords

Comments

Start saying "1" and erase, as soon as they appear, the digits spelling the natural numbers. The result is the sequence itself. [The definition in the name does not yield this property - see details in the example section.]
Sequence based on the same skeleton as A108202 (the natural counting digits) but beginning with 1 instead of zero; with n increasing, the apparent correlation between the two sequences disappears.

Examples

			Say "1" and erase the first "1", then say "2" and erase the first "2" (leaving all other digits where they are), then say "3" and erase the first "3", etc. When it comes to "10" erase the first "1" and then the closest "0", etc. The digits to erase when the count comes to "16", for example, are next to one another. [If we apply to the sequence the process described here, the result is a different sequence, b. To get a match with the first 76 terms, we take "first" to mean "next (after the most recent erasure)". Nevertheless, we find a(76), ..., a(80) = 1,4,1,2,3; b(76), ..., b(80) = 1,1,2,4,3. - _Kevin Ryde_ and _Peter Munn_, Nov 21 2020]
From _Peter Munn_, Nov 21 2020: (Start)
Start of table showing the interleaving with the almost-natural numbers, A007376:
   n  a(n)  A007376    a(n/2)
            ((n+1)/2)
   1   1       1
   2   1                 1
   3   2       2
   4   1                 1
   5   3       3
   6   2                 2
   7   4       4
   8   1                 1
   9   5       5
  10   3                 3
  11   6       6
  12   2                 2
  13   7       7
  14   4                 4
  15   8       8
  16   1                 1
  17   9       9
  18   5                 5
  19   1       1
  20   3                 3
  21   0       0
(End)
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = 9i*10^(i - 1) + l; i++ ]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + 10^(i - 1); If[p != 0, IntegerDigits[q][[p]], Mod[q - 1, 10]]]; a[n_] := a[n] = If[EvenQ[n], a[n/2], f[(n + 1)/2]]; Table[ a[n], {n, 105}] (* Robert G. Wilson v, Jun 24 2005 *)

Formula

a(2n-1) = A007376(n), a(2n) = a(n).
a(n) = A033307(A025480(n-1)) = A007376(A025480(n-1)+1). - Kevin Ryde, Nov 21 2020

Extensions

Additional comments from Robert G. Wilson v and Alexandre Wajnberg, Jun 24 2005
Incorrect formula deleted by Peter Munn, Nov 19 2020

A108715 First differences of A025480.

Original entry on oeis.org

0, 1, -1, 2, -1, 2, -3, 4, -2, 3, -4, 5, -3, 4, -7, 8, -4, 5, -7, 8, -5, 6, -10, 11, -6, 7, -10, 11, -7, 8, -15, 16, -8, 9, -13, 14, -9, 10, -17, 18, -10, 11, -16, 17, -11, 12, -22, 23, -12, 13, -19, 20, -13, 14, -24, 25, -14, 15, -22, 23, -15, 16, -31, 32, -16, 17, -25, 26, -17, 18, -31, 32, -18, 19, -28, 29, -19, 20, -37, 38, -20
Offset: 0

Views

Author

Alexandre Wajnberg, Jun 20 2005

Keywords

Comments

Pattern: cycles of four successive terms. [this needs to be clarified, Joerg Arndt, Apr 16 2011]

Crossrefs

Formula

From Paul Curtz, Apr 15 2011: (Start)
a(A000225(n)) = A131577(n).
2 * a(n) = A000265(n+1) - A000265(n).
a(2*n) + a(1+2*n) = 1.
a(4*n) = -n, a(1+4*n) = n.
a(2+8*n) = 1 + 3*n, a(3+8*n) = 2+3*n.
a(2+2*n) = a(n) - a(1+2*n). (End)
Showing 1-5 of 5 results.