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.

Previous Showing 11-19 of 19 results.

A329934 a(1)=1, a(2)=1, a(n) = (number of times a(n-1) has appeared before) + (number of times a(n-2) has appeared before).

Original entry on oeis.org

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

Views

Author

Joshua Oliver, Nov 24 2019

Keywords

Comments

Conjecture: This sequence grows logarithmically.

Examples

			a(n)=4 where n=3 because 1 (a(n-1)) has appeared twice before, and 1 (a(n-2)) has appeared twice before as well. 2+2 = 4.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, 0, b(n-1)+x^a(n)) end:
    a:= proc(n) option remember; `if`(n<3, 1, (p->
          coeff(p, x, a(n-1))+coeff(p, x, a(n-2)))(b(n-1)))
        end:
    seq(a(n), n=1..120);  # Alois P. Heinz, Nov 24 2019
  • Mathematica
    A={1,1};For[n=3,n<=81,n++,A=Append[A,Sum[Count[Table[Part[A,i],{i,1,n-1}],Part[A,n-k]],{k,2}]]];A
  • PARI
    o=vector(17); for (n=1, 81, print1 (v=if (n<3, 1, o[pp]+o[p]) ", "); o[v]++; [pp,p]=[p,v]) \\ Rémy Sigrist, Nov 27 2019

A330332 a(n) = (number of times a(n-1) has already appeared) + (number of times a(n-2) has already appeared) + (number of times a(n-3) has already appeared), starting with a(n) = n for n<3.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Dec 14 2019

Keywords

Comments

Generalizes A316774, which looks at the frequencies of the two previous terms. Here we look at three previous terms.
If we look at just one previous term, we get 0, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, ..., which is A133622 prefixed by 0, 1, or A152271 with its initial 1 changed to 0.

Crossrefs

Programs

  • Maple
    b:= proc() 0 end:
    a:= proc(n) option remember; local t;
          t:= `if`(n<3, n, b(a(n-1))+b(a(n-2))+b(a(n-3)));
          b(t):= b(t)+1; t
        end:
    [seq(a(n), n=0..200)]; # Following Alois P. Heinz's program for A316774
  • Mathematica
    b[_] = 0;
    a[n_] := a[n] = Module[{t}, t = If[n<3, n, b[a[n-1]] + b[a[n-2]] + b[a[n-3]]]; b[t]++; t];
    a /@ Range[0, 200] (* Jean-François Alcover, Nov 09 2020, after Maple *)

A330448 a(n) = A330447(n) - A316905(n).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 8, 0, 4, 0, 0, 3, 0, 0, 0, 0, 0, 0, 23, 0, 45, 0, 0, 0, 74, 8, 0, 56, 47, 0, 0, 105, 67, 85, 64, 0, 130, 45, 111, 0, 21, 136, 74, 98, 0, 97, 0, 0, 35, 0, 0, 0, 37, 0, 0, 0, 52, 0, 104, 52, 67, 0, 0, 70, 0, 0, 0, 0, 0, 152, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Alois P. Heinz, Dec 15 2019

Keywords

Crossrefs

Programs

  • Maple
    b:= proc() 0 end:
    g:= proc(n) option remember; local t;
          t:= `if`(n<2, n, b(g(n-1))+b(g(n-2)));
          b(t):= b(t)+1; t
        end:
    f:= proc() local t, a; t, a:= -1, proc() -1 end;
          proc(n) local h;
            while a(n) = -1 do
              t:= t+1; h:= g(t);
              if a(h) = -1 then a(h):= t fi
            od; a(n)
          end
        end():
    h:= proc(n) option remember; `if`(n<0, 0,
          max(h(n-1), f(n)))
        end:
    a:= n-> h(n)-f(n):
    seq(a(n), n=0..100);
  • Mathematica
    b[_] = 0;
    g[n_] := g[n] = Module[{t}, t = If[n < 2, n, b[g[n - 1]] + b[g[n - 2]]]; b[t] = b[t] + 1; t];
    f[n_] := Module[{t, a}, t = -1; a[_] = -1; Module[{h}, While[a[n] == -1, t = t + 1; h = g[t]; If[a[h] == -1, a[h] = t]]; a[n]]];
    h[n_] := h[n] = If[n < 0, 0, Max[h[n - 1], f[n]]];
    a[n_] := h[n] - f[n];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Nov 13 2023, after Alois P. Heinz *)

A317015 a(n) = n for n < 2, a(n) = a(freq(a(n-1),n)) + a(freq(a(n-2),n)) for n >= 2, where freq(i, j) is the number of times i appears in the first j terms.

Original entry on oeis.org

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

Views

Author

Altug Alkan, Jul 19 2018

Keywords

Comments

Inspired by A316774.
Let b(n) = n for n < 3, b(n) = b(freq(b(n-1),n)) for n >= 3, where freq(i, j) is the number of times i appears in the first j terms and b(n) has offset 0. For n >= 1, b(n) - 1 are 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, ... (cf. A093879). While b(n) has one parent spot, this entry (a(n)) has two parent spots which are freq(a(n-1),n) and freq(a(n-2),n).

Crossrefs

Cf. A316774.

Programs

  • Maple
    b:= proc() 0 end:
    a:= proc(n) option remember; local t;
          t:= `if`(n<2, n, a(b(a(n-1)))+a(b(a(n-2))));
          b(t):= b(t)+1; t
        end:
    seq(a(n), n=0..200);  # Alois P. Heinz, Jul 19 2018
  • Mathematica
    Nest[Append[#, #[[Count[#, #[[-1]] ] + 1]] + #[[Count[#, #[[-2]] ] + 1 ]] ] &, {0, 1}, 95] (* Michael De Vlieger, Jul 20 2018 *)

A317127 a(0) = a(1) = a(2) = 1; for n >= 3, a(n) = freq(a(n-1),n) + freq(a(n-3),n) where freq(i, j) is the number of times i appears in the terms a(0) .. a(j-1).

Original entry on oeis.org

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

Views

Author

Altug Alkan, Jul 21 2018

Keywords

Comments

Inspired by A316774.
In this sequence, it is obvious that we have exactly three 1’s that are a(0) = a(1) = a(2) = 1. Can we determine the frequency characteristics of some other positive integers? For example, are there infinitely many 2's in this sequence?

Crossrefs

Cf. A316774.

Programs

  • Maple
    b:= proc() 0 end:
    a:= proc(n) option remember; local t;
          t:= `if`(n<3, 1, b(a(n-1))+b(a(n-3)));
          b(t):= b(t)+1; t
        end:
    seq(a(n), n=0..100); # after Alois P. Heinz at A316774
  • Mathematica
    c = <||>; f[n_] := If[KeyExistsQ[c,n],c[n],0]; a[n_] := a[n] = Block[{v}, v = If[n<3, 1, f[a[n-1]] + f[a[n-3]]]; If[f[v]>0, c[v] = c[v]+1, c[v]=1]; v]; Array[a, 93, 0] (* Giovanni Resta, Jul 24 2018 *)
  • PARI
    up_to = 5000;
    listA317127off1(up_to) = { my(v = vector(up_to),c); v[1] = v[2] = v[3] = 1; for(n=4,up_to, c=0; for(k=1,(n-1), c += ((v[k]==v[n-1])+(v[k]==v[n-3]))); v[n] = c); (v); };
    listA317127off1(up_to) = { my(v = vector(up_to), m = Map(), c); v[1] = v[2] = v[3] = 1; mapput(m, 1, 3); for(n=4,up_to, c = (mapget(m, v[n-1])+mapget(m,v[n-3])); v[n] = c; mapput(m, c, if(!mapisdefined(m, c), 1, 1+mapget(m, c)))); (v); }; \\ Faster!
    v317127 = listA317127off1(1+up_to);
    A317127(n) = v317127[1+n]; \\ Antti Karttunen, Jul 23 2018

A330588 a(n) is the first index m such that A330439(m) = n.

Original entry on oeis.org

0, 3, 6, 13, 21, 23, 27, 33, 46, 67, 81, 104, 107, 114, 129, 166, 169, 172, 193, 261, 267, 276, 287, 311, 373, 430, 457, 478, 485, 590, 596, 656, 691, 768, 789, 796, 873, 941, 969, 1047, 1093, 1149, 1170, 1239, 1303, 1349, 1491, 1533, 1555, 1567, 1805, 1808
Offset: 1

Views

Author

Alois P. Heinz, Dec 18 2019

Keywords

Crossrefs

Row n=1 of A330587.

Programs

  • Maple
    b:= proc() 0 end:
    g:= proc(n) option remember; local t;
          t:= `if`(n<2, n, b(g(n-1))+b(g(n-2)));
          b(t):= b(t)+1; t
        end:
    f:= proc(n) option remember; b(g(n)) end:
    a:= proc() local l, t; t, l:= -1, proc() -1 end;
          proc(k) local h;
            while l(k)<0 do t:= t+1; h:= f(t);
              if l(h)<0 then l(h):= t fi
            od: l(k)
          end
        end():
    seq(a(n), n=1..60);
  • Mathematica
    b[_] = 0;
    g[n_] := g[n] = Module[{t}, t = If[n < 2, n, b[g[n-1]] + b[g[n-2]]]; b[t]++; t];
    f[n_] := f[n] = b[g[n]];
    A[n_, k_] := Module[{l, t = -1, h}, l[_] = {}; While[Length[l[k]] < n, t++; h = f[t]; AppendTo[l[h], t]]; l[k][[n]]];
    a[k_] := A[1, k];
    Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Dec 13 2023, after Alois P. Heinz *)

A330589 The n-th index m such that A330439(m) = n.

Original entry on oeis.org

0, 7, 12, 29, 59, 72, 85, 142, 190, 205, 238, 270, 305, 318, 402, 492, 619, 652, 795, 845, 950, 996, 1121, 1163, 1228, 1393, 1548, 1662, 1756, 1920, 1937, 2106, 2202, 2351, 2448, 2555, 2594, 2707, 2788, 3254, 3420, 3466, 3663, 3974, 4136, 4282, 4363, 4621, 4732
Offset: 1

Views

Author

Alois P. Heinz, Dec 18 2019

Keywords

Crossrefs

Main diagonal of A330587.

Programs

  • Maple
    b:= proc() 0 end:
    g:= proc(n) option remember; local t;
          t:= `if`(n<2, n, b(g(n-1))+b(g(n-2)));
          b(t):= b(t)+1; t
        end:
    f:= proc(n) option remember; b(g(n)) end:
    a:= proc() local a, b, t; a, b, t:= proc() end, proc() 0 end, -1;
          proc(k) local h;
            while b(k)
    				

Formula

a(n) = A330587(n,n).

A337063 a(n) = 1 for n < 2; a(n) = freq(a(n-1),n) * freq(a(n-2),n) for n >= 2, where freq(i,j) is the number of times i appears in [a(0),a(1),...,a(j-1)].

Original entry on oeis.org

1, 1, 4, 2, 1, 3, 3, 4, 4, 9, 3, 3, 16, 4, 4, 25, 5, 1, 4, 24, 6, 1, 5, 10, 2, 2, 9, 6, 4, 14, 7, 1, 6, 18, 3, 5, 15, 3, 6, 24, 8, 2, 4, 32, 8, 2, 10, 10, 9, 9, 16, 8, 6, 15, 10, 8, 16, 12, 3, 7, 14, 4, 18, 18, 9, 15, 15, 16, 16, 25, 10, 10, 36, 6, 6, 49, 7, 3
Offset: 0

Views

Author

Alex Lauber, Aug 13 2020

Keywords

Comments

Does this sequence contain every number?
Does each number appear only a finite number of times?
Starting with a(0)=0 and a(1)=1 gives the same sequence offset by one place.

Examples

			a(2) = occurrences of a(1)=1 in [a(0), a(1)]=[1, 1] * occurrences of a(0)=1 in [a(0), a(1)]=[1, 1] = 2*2 = 4.
a(3) = occurrences of a(2)=4 in [a(0), a(1), a(2)]=[1, 1, 4] * occurrences of a(1)=1 in [a(0), a(1), a(2)]=[1, 1, 4] = 1*2 = 2.
		

Crossrefs

Cf. A337064 (index of first occurrence of n).
Cf. A316774 (which adds the two previous terms), A316973.

Programs

  • PARI
    See Links section.

Extensions

More terms from Rémy Sigrist, Sep 18 2020

A337064 a(n) is the index of the first occurrence of n in A337063, or -1 if n never appears.

Original entry on oeis.org

0, 3, 5, 2, 16, 20, 30, 40, 9, 23, 90, 57, 110, 29, 36, 12, 220, 33, 342, 230, 163, 179, 494, 19, 15, 109, 128, 88, 694, 82, 744, 43, 125, 219, 169, 72, 1060, 373, 253, 85, 1205, 113, 1346, 151, 207, 564, 1726, 131, 75, 332
Offset: 1

Views

Author

Alex Lauber, Aug 13 2020

Keywords

Comments

419 is the lowest number that does not appear in the first 100000 terms of A337063.

Examples

			A337063 starts {1, 1, 4, 2, ...} so a(2) = 3.
		

Crossrefs

Cf. A337063, A316774 (adds the two previous terms), A316973 (similar index for the addition sequence).

Programs

  • PARI
    See Links section.
Previous Showing 11-19 of 19 results.