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-10 of 123 results. Next

A171865 Positions of 0's in A181391.

Original entry on oeis.org

1, 2, 4, 6, 11, 13, 18, 21, 25, 31, 36, 42, 45, 48, 53, 57, 60, 64, 67, 73, 82, 85, 90, 93, 99, 102, 106, 111, 117, 122, 126, 130, 135, 139, 143, 149, 153, 157, 163, 169, 174, 180, 184, 188, 197, 200, 203, 209, 213, 216, 226, 229, 233, 237, 243, 247, 252, 255, 258, 264, 270
Offset: 1

Views

Author

N. J. A. Sloane, Oct 17 2010

Keywords

Comments

A181391(a(n)) = 0; the sequence is infinite, proof by Jan Ritsema van Eck in comments in A181391.

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a171865 n = a171865_list !! (n-1)
    a171865_list = map (+ 1) $ elemIndices 0 a181391_list
    -- Reinhard Zumkeller, Oct 31 2011
    
  • Python
    A181391_list, A171865_list = [0, 0], [1,2]
    for n in range(1, 10**4):
        for m in range(n-1, -1, -1):
            if A181391_list[m] == A181391_list[n]:
                A181391_list.append(n-m)
                break
        else:
            A181391_list.append(0)
            A171865_list.append(n+2) # Chai Wah Wu, Jan 02 2015

A171911 Van Eck's sequence (cf. A181391), but starting with a(1) = 1.

Original entry on oeis.org

1, 0, 0, 1, 3, 0, 3, 2, 0, 3, 3, 1, 8, 0, 5, 0, 2, 9, 0, 3, 9, 3, 2, 6, 0, 6, 2, 4, 0, 4, 2, 4, 2, 2, 1, 23, 0, 8, 25, 0, 3, 19, 0, 3, 3, 1, 11, 0, 5, 34, 0, 3, 7, 0, 3, 3, 1, 11, 11, 1, 3, 5, 13, 0, 10, 0, 2, 33, 0, 3, 9, 50, 0, 4, 42, 0, 3, 7, 25, 40, 0, 5, 20, 0, 3, 8, 48, 0, 4, 15
Offset: 1

Views

Author

N. J. A. Sloane, Oct 22 2010

Keywords

Comments

After the initial value, the sequence is extended by a(n+1) = min { k > 0: a(n-k) = a(n) } or 0 if no such k exists, i.e., if a(n) did not appear earlier.

Crossrefs

Cf. A181391, A171912, A171913, A171914, A171915, A171916, A171917, A171918 (same but starting with 0, 2, ..., 8).

Programs

  • Mathematica
    t = {1};
    Do[
    d = Quiet[Check[Position[t, Last[t]][[-2]][[1]], 0], Part::partw];
    If[d == 0, x = 0, x = Length[t] - d];
    AppendTo[t, x], 100]
    t (* Horst H. Manninger, Aug 03 2020 *)
  • PARI
    A171911_vec(N,a=1,i=Map())={vector(N,n,a=if(n>1,iferr(n-mapget(i,a),E,0)+mapput(i,a,n),a))} \\ M. F. Hasler, Jun 11 2019
  • Python
    A171911_list, l = [1, 0], 0
    for n in range(1, 10**4):
        for m in range(n-1, -1, -1):
            if A171911_list[m] == l:
                l = n-m
                break
        else:   # break did not occur
            l = 0
        A171911_list.append(l) # Chai Wah Wu, Jan 02 2015
    

Extensions

Edited by M. F. Hasler, Jun 11 2019

A171898 Forward van Eck transform of A181391.

Original entry on oeis.org

1, 2, 6, 2, 2, 5, 1, 6, 42, 5, 2, 4, 5, 9, 14, 3, 9, 3, 15, 2, 4, 6, 17, 3, 6, 32, 56, 5, 3, 131, 5, 11, 5, 3, 20, 6, 2, 8, 15, 31, 170, 3, 31, 18, 3, 3, 33, 5, 1, 11, 46, 56, 4, 37, 152, 307, 3, 7, 92, 4, 7, 62, 52, 3, 42, 3, 6, 2, 19, 6, 8, 3, 9, 3, 650, 2, 23, 8, 223, 7, 206, 3, 21, 25, 5, 8
Offset: 1

Views

Author

N. J. A. Sloane, Oct 22 2010

Keywords

Comments

Given a sequence a, the forward van Eck transform b is defined as follows: If a(n) also appears again in a later position, let a(m) be the next occurrence, and set b(n)=m-n; otherwise b(n)=0.
This is a permutation of the positive terms in A181391, where each term m > 0 from that sequence is shifted backwards m+1 positions. - Jan Ritsema van Eck, Aug 16 2019
The backwards van Eck transform searches backwards for a repeated value: if a(n) also has appeared in earlier positions, a(m)=a(n) with mR. J. Mathar, Jun 24 2021

Crossrefs

Cf. A181391 (van Eck's sequence), A171899, A171942.

Programs

  • Maple
    ECKf:=proc(a) local b,i,m,n;
    if whattype(a) <> list then RETURN([]); fi:
    b:=[];
    for n from 1 to nops(a)-1 do
    # does a(n) appear again?
    m:=0;
    for i from n+1 to nops(a) do
    if (a[i]=a[n]) then m:=i-n; break; fi
    od:
    b:=[op(b),m];
    od:
    b:=[op(b),0];
    RETURN(b);
    end:
  • Mathematica
    terms = 100;
    m = 14 terms; (* Increase m until no zero appears in the output *)
    ClearAll[b, last]; b[] = 0; last[] = -1; last[0] = 2; nxt = 1;
    Do[hist = last[nxt]; b[n] = nxt; last[nxt] = n; nxt = 0; If[hist > 0, nxt = n - hist], {n, 3, m}];
    A181391 = Array[b, m];
    ECKf[a_List] := Module[{b = {}, i, m, n}, For[n = 1, n <= Length[a]-1, n++, m = 0; For[i = n+1, i <= Length[a], i++, If[a[[i]] == a[[n]], m = i-n; Break[]]]; b = Append[b, m]]; b = Append[b, 0]; Return[b]];
    ECKf[A181391][[;; terms]] (* Jean-François Alcover, Oct 30 2020, after Maple *)

Formula

From Jan Ritsema van Eck, Aug 16 2019: (Start)
A181391(i+a(i)+1) = a(i) for any i, a(i)>0.
Conversely, a(j-A181391(j)-1) = A181391(j) for any j, A181391(j)>0. (End)

A171918 Van Eck sequence (cf. A181391) starting with a(1) = 8.

Original entry on oeis.org

8, 0, 0, 1, 0, 2, 0, 2, 2, 1, 6, 0, 5, 0, 2, 6, 5, 4, 0, 5, 3, 0, 3, 2, 9, 0, 4, 9, 3, 6, 14, 0, 6, 3, 5, 15, 0, 5, 3, 5, 2, 17, 0, 6, 11, 0, 3, 8, 47, 0, 4, 24, 0, 3, 7, 0, 3, 3, 1, 49, 0, 5, 22, 0, 3, 7, 11, 22, 5, 7, 4, 20, 0, 9, 46, 0, 3, 12, 0, 3, 3, 1, 23, 0, 5, 16, 0, 3, 7, 19, 0, 4
Offset: 1

Views

Author

N. J. A. Sloane, Oct 22 2010

Keywords

Comments

A van Eck sequence is defined recursively by a(n+1) = min { k > 0 | a(n-k) = a(n) } or 0 if this set is empty. - M. F. Hasler, Jun 12 2019

Crossrefs

Cf. A181391, A171911, ..., A171917 (same but starting with 0, 1, ..., 7).

Programs

  • PARI
    A171918_vec(N,a=8,i=Map())={vector(N,n,a=if(n>1,iferr(n-mapget(i,a),E,0)+mapput(i,a,n),a))} \\ M. F. Hasler, Jun 11 2019
    
  • Python
    from itertools import count, islice
    def A171918gen():
        yield 8
        b, bdict = 8, {8:(1,)}
        for n in count(2):
            if len(l := bdict[b]) > 1:
                b = n-1-l[-2]
            else:
                b = 0
            if b in bdict:
                bdict[b] = (bdict[b][-1],n)
            else:
                bdict[b] = (n,)
            yield b
    A171918_list = list(islice(A171918gen(),30)) # Chai Wah Wu, Dec 21 2021

Formula

a(n+1) = A181391(n) up to the first occurrence of a(1) = 8 in A181391. - M. F. Hasler, Jun 15 2019

Extensions

Name edited and cross-references added by M. F. Hasler, Jun 12 2019

A171862 Index of first occurrence of n in A181391, or 0 if n never appears.

Original entry on oeis.org

1, 3, 5, 20, 17, 12, 10, 66, 47, 24, 148, 44, 173, 121, 30, 35, 138, 41, 63, 89, 56, 105, 324, 101, 215, 110, 257, 142, 320, 225, 471, 72, 59, 81, 183, 539, 134, 92, 263, 168, 129, 548, 52, 199, 179, 228, 98, 297, 621, 670, 357, 156, 116, 1486, 475
Offset: 0

Views

Author

N. J. A. Sloane, Oct 17 2010

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a171862 n = 1 + fromJust (elemIndex n a181391_list)
    -- Reinhard Zumkeller, Oct 31 2011
  • Mathematica
    nmax = 100;
    seq[m_] := seq[m] = Module[{b, last}, b[] = 0; last[] = -1; last[0] = 2; nxt = 1; Do[hist = last[nxt]; b[n] = nxt; last[nxt] = n; nxt = 0; If[hist > 0, nxt = n - hist], {n, 3, m}];
     A171862 = Array[b, m];
     a[n_] := FirstPosition[A171862, n];
     Table[a[n], {n, 0, nmax}] /. Missing["NotFound"] -> 0 // Flatten
    ];
    seq[m = nmax];
    seq[m = 2 m];
    While[Print["m = ", m]; seq[m] != seq[m/2], m = 2 m;];
    seq[m] (* Jean-François Alcover, Aug 02 2018, borrowing some Maple code from N. J. A. Sloane *)

Extensions

Offset corrected by Reinhard Zumkeller, Oct 31 2011

A171863 Numbers that take a record number of steps to appear in A181391.

Original entry on oeis.org

0, 1, 2, 3, 7, 10, 12, 22, 30, 35, 41, 48, 49, 53, 74, 77, 81, 127, 161, 205, 251, 349, 379, 560, 604, 725, 726, 820, 1037, 1095, 1112, 1145, 1239, 1594, 1673, 1908, 2895, 4391, 4551, 5342, 5404, 5410, 8756, 11054, 12081, 13923, 16635, 17598, 18088, 31960, 38099
Offset: 1

Views

Author

N. J. A. Sloane, Oct 17 2010

Keywords

Comments

Records in A171862 (positions).

Crossrefs

Extensions

a(34) onwards from Benjamin Chaffin, Sep 11 2019

A171951 Positions of 1's in A181391.

Original entry on oeis.org

3, 9, 51, 97, 133, 146, 160, 172, 191, 206, 240, 261, 273, 313, 342, 362, 396, 415, 440, 470, 483, 502, 516, 536, 565, 593, 615, 640, 660, 677, 693, 724, 750, 784, 796, 807, 832, 853, 902, 949, 963, 985, 1009, 1038, 1052, 1073, 1095, 1113, 1177
Offset: 1

Views

Author

N. J. A. Sloane, Oct 29 2010

Keywords

Crossrefs

A171956 Positions of 6's in A181391.

Original entry on oeis.org

10, 15, 29, 32, 43, 74, 77, 100, 118, 150, 164, 170, 171, 181, 193, 210, 221, 244, 265, 271, 272, 305, 311, 312, 317, 332, 346, 419, 444, 453, 457, 459, 463, 465, 467, 485, 506, 547, 597, 607, 613, 614, 619, 644, 653, 664, 697, 707, 717, 719
Offset: 1

Views

Author

N. J. A. Sloane, Oct 29 2010

Keywords

Crossrefs

A171864 Positions in A181391 where the terms listed in A171863 appear.

Original entry on oeis.org

1, 3, 5, 20, 66, 148, 173, 324, 471, 539, 548, 621, 670, 1486, 2109, 2693, 3735, 7574, 7619, 7886, 13191, 15116, 24862, 27717, 29981, 31679, 45110, 59597, 60876, 65607, 78847, 82959, 96998, 102840, 199861, 293758, 368318, 371583, 382472, 440644, 523875, 841338
Offset: 1

Views

Author

N. J. A. Sloane, Oct 17 2010

Keywords

Comments

Records in A171862 (values).

Crossrefs

Extensions

a(34) onwards from Benjamin Chaffin, Sep 11 2019

A171866 Records in A181391 (values).

Original entry on oeis.org

0, 1, 2, 6, 9, 14, 15, 17, 42, 56, 62, 92, 131, 152, 170, 206, 223, 307, 319, 331, 367, 368, 415, 508, 650, 705, 832, 1024, 1086, 1302, 1411, 1582, 1605, 1760, 1800, 1833, 2021, 2028, 2238, 2287, 2368, 2944, 3151, 3323, 3420, 3451, 3815, 4029, 4164, 4175, 4466
Offset: 1

Views

Author

N. J. A. Sloane, Oct 17 2010

Keywords

Crossrefs

Cf. A181391 (Van Eck's sequence).
Showing 1-10 of 123 results. Next