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.

A317442 a(1) = a(2) = 1; for n >= 3, a(n) = a(t(n)) + a(n-t(n)) where t = A000195.

Original entry on oeis.org

1, 1, 2, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, 26, 26, 27, 28, 28, 29, 30, 30, 31, 32, 32, 33, 34, 34, 35, 36, 37, 37, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 46, 46, 47, 48, 49, 49, 50, 51, 52
Offset: 1

Views

Author

Altug Alkan, Jul 28 2018

Keywords

Comments

This sequence hits every positive integer.

Crossrefs

Programs

  • Mathematica
    Nest[Function[{a, n}, Append[a, a[[Floor@ Log@ n]] + a[[n - Floor@ Log@ n]] ] ] @@ {#, Length@ # + 1} &, {1, 1}, 74] (* Michael De Vlieger, Jul 30 2018 *)
  • PARI
    q=vector(100); for(n=1, 2, q[n]=1); for(n=3, #q, q[n]=q[floor(log(n))] + q[n-floor(log(n))]); q

Formula

a(n+1) - a(n) = 0 or 1 for all n >= 1.

A321211 Let S be the sequence of integer sets defined by these rules: S(1) = {1}, and for any n > 1, S(n) = {n} U S(pi(n)) U S(n - pi(n)) (where X U Y denotes the union of the sets X and Y and pi is the prime counting function); a(n) = the number of elements of S(n).

Original entry on oeis.org

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

Views

Author

Altug Alkan and Rémy Sigrist, Oct 31 2018

Keywords

Comments

The prime counting function corresponds to A000720.
This sequence has similarities with A294991; a(n) gives approximately the number of intermediate terms to consider in order to compute A316434(n) using the formula of its definition.

Examples

			The first terms, alongside pi(n) and S(n), are:
  n   a(n)  pi(n)  S(n)
  --  ----  -----  ----------------------
   1     1      0  {1}
   2     2      1  {1, 2}
   3     3      2  {1, 2, 3}
   4     3      2  {1, 2, 4}
   5     4      3  {1, 2, 3, 5}
   6     4      3  {1, 2, 3, 6}
   7     5      4  {1, 2, 3, 4, 7}
   8     4      4  {1, 2, 4, 8}
   9     6      4  {1, 2, 3, 4, 5, 9}
  10     6      4  {1, 2, 3, 4, 6, 10}
  11     6      5  {1, 2, 3, 5, 6, 11}
  12     7      5  {1, 2, 3, 4, 5, 7, 12}
		

Crossrefs

Programs

  • PARI
    a(n) = my (v=Set([-1, -n]), i=1); while (v[i]!=-1, my (pi=primepi(-v[i])); v=setunion(v, Set([v[i]+pi, -pi])); i++); #v

A316942 a(n) = n - a(pi(n)) - a(n-pi(n)) with a(1) = a(2) = 1, where pi = A000720.

Original entry on oeis.org

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

Views

Author

Altug Alkan, Jul 17 2018

Keywords

Comments

This sequence hits every positive integer.

Crossrefs

Programs

  • Mathematica
    Nest[Append[#2, #1 - #2[[PrimePi[#1] ]] - #2[[#1 - PrimePi[#1] ]] ] & @@ {Length@ # + 1, #} &, {1, 1}, 73] (* Michael De Vlieger, Jul 20 2018 *)
  • PARI
    q=vector(75); for(n=1, 2, q[n] = 1); for(n=3, #q, q[n] = n - q[primepi(n)] - q[n-primepi(n)]); q

Formula

a(n) = n - a(A000720(n)) - a(A062298(n)) with a(1) = a(2) = 1.
a(n+1) - a(n) = 0 or 1 for all n >= 1.
Conjecture : lim_{n->infinity} a(n)/n = 1/2.

A336095 a(n) = a(f(n)) + a(n-f(n)) with a(1) = a(2) = 1 (f = A000006).

Original entry on oeis.org

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

Views

Author

Altug Alkan, Jul 08 2020

Keywords

Comments

If Legendre's conjecture is true, then this sequence hits every positive integer.
Does the lim_{n->infinity} a(n)/n exist? If it exists, what is its value?

Crossrefs

Programs

  • Mathematica
    f[n_] := IntegerPart[Sqrt[Prime[n]]]; a[1] = a[2] = 1; a[n_] := a[n] = a[(f1 = f[n])] + a[n - f1]; Array[a, 100] (* Amiram Eldar, Jul 08 2020 *)
  • PARI
    q=vector(10^2); for(n=1, 2, q[n] = 1); for(n=3, #q, q[n] = q[sqrtint(prime(n))] + q[n- sqrtint(prime(n))]); q
Showing 1-4 of 4 results.