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.

User: William Phoenix Marcum

William Phoenix Marcum's wiki page.

William Phoenix Marcum has authored 4 sequences.

A338637 a(n) is the numerator of f(n) where f(n) = 1/n for n <= 2 and f(2n) = f(n-1)*f(n+1)+1, and f(2n+1) = f(n)*f(n+1)+1 for n > 2.

Original entry on oeis.org

1, 1, 3, 5, 7, 9, 19, 29, 43, 53, 79, 149, 187, 293, 583, 849, 1311, 1601, 2343, 3525, 4315, 8025, 12027, 15029, 28119, 44169, 55303, 109533, 171843, 249781, 495991, 766361, 1115087, 1361297, 2103007, 3075769, 3755239, 5651717, 8267267, 10118237
Offset: 1

Author

William Phoenix Marcum, Nov 04 2020

Keywords

Examples

			f(1) = 1/1, so a(1) = 1.
f(2) = 1/2, so a(2) = 1.
f(3) = f(1) * f(2) + 1 = 3/2, so a(3) = 3.
f(4) = f(1) * f(3) + 1 = 1 * 3/2 + 1 = 5/2, so a(4) = 5.
f(5) = f(2) * f(3) + 1 = 1/2 * 3/2 + 1 = 7/4, so a(5) = 7.
f(n) for n>=1: 1, 1/2, 3/2, 5/2, 7/4, 9/4, 19/4, 29/8, 43/8, 53/8, 79/16, 149/16, 187/16, 293/32, 583/32, 849/32 ...
		

Crossrefs

Denominators are given in A173862.

Programs

  • PARI
    f(n) = if (n<=2, 1/n, my(x=n\2); if (n%2, f(x)*f(x+1)+1, f(x-1)*f(x+1)+1));
    a(n) = numerator(f(n)); \\ Michel Marcus, Nov 05 2020

A337980 When terms first appear in the sequence they are "untouched". Start with a(1)=1. Thereafter, to find a(n), let k = a(n-1). If there is an earlier occurrence a(n-m) = k which is untouched, then a(n) = m and a(n-m) is now "touched". Otherwise, a(n) = 0.

Original entry on oeis.org

1, 0, 0, 2, 0, 3, 0, 3, 3, 2, 7, 0, 6, 0, 3, 7, 6, 5, 0, 6, 4, 0, 4, 3, 10, 0, 5, 10, 4, 7, 15, 0, 7, 4, 6, 16, 0, 6, 4, 6, 3, 18, 0, 7, 12, 0, 4, 9, 0, 4, 4, 2, 43, 0, 6, 16, 21, 0, 5, 33, 0, 4, 12, 19, 0, 5, 8, 0, 4, 8, 4, 3, 32, 0, 7, 32, 4, 7, 4, 3, 9, 34, 0, 10, 57
Offset: 1

Author

William Phoenix Marcum, Oct 05 2020

Keywords

Comments

Similar to the Van Eck sequence A181391, except (1) A181391 starts with a 0 instead of a 1, and (2) in A181391 each nonzero term a(n) = m-1 instead of m as in the definition above.

Examples

			a(1) = 1. There is no untouched 1 before a(1), so a(2) = 0. There is no untouched 0 before a(2), so a(3) = 0. a(2) = 0, so a(4) = 2 and a(2) is marked "touched" (we can't use it again, but it is still in the sequence). No untouched 2 yet, so a(5) = 0. a(2) = 0, but it has been touched, while a(3) = 0, so a(6) = 2.
		

Crossrefs

Cf. A181391.

Programs

  • JavaScript
    function a(n) {
      var seq = [1];
      var accseq = [];
      for (var i = 1; i < n; i++) {
        if (accseq.indexOf(seq[seq.length-1]) == -1) {
          seq.push(0);
        } else {
          seq.push(seq.length-accseq.indexOf(seq[seq.length-1]));
          accseq[accseq.indexOf(seq[seq.length-2])] = null;
        }
        accseq.push(seq[seq.length-2]);
      }
      return seq[seq.length-1];
    }

Formula

b(n)=0 => a(n+1)=0; b(n)>0 => a(n+1)=b(n)+1; where b=A181391. - Jan Ritsema van Eck, Jan 09 2021

A336302 a(n) = n^2 mod ceiling(sqrt(n)).

Original entry on oeis.org

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

Author

William Phoenix Marcum, Oct 05 2020

Keywords

Comments

A pattern emerges for certain values where ceiling(sqrt(n)) is the same.

Crossrefs

Programs

  • Mathematica
    Table[Mod[n^2, Ceiling @ Sqrt[n]], {n, 100}] (* Amiram Eldar, Oct 05 2020 *)
  • PARI
    a(n) = lift(Mod(n, ceil(sqrt(n)))^2); \\ Michel Marcus, Oct 05 2020

Formula

a(n) = A000290(n) mod A003059(n). - Michel Marcus, Oct 05 2020
a(n^2) = 0. - Michel Marcus, Oct 07 2020

A337840 a(n) is the decimal place of the start of the first occurrence of n in the decimal expansion of n^(1/n).

Original entry on oeis.org

0, 4, 10, 1, 38, 6, 9, 4, 12, 17, 26, 0, 264, 144, 107, 101, 101, 4, 78, 68, 36, 86, 11, 17, 147, 151, 205, 50, 55, 26, 307, 88, 94, 180, 177, 61, 113, 244, 280, 37, 110, 38, 285, 101, 124, 223, 243, 25, 86, 116, 66, 77, 146, 283, 3, 60, 20, 82, 27, 146, 82, 140
Offset: 1

Author

William Phoenix Marcum, Sep 25 2020

Keywords

Comments

Does a(n) exist for all n? Some relatively large values: a(1021) = 67714, a(1111) = 64946. - Chai Wah Wu, Oct 07 2020

Examples

			For n = 1, 1^(1/1) = 1.0000000, so a(1) is 0.
For n = 12, 12^(1/12) ~= 1.2300755, so a(12) = 0.
		

Crossrefs

Cf. A177715.
Decimal expansions of some n^(1/n): A002193, A002581, A005534, A011215, A011231, A011247, A011263, A011279, A011295, A011311, A011327, A011343, A011359.

Programs

  • Mathematica
    max = 3000; a[n_] := SequencePosition[RealDigits[n^(1/n), 10, max][[1]], IntegerDigits[n]][[1, 1]] - 1; Array[a, 100] (* Amiram Eldar, Sep 25 2020 *)
  • PARI
    a(n) = {if (n==1, 0, my(p=10000); default(realprecision, p+1); my(x = floor(10^p*n^(1/n)), d = digits(x), nb = #Str(n)); for(k=1, #d-nb+1, my(v=vector(nb, i, d[k+i-1])); if (fromdigits(v) == n, return(k-1));); error("not found"););} \\ Michel Marcus, Sep 30 2020
    
  • Python
    import gmpy2
    from gmpy2 import mpfr, digits, root
    gmpy2.get_context().precision=10**5
    def A337840(n): # increase precision if -1 is returned
        return digits(root(mpfr(n),n))[0].find(str(n)) # Chai Wah Wu, Oct 07 2020

Extensions

More terms from Amiram Eldar, Sep 25 2020