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: Wilmer Emiro Castrillon Calderon

Wilmer Emiro Castrillon Calderon's wiki page.

Wilmer Emiro Castrillon Calderon has authored 4 sequences.

A330155 Triangle read by rows. Given n enumerated cards in a stack, with 1 at the top and n at the bottom, repeat the following process k times: remove the card in the middle (at position (size of the stack)/2, rounding up), and move the card at the bottom of the stack to the top. T(n,k) is the number of the last card removed.

Original entry on oeis.org

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

Author

Keywords

Examples

			Triangle begins:
  1;
  1,  2;
  2,  3,  1;
  2,  1,  3,  4;
  3,  1,  5,  2,  4;
  3,  2,  6,  5,  1,  4;
  4,  2,  1,  6,  5,  7,  3;
  4,  3,  1,  8,  6,  5,  7,  2;
  5,  3,  2,  9,  8,  6,  4,  7,  1;
  5,  4,  2,  1,  9,  8,  6,  3,  7, 10;
  ...
With n=5, row #5 is 3,1,5,2,4. In the diagram below, each "X" represents the removal of a card:
.
                          +-->4X
                          |
                   +-->2X |
                   |      |
            +-->4--+-->4--+
            |      |
     +-->5--+-->5X |
     |      |      |
  1--+-->1X |      |
     |      |      |
  2--+-->2--+-->2--+
     |      |
  3X |      |
     |      |
  4--+-->4--+
     |
  5--+
		

Crossrefs

This triangle is based on A308432.

Formula

T(n,n) = A308432(n), n > 0.
Conjecture: (Start)
Each diagonal forms a unique sequence S. Let S(m) be the m-th diagonal in T, for example with m=2, S(2) = 1,3,3,2,1,7,...; then T(n,k) = k-th element in S(n-k+1).
Let z = ceiling(m/2); the first z elements in S(m) are z,z-1,z-2,...,1.
Let G(x) = 3*((x-2)/2)+2 if x even,
3*((x-1)/2)+1 otherwise.
Let B(x) = Sum_{i=0..x-1} 2*G(m)*3^i.
Let C(x) = z if x=0,
B(x)+z otherwise.
C(x)-th element in S(m) is 1, for all x >= 0.
Let D(x) = G(m)*3^(x-1), with x > 0.
Let y = minimum x such that k <= C(x).
Finally S(m) = z-k+1 if z >= k,
D(y)+1 if C(y)-k >= D(y),
C(y)-k+1 otherwise.
for all k.
Then T(n,k) = k-th element in S(n-k+1).
(End)

A308432 Given n cards in a stack numbered from 1 to n with 1 at the top, repeat the following process: first remove the card that is in the middle (at position (size of the stack)/2, rounding up), then move the card that is at the bottom of the stack to the top. This process is repeated until there is only one card left. a(n) is the number of the last remaining card.

Original entry on oeis.org

1, 2, 1, 4, 4, 4, 3, 2, 1, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12
Offset: 1

Author

Keywords

Comments

a(n) = 1 if n is a power of 3.
a(n) = n if n-1 is a power of 3.
From Charlie Neder, Jun 09 2019: (Start)
Theorem: Formula below describes the sequence.
Proof: a(n-1) gives the final card from a deck of size n-1, so a(n) will be equal to whichever card occupies the a(n-1)-th position after one iteration. If a(n-1) = 1, this will be card n, if a(n-1) <= ceiling(n/2), this will be card a(n-1)-1, and otherwise it will be card a(n-1). If a(3^k) = 1 (true for k = 0), then for this k:
a(n) = 3^k + 1 for 3^k + 1 <= n <= 2*3^k,
a(n) = 3^(k+1) + 1 - n for 2*3^k + 1 <= n <= 3^(k+1),
and thus a(3^(k+1)) = 1, so the formula holds for all k. (End)

Programs

  • C
    //pow3 is a vector where pow3[n] = 3^n
    int f(int n){
        int x = 0;
        while(pow3[x+1] <= n) x++;
        return x;
    }
    int a(int n){
        int fn = f(n);
        if(n == pow3[fn]){
            return 1;
        }else if(n<=(pow3[fn]<<1) && n!=pow3[fn]){
            return pow3[fn]+1;
        }else{
            return pow3[fn+1] - (n-1);
        }
    }

Formula

Let t = 3^floor(log_3(n)); then
a(n) = 1 if n = t,
t + 1 if n <= 2*t and n != t,
3*t - n + 1 otherwise.

A323085 Semiprimes that are the sum of the first k terms of A092190 for some k.

Original entry on oeis.org

4, 14, 8567, 16499, 151211, 344891, 418831, 585197, 1049882, 1186582, 1671029, 2503966, 2989387, 4802311, 8291795, 9769711, 11420129, 13279957, 13677063, 15356513, 16258813, 24318863, 26874293, 39317497, 42862751
Offset: 1

Author

Keywords

Comments

If we call the semiprime numbers A001358 level 1, and A092190 level 2, then this sequence is level 3.

Examples

			a(2) = 14 = Sum_{i=1..2} A092190(i).
a(3) = 8567 = Sum_{i=1..13} A092190(i).
		

Crossrefs

Programs

  • Mathematica
    f[w_] := Select[Most@ NestWhile[Append[#1, {#2, #2 + #1[[-1, -1]]}] & @@ {#, w[[Length@ # + 1]]} &, {{#, #}} &@ First[w], #[[-1, -1]] <= Max@ w &][[All, -1]], PrimeOmega@ # == 2 &]; Block[{s = Select[Range[10^6], PrimeOmega@ # == 2 &], t}, f@ f@ s] (* Michael De Vlieger, Jan 04 2019 *)

A321944 Starting from n, repeatedly compute the sum of the prime divisors until a fixed point or 0 is reached; a(n) is the number of terms, including n.

Original entry on oeis.org

2, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 3, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 2, 4, 2, 3, 1, 3, 1, 2, 4, 2, 3, 2, 1, 4, 3, 2, 1, 3, 1, 2, 3, 3, 1, 2, 2, 2, 3, 4, 1, 2, 3, 3, 3, 2, 1, 3, 1, 5, 3, 2, 3, 3, 1, 2, 5, 4, 1, 2, 1, 4, 3, 4, 3, 3, 1, 2, 2, 2, 1, 3, 3, 4, 3, 2, 1, 3
Offset: 1

Author

Keywords

Comments

a(n) is 1 + the number of iterations of n -> A008472(n) until n = A008472(n) or n=0.
The fixed points are in A075860.
For n>1 the fixed point is a prime number.

Examples

			For n=21: 21->{3,7} 3+7=10, 10->{2,5} 2+5=7, 7->{7} 7; 3 terms found {21,10,7}, therefore a(21) = 3.
For n=2: 2->{2} 2, 1 term found {2}, therefore a(2) = 1.
For n=1: 1->{} 0, 2 term found {1,0}, therefore a(1) = 2.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) option remember;
      if isprime(n) then 1
      else 1+procname(convert(numtheory:-factorset(n),`+`))
      fi
    end proc:
    f(1):= 2:
    map(f, [$1..100]); # Robert Israel, Mar 30 2020
  • Mathematica
    s[n_] := DivisorSum[n, # &, PrimeQ[#] &]; a[1] = 2; a[n_] := Length[ FixedPointList[s, n]] - 1; Array[a, 60, 0] (* Amiram Eldar, Dec 12 2018 *)
  • PARI
    a(n)={my(k=1); while(n&&!isprime(n), k++; n=vecsum(factor(n)[, 1])); k} \\ Andrew Howroyd, Dec 12 2018