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: Tristan Young

Tristan Young's wiki page.

Tristan Young has authored 2 sequences.

A346035 a(1) = 1; if a(n) is not divisible by 3, a(n+1) = 4*a(n) + 1, otherwise a(n+1) = a(n)/3.

Original entry on oeis.org

1, 5, 21, 7, 29, 117, 39, 13, 53, 213, 71, 285, 95, 381, 127, 509, 2037, 679, 2717, 10869, 3623, 14493, 4831, 19325, 77301, 25767, 8589, 2863, 11453, 45813, 15271, 61085, 244341, 81447, 27149, 108597, 36199, 144797, 579189, 193063, 772253, 3089013, 1029671, 4118685
Offset: 1

Author

Tristan Young, Jul 02 2021

Keywords

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = If[Divisible[a[n-1],3], a[n-1]/3, 4*a[n-1]+1]; Array[a, 50] (* Amiram Eldar, Jul 12 2021 *)
  • PARI
    a(n) = if (n==1, 1, my(x=a(n-1)); if (x % 3, 4*x+1, x/3)); \\ Michel Marcus, Aug 12 2021
  • Processing
    // generates all the numbers in the sequence before it first surpasses 1 billion
    int n;
    void setup() {
      n = 1;
      noLoop();
    }
    void draw() {
      print(n + ",");
      while (true) {
        if (n % 3 == 0) {
          n /= 3;
        } else {
          n *= 4; n++;
        }
        print(n);
        if (n == 1 || n >= 600000000) {
          break;
        } else {
          print(", ");
        }
      }
    }
    

A330489 a(n) is equal to a(n-1) plus (a(n-1) written in base n but interpreted in base n+1), with a(1)=1.

Original entry on oeis.org

1, 2, 4, 9, 19, 41, 87, 193, 427, 940, 2049, 4619, 10363, 22921, 50522, 111018, 248438, 554112, 1232067, 2723158, 6003186, 13446356, 30050952, 66594552, 147234100, 324832999, 714046741, 1585188074, 3511557725, 7762753394, 17129248715, 37693951852, 82773271861
Offset: 1

Author

Tristan Young, Dec 15 2019

Keywords

Examples

			Given the 5th term in the sequence, the next (6th) term is the 5th term plus the result obtained by taking the 5th term's digits in order in base 6 (the index of the next term) and incrementing the base by 1 without changing the digits.
In this example, a(5) = 19 = 31_6; incrementing the base of 31_6 without changing the digits gives 31_7 = 22, and a(6) = a(5) + 22 = 19 + 22 = 41.
.
                      digits
                      of a(n-1)
             a(n-1)   interpreted
             in       in base n+1
  n  a(n-1)  base n   = k             k + a(n-1) = a(n)
  -  ------  ------   -----------   -------------------
  1                                                   1
  2     1      1_2      1_3 =   1     1 +   1    =    2
  3     2      2_3      2_4 =   2     2 +   2    =    4
  4     4     10_4     10_5 =   5     5 +   4    =    9
  5     9     14_5     14_6 =  10    10 +   9    =   19
  6    19     31_6     31_7 =  22    22 +  19    =   41
  7    41     56_7     56_8 =  46    46 +  41    =   87
  8    87    127_8    127_9 = 106   106 +  87    =  193
		

Programs

  • Mathematica
    a[n_] := a[n] = a[n-1] + FromDigits[ IntegerDigits[ a[n-1], n], n + 1]; Array[a, 33] (* Giovanni Resta, Dec 16 2019 *)
  • PARI
    lista(nn) = {my(a = 1); print1(a, ", "); for (n=2, nn, a += fromdigits(digits(fromdigits(digits(a, n), n+1))); print1(a, ", "););} \\ Michel Marcus, Dec 16 2019